From b902217f076b97573244602412ae6a572d1cdcf5 Mon Sep 17 00:00:00 2001 From: Titus Date: Wed, 25 Nov 2026 13:57:34 +0100 Subject: [PATCH 1/2] 0.153.0: serial 147, and the calendar the World names The schema pin moves to v0.34.1-dist.147. calendar.speaking_calendar(world, elements) reads the World's x_calendar (the calendar profile's "Which calendar speaks"): a named element that carries a calendar speaks, matched as written; anything else named speaks none; none named, the only calendar. The tests replay what the serial adds: the twelve calendar cases for which calendar speaks, eleven address cases, the .owworld set at 111, and the new file-name set of 38 through folder.slugify. The world-file count now sits after its verdicts, so a red count never hides a disagreeing archive. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 5 + codegen/schema-dist/MANIFEST.json | 19 +- codegen/schema-dist/README.md | 7 +- codegen/schema-dist/VERSION | 2 +- .../fixtures/file-names.fixture.json | 201 +++ .../fail-OW-18-spatial-fold-alone.owworld | Bin 0 -> 2651 bytes .../fail-OW-18-world-fold-alone.owworld | Bin 0 -> 2424 bytes .../schema-dist/fixtures/owworld/generate.py | 12 + .../fixtures/owworld/verdicts.json | 22 + .../schema-dist/profiles/address.fixture.json | 148 ++- codegen/schema-dist/profiles/address.md | 8 +- .../profiles/calendar.fixture.json | 1165 ++++++++++++++++- codegen/schema-dist/profiles/calendar.md | 17 +- codegen/schema-pin.json | 15 +- src/onlyworlds/_schema.py | 8 +- src/onlyworlds/_version.py | 2 +- src/onlyworlds/calendar.py | 29 + tests/test_address.py | 4 +- tests/test_calendar.py | 8 +- tests/test_calendar_speaks.py | 71 + tests/test_calendar_steps.py | 2 +- tests/test_filenames.py | 18 + tests/test_worldfile.py | 3 +- 23 files changed, 1724 insertions(+), 42 deletions(-) create mode 100644 codegen/schema-dist/fixtures/file-names.fixture.json create mode 100644 codegen/schema-dist/fixtures/owworld/fail-OW-18-spatial-fold-alone.owworld create mode 100644 codegen/schema-dist/fixtures/owworld/fail-OW-18-world-fold-alone.owworld create mode 100644 tests/test_calendar_speaks.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b06c7..f7fe529 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.153.0 (2026-11-25) + +- **`calendar.speaking_calendar(world, elements)`: the calendar the world's dates speak in, by the World's own choice** (the calendar profile's "Which calendar speaks", schema-dist serial 147; the npm SDK's `speakingCalendar`). The World names it in `x_calendar` (`WORLD_CALENDAR_KEY`), the id of the element that carries it, matched as written. A named element among the elements that carries a calendar speaks; anything else named speaks none, never another calendar in its place; with none named (the key absent or None) the only calendar speaks, and several leave none. Pass the whole world's elements. A `world` that is not a mapping is a `TypeError`. Held by the fixture's 12 cases that carry `speaks`. +- The schema pin moves to `v0.34.1-dist.147` (canonical 00.34.01 unchanged, no schema file moved). The tests replay what the serial adds: the calendar's twelve cases for which calendar speaks (91 cases, 256 steps), eleven address cases (230), the `.owworld` set at 111 archives with two more where `world.json` or `spatial/` is named only through the case fold (`World.jſon`), and the new file-name set: `folder.slugify` gives all 38 of its slugs as written. + ## 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. diff --git a/codegen/schema-dist/MANIFEST.json b/codegen/schema-dist/MANIFEST.json index 9f70ce2..4ae0adf 100644 --- a/codegen/schema-dist/MANIFEST.json +++ b/codegen/schema-dist/MANIFEST.json @@ -38,6 +38,7 @@ "example/hyperion/elements/zone/swamps--d138f887.json": "d9e9caf3360daaecee51dab9716c7e4a444b47736284c0a6b4269d8b84ae2c45", "example/hyperion/world.json": "e888457dec6710c6492b18ebae9470618552a3d3c557e22b99fc76ed0e21a9f5", "example/world-export.json": "dfd36ff98b7d835e2bd4b022205dfc7424b367693e2f96416a79ca9b53c089b9", + "fixtures/file-names.fixture.json": "0da1846641e116b2ff39269261779854e794db117388bd912e5aff68a243a91d", "fixtures/owworld/CaseFolding-15.1.0.txt": "4e55acfdc32825a22e87670e9056a3bf94ad7c5400065778e9e10f8314372bcf", "fixtures/owworld/CompositionExclusions-15.1.0.txt": "59d2d9e3dfdf0a999cf9dae11d594f053631222679a2f5710315ea07f7fe82af", "fixtures/owworld/fail-OW-1-json-export.owworld": "f6159d0ae98ef51f9a9d920143e2c0b69bba08192d4d65a632dbd229443e8696", @@ -77,8 +78,10 @@ "fixtures/owworld/fail-OW-18-nfc-singleton-angstrom.owworld": "cfb310f0149799c90e5293c5329ab12a566b2e7f520bac5f65998814aca6e7f2", "fixtures/owworld/fail-OW-18-nfc-singleton.owworld": "3a59fafe021dd7ac4c37054d82f09be426cff46ba1a2363b2162b92560a24f59", "fixtures/owworld/fail-OW-18-nfc-then-fold.owworld": "d3ac0406fab115629ab33bfbefdc2ea8b56d9bb5a8fd61b7914f6f90a635b58a", + "fixtures/owworld/fail-OW-18-spatial-fold-alone.owworld": "118e955a2cbd8e20b139a48220431c2dc1044e1ba0e864fddbe6cca7adddb763", "fixtures/owworld/fail-OW-18-st-ligature.owworld": "dbab3c468e1c6689da96bdf38749fb4bba3e8730d03c35151cfbfdbae77bf61c", "fixtures/owworld/fail-OW-18-world-case-alone.owworld": "2c849b2c2b17159b4342f5bd62fe232558e809f4fe647298d3658c061467db5e", + "fixtures/owworld/fail-OW-18-world-fold-alone.owworld": "be40b3821da4a83623a6f675465719af2418a75a27d62f60587041750d30531b", "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", @@ -122,7 +125,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": "a1d7cb25bc3c5ffb31814cee43b5c0c2fda0c0c5da86cd7cd9e1df16b29ee4f8", + "fixtures/owworld/generate.py": "329e386406a90cd2da11b04788e2b67722e9214dd87bf57839cd9d5b763a72b5", "fixtures/owworld/pass-good.owworld": "11a577b054b87cc8e7d66f8070d791d413f3ab7527d4de82a9d19abbf5d1e856", "fixtures/owworld/pass-OW-1-renamed.zip": "11a577b054b87cc8e7d66f8070d791d413f3ab7527d4de82a9d19abbf5d1e856", "fixtures/owworld/pass-OW-10-api.owworld": "2304fcdaeb1ce7cbcc9aec2222716ba1219f347296d87d26df3e02273955fe1a", @@ -151,14 +154,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": "25d60a563ca822555c3202dffb7f8969f42490113444531af4f47264c885ace0", + "fixtures/owworld/verdicts.json": "c21b4ec6c355902a9cde1c45bd7f057e9833e31a3c6032a963cec9b801961693", "LICENSE": "3235f6ccc2b72375c517c1fdeef87954e8bfda17c5b1b485b98b5c2b4a1026d1", "pairs.json": "18a9918a2a3581a09c584b02aa418c926a613bc1c75d526b6bc9a4ad0cd89021", "presentation.json": "af84662c29628b6e90b923c9541f68f5924563adce397cebbadfdbf0f06e5f18", - "profiles/address.fixture.json": "922182d418225234184c5a7e3a3a152e2fde8059c0fe2aa98596a7faa0aab487", - "profiles/address.md": "94956efbc12335acd06b1ce49788c692262390acccd30d5c347659e6ddb61fee", - "profiles/calendar.fixture.json": "1caef0003392b60b9f0cf960232c009417c85d374ac8574c3b9fcec55adda7a9", - "profiles/calendar.md": "7ea97d91c0480b89078c84f303ee18b9da3cc648c0631974c72b145dd6344760", + "profiles/address.fixture.json": "4846f5dda7607efd9651bebb2f0b89b0df264b9d74496b01a35cca4c52d83895", + "profiles/address.md": "e5485cba07a1faa15e3e9e29c39df1751bbebf3f3d2c323b4106c29e3b98d200", + "profiles/calendar.fixture.json": "1ae922bc7af243453cac62053a31b2d10180e0ebb4843639dde9479f16e87206", + "profiles/calendar.md": "d63f1ba6036f9961377e56bda8ce16bf7bf60b7ec510f9042d397f97d3bbcfd8", "profiles/charter.fixture.json": "ea57091a988a4dd083d7d4cfc5e7985c6aa00f67fdce1b661c0d5023a15cbf35", "profiles/charter.md": "b0d27c04cd5dfaf421b2a6e54d53c1fca8ad9be72aa16516bbd3b5600ae61daa", "profiles/checks.fixture.json": "43586fddd94ebe9678bf46e6d744768a094f856b668c5917fe9e0dda46599251", @@ -195,7 +198,7 @@ "profiles/spine.md": "6bd367c3f4b101878fbc54a3c8c806630b7760173f24fef995db801b6103d92e", "profiles/strand.fixture.json": "7bc2d2dae11c0722b1db987c070b249ddcbc55b81683c4bfa26900c7ffe0fc53", "profiles/strand.md": "2a9bd36814a0de80a68180d2d75d3ef9d2539b9dcd52165f20b8ef0821575488", - "README.md": "a847f5198a3b18de2b947db1630966692d4782da56979575473de41c6e5b1eab", + "README.md": "e186fda7a396568825d31c2b45bf43657eb4f402bc72fed7c7140b2ede2a8fc3", "schema/ability.yaml": "af185b2d22a5985ac323e6227a95df287fffaae0e5fca502976a02c2754f71b2", "schema/base_properties.yaml": "ec3724ceb2faca973e431a2e2ff946e55bfb55b6b8d78689b6b22d0cfb7c9a2e", "schema/character.yaml": "dc291b206121bd23c69cb89e01a0523eb2f71b4a247116dd6a1fa4bc227ff145", @@ -222,7 +225,7 @@ "schema/zone.yaml": "cca04ee498fb813fa18b96f1ac99816e7f1a8ae1fb9e21c48b37620dbb674856", "schema.json": "581dc7b5e890acc06b1c89b0d7bdcc2f20f54f52d5a3b4af8c5a184e1e6fd48c", "SECURITY.md": "939ee364b06f0b749bdd4cbe66b2fe49322c95abe732650ec4ef062a0c03820a", - "VERSION": "d4cb014eb1322f6420f812d8408d37a4118bcd837fc7a1c0588c6e597da8e0f5", + "VERSION": "c8b12547293e2ef371d2e669607c8beef4ad4760116d921aa8644faa7770bc2b", "views.fixture.json": "f9a2713b26639d1cb2c792b9f28f95c57e576f8e6c123b5ad3eac2a2507dfcf8", "views.json": "f4d06ee16bd6c66fc28cf27146b8d199c85164e5deecabafc23af53408746fe0", "walk/lint_folder.py": "2c456cb917d692e3199f87bc6f7918bb20b91d6943d33feb0db0ac99519e1e87", diff --git a/codegen/schema-dist/README.md b/codegen/schema-dist/README.md index 69df5f7..0ba6a01 100644 --- a/codegen/schema-dist/README.md +++ b/codegen/schema-dist/README.md @@ -17,11 +17,12 @@ 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; 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 | +| `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, and `x_calendar` on the World, which calendar speaks; `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): 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 | +| `fixtures/owworld/` | the `.owworld` conformance set (folder spec 4.7): 111 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 | +| `fixtures/file-names.fixture.json` | how a writer makes the name part of an element's file name, the rule under "The example world": 38 element names and the name part each gives (`""` where a name leaves none, so the file is named by the full id). A writer in any language runs them and compares | | `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) | @@ -46,7 +47,7 @@ Only `id` and `name` are required. Element bodies read from the API also carry k ## The example world -`example/hyperion/` is a world folder: `world.json` for the world, and one JSON file per element at `elements//--.json`. The `id` inside a file is the element's identity; the filename is only for people. It needs no account or key: load it, check it against `schema.json`, and you have tested your reader on real data. The format is described at [World Folders](https://onlyworlds.github.io/docs/schema/folders). The folder format is at 0.3.24 (the spec's own version line); a folder stamps `format_version` from it. +`example/hyperion/` is a world folder: `world.json` for the world, and one JSON file per element at `elements//--.json`. The `id` inside a file is the element's identity; the filename is only for people. Its name part is made one way, so that two writers give an element the same name part: the element's name is put in Unicode's NFKD form; every code point from U+0300 to U+036F is dropped, and no other mark; the rest is lowercased by Unicode's default case mapping, in no locale; every run of characters outside `a` to `z` and `0` to `9` becomes one hyphen; hyphens at the start and the end are dropped; a name part longer than 40 characters is cut at 40, and hyphens at its new end are dropped; the forms and the case mapping are those of Unicode 11.0, and a code point Unicode assigned after 11.0 is promised nothing. A name that leaves nothing gives a file named by the full id (`.json`). A reader never leans on any of it: it reads the `id`. `fixtures/file-names.fixture.json` holds the cases. It needs no account or key: load it, check it against `schema.json`, and you have tested your reader on real data. The format is described at [World Folders](https://onlyworlds.github.io/docs/schema/folders). The folder format is at 0.3.24 (the spec's own version line); a folder stamps `format_version` from it. ## Using the walk (Python) diff --git a/codegen/schema-dist/VERSION b/codegen/schema-dist/VERSION index b151c9a..7406ea1 100644 --- a/codegen/schema-dist/VERSION +++ b/codegen/schema-dist/VERSION @@ -1,3 +1,3 @@ canonical: 00.34.01 -serial: 146 +serial: 147 published: 2026-11-25 diff --git a/codegen/schema-dist/fixtures/file-names.fixture.json b/codegen/schema-dist/fixtures/file-names.fixture.json new file mode 100644 index 0000000..3b145f2 --- /dev/null +++ b/codegen/schema-dist/fixtures/file-names.fixture.json @@ -0,0 +1,201 @@ +{ + "profile": "file_names", + "profile_page": "README.md", + "notes": [ + "element_name: a new element's name; slug: what a conforming writer makes of it.", + "An empty slug means the name leaves none, and the file is `.json`; otherwise the file is `--.json`. The tail and the writer's collision rule are not this set's.", + "Every code point here is assigned in Unicode 11.0." + ], + "cases": [ + { + "name": "plain-ascii", + "element_name": "Ana", + "slug": "ana" + }, + { + "name": "acute-precomposed", + "element_name": "Brother Tomás", + "slug": "brother-tomas" + }, + { + "name": "acute-decomposed", + "element_name": "José", + "slug": "jose" + }, + { + "name": "acute-decomposed-inside-a-word", + "element_name": "Cafés Rún", + "slug": "cafes-run" + }, + { + "name": "caron-and-capitals", + "element_name": "Žižkov", + "slug": "zizkov" + }, + { + "name": "ae-and-o-slash-no-decomposition", + "element_name": "Ærøskøbing", + "slug": "r-sk-bing" + }, + { + "name": "ligature-fi", + "element_name": "fire", + "slug": "fire" + }, + { + "name": "sharp-s", + "element_name": "Straße", + "slug": "stra-e" + }, + { + "name": "upper-case", + "element_name": "ÉCOLE NORMALE", + "slug": "ecole-normale" + }, + { + "name": "spaces-and-punctuation-runs", + "element_name": " --Hello__World!! ", + "slug": "hello-world" + }, + { + "name": "leading-and-trailing-hyphens", + "element_name": "-lead and trail-", + "slug": "lead-and-trail" + }, + { + "name": "digits-and-hyphen", + "element_name": "R2-D2", + "slug": "r2-d2" + }, + { + "name": "tab-and-newline", + "element_name": "Line\tOne\nTwo", + "slug": "line-one-two" + }, + { + "name": "cut-lands-on-a-hyphen", + "element_name": "aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaa b", + "slug": "aaaaaaaaaa-aaaaaaaaaa-aaaaaaaaaa-aaaaaa" + }, + { + "name": "cut-mid-word", + "element_name": "aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaa b", + "slug": "aaaaaaaaaa-aaaaaaaaaa-aaaaaaaaaa-aaaaaaa" + }, + { + "name": "ligatures-longer-after-folding", + "element_name": "ffiffiffiffiffiffiffiffiffiffiffiffiffiffi", + "slug": "ffiffiffiffiffiffiffiffiffiffiffiffiffif" + }, + { + "name": "supplementary-letters-at-the-cut", + "element_name": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa𝐀𝐁", + "slug": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "name": "emoji-at-the-cut", + "element_name": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa😀bb", + "slug": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-b" + }, + { + "name": "greek", + "element_name": "Ἀθῆναι", + "slug": "" + }, + { + "name": "greek-and-a-digit", + "element_name": "Ἀθῆναι 2", + "slug": "2" + }, + { + "name": "cyrillic", + "element_name": "Москва", + "slug": "" + }, + { + "name": "cjk", + "element_name": "日本", + "slug": "" + }, + { + "name": "hangul", + "element_name": "서울", + "slug": "" + }, + { + "name": "arabic", + "element_name": "القاهرة", + "slug": "" + }, + { + "name": "a-mark-outside-the-block", + "element_name": "aَb", + "slug": "a-b" + }, + { + "name": "a-supplementary-mark", + "element_name": "a𝅧b", + "slug": "a-b" + }, + { + "name": "emoji-and-a-word", + "element_name": "🐉 Dragon", + "slug": "dragon" + }, + { + "name": "only-punctuation", + "element_name": "!!!", + "slug": "" + }, + { + "name": "empty", + "element_name": "", + "slug": "" + }, + { + "name": "only-white-space", + "element_name": " ", + "slug": "" + }, + { + "name": "windows-reserved-con", + "element_name": "con", + "slug": "con" + }, + { + "name": "windows-reserved-nul", + "element_name": "NUL", + "slug": "nul" + }, + { + "name": "trailing-dot", + "element_name": "Mr. Smith.", + "slug": "mr-smith" + }, + { + "name": "roman-numeral-twelve", + "element_name": "Ⅻ Legion", + "slug": "xii-legion" + }, + { + "name": "vulgar-fraction-one-half", + "element_name": "½ moon", + "slug": "1-2-moon" + }, + { + "name": "full-width-letters", + "element_name": "Full", + "slug": "full" + }, + { + "name": "dotted-capital-i", + "element_name": "İstanbul", + "slug": "istanbul" + }, + { + "name": "kelvin-sign", + "element_name": "K2", + "slug": "k2" + } + ] +} diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-18-spatial-fold-alone.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-18-spatial-fold-alone.owworld new file mode 100644 index 0000000000000000000000000000000000000000..4bfee42a40a0617fce804ade321b2fd8fea6cf93 GIT binary patch literal 2651 zcmbVN+i%-c7**UJ84ACbpt?(srTsO%C(gaRw+CUly$EZvQ z3Gskd5aMCtiGQFgluIXgnb2OC)Ht_NX!pPi3>99GCLwM@n#y_!;Np@jliB(izb`gY zS;#ONqH`k}qd7WyjpFd#KkBHSl(KhLcZUht!*lX#;MM~0dl@2e7|*<+n+uvjoBE`C`=HMD|m%vF&x{cKv9nziflK4@ra-Wq?L}O zBw7LeSbWlHnk)--WThx9PQhx3)M{pfPw{D5AuWWQGC`_HM_Y~dEWE@zHG(|88R4ni zy26Q#h_nmS?7r8dMqmX68jrmD-3b`scof1*w4~-ytnj)~)r~kC>MRjngG}?O(?2}~ zBOGH8{h1|gZeBBD`C|Faw?;yDZ`>sIybvEEpcBk*{rh@hyZPtmpq({{Q{BZ3#C1%DO>7-#GJ=rxY}rtn;*%E2qFm255O`XO zSrl1w8gFFCR;p2(;p~kL@CSFKP4lyK<6%U0wrzF z+S55wTSh%<+ML*#h&xh@wh%2y;BFngN;K%sRx25akY8`zMhM-mx9is^JY8f*Y_*+b zfIw{mSe~}Q9%t>KU|aPp%dp=k;+qNfk#Xh=7XM#S?tq-Pu?-7rv1Ofm6 literal 0 HcmV?d00001 diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-18-world-fold-alone.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-18-world-fold-alone.owworld new file mode 100644 index 0000000000000000000000000000000000000000..617dec72a3406acd1bda2af55d288bc4a8ea2e8b GIT binary patch literal 2424 zcmbVN&2Jk;6kn%K36>&JR1QQ)tbJ*0ydU1if%*c0M0mZnvvr+Bsz70FPhz+09W%Se ziK<)>LKF@?ApQpkDu*CW73zgb#BoTepqFysLxE!j;-f;U!kgK|8*f}wb?mo0JM-Re ze*3;w*Nz2Ga@+_9Bg|F5-~RJzfa9o~fEA-uLaWjOCT2yvaN|0*E`@kLQmaH#d_Y##llc}sImJ6w#EZDap7=7hmN2OsRvGb2wH2pHkbR0T88#AKM7HZJzJ-Xr4=RhN z#f0MS+PF!|ln#9rAZH^2n)K+Z<23A)B(+*C5nJXeJI)r%xXvs=m#t9Mhkkc3G8}55 z$jYRUkOd`Cl;srrpN{~8HRd6-(!j()l|{q$m|d({%+a`I0YRz3VFuJsZvCg#zSHTg|#b z)Ah`j)Xv3ea%S2cExum-TFt4mLSeiuNv@l~R1;#~bau{xlH&RZ?9}b38lT@Nq_s{o zzYE9gzJDkiffYC?5qBxg_u6%C@4!o-4-g-{H}hBwW>mr;gCN8@atz>;;?MA$zZxw6*hPgDrPEg>&NH#^$Cr(^kC4k97{ z=GJv!=p^^xuL~S@Xt*!8;C*X!ZQuL>4a~Fs0aDU6f2elm2ljUy5BQy-0l//` when the world has a slug, and shows the slug in its own links. A reader of the human form accepts a slug (3 to 40 lowercase letters, numbers and single hyphens, no hyphen at either end) and reports it as a slug, not canonical. A writer never writes one: a slug can change or be released, and an id never does. The text form across worlds takes the id only. +**The world's id, never its slug.** The site also answers at `/w///` when the world has a slug, and shows the slug in its own links. A reader of the human form accepts a slug (3 to 40 of the lowercase letters `a` to `z`, the digits `0` to `9` and single hyphens, no hyphen at either end, and never one of the 22 type words) and reports it as a slug, not canonical. A writer never writes one: a slug can change or be released, and an id never does. The text form across worlds takes the id only. **The moment and the lens.** Any of the three spellings may carry either or both, the moment first: @@ -28,7 +28,7 @@ ow:///@?lens= ow:////@?lens= ``` -- **The moment** is `@` and one step of the world's time line, at the end of the last path segment, after the id and before any query. A step is what every date field in the standard holds: a whole number in the world's `time_basic_unit`, step 0 the world's own zero, negative before it, within the 32-bit range (-2147483648 to 2147483647). It is written in decimal with no plus sign, no leading zero and no `-0`. It is never calendar words: a world may hold several calendars, and the calendar profile reads a step into words for whichever one a tool speaks. The `@` is written raw, never as `%40`. These characters (`@`, `-`, the digits) are ones a URL parser keeps intact in a path, so the moment survives a browser, a share sheet and a URL library unchanged; in a query it would be the lens's, and after `#` it would never reach a server. A site or a tool that cannot show a moment may ignore it and show the element as it stands; the address is the same address. +- **The moment** is `@` and one step of the world's time line, at the end of the last path segment, after the id and before any query. A step is what every date field in the standard holds: a whole number in the world's `time_basic_unit`, step 0 the world's own zero, negative before it, within the 32-bit range (-2147483648 to 2147483647). It is written in decimal, one optional `-` and then one or more of the ASCII digits `0` to `9` and nothing else, with no plus sign, no leading zero and no `-0`. It is never calendar words: a world may hold several calendars, and the calendar profile reads a step into words for whichever calendar speaks (`calendar.md`). The `@` is written raw, never as `%40`. These characters (`@`, `-`, the digits) are ones a URL parser keeps intact in a path, so the moment survives a browser, a share sheet and a URL library unchanged; in a query it would be the lens's, and after `#` it would never reach a server. A site or a tool that cannot show a moment may ignore it and show the element as it stands; the address is the same address. - **The lens** is the query key `lens` with an element's id: it asks for a reading of the element through that lens. A lens in a link never widens what the reader may see; the reader's own access decides that, as it would without the lens. `lens` is the only query key the profile reads, at most once, in lowercase. A reader ignores any other query key and any fragment (a share sheet adds its own), and reports the address as not canonical. It reads the human address only as written here: `https` and the `www.onlyworlds.com` host. An `http` link, the bare `onlyworlds.com` host or any other host refuses as `not_an_address`, so a reader never guesses which site a string meant. Nothing in an address is percent-decoded: every part the grammar reads is written in characters a URL never encodes. @@ -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). 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. +**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 one optional `-` and then the ASCII digits, and is taken only when that run reads as one step (in `@5-3` the moment is 5 and `-3` is prose; after `@٥` there is no such run, so no moment is taken and the address ends before the `@`), 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: the lowercase letters `a` to `z`, the digits `0` to `9`, 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, the digits `0` to `9`, hyphens, and the upper-case hex letters A to F). A run after `/w/` 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. A read at an index answers an address only where one begins exactly at that index, looks back no further than the one code point before it, and never searches forward; that addresses do not overlap is the rule of a find over a whole text. **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. 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. +**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. 2026-11-25, serial 147: a moment is written as one optional `-` and then the ASCII digits `0` to `9`, so a string read whole refuses `@5-3` and `@٥` (U+0665) as `bad_moment`, and in prose the address ends where that grammar ends (`@5-3` holds the moment 5 and `-3` is prose; `@٥` holds no moment and the address ends before the `@`); a slug's letters are the lowercase letters `a` to `z` and its digits `0` to `9`, and a slug is never one of the 22 type words, so `/w/café/…`, a slug holding `٥` and `/w/event/…` refuse `bad_world`, while in prose a digit of another script ends a slug's run (`/w/abc٥` holds the world `abc`), and the paragraph on prose now reads `/w/event.` as no address, as its case already said; the run cut inside a word is the run after `/w/`, so a letter after a moment is prose; a read at an index answers an address only where one begins exactly there, looks back one code point and never searches forward, and addresses do not overlap in a find over a whole text; eleven cases more in the fixture, five parse and six prose, eighty-three prose cases in all; the platform's reader took a type word for a slug, in the parse and in prose, and moves. diff --git a/codegen/schema-dist/profiles/calendar.fixture.json b/codegen/schema-dist/profiles/calendar.fixture.json index bb35360..aa3c716 100644 --- a/codegen/schema-dist/profiles/calendar.fixture.json +++ b/codegen/schema-dist/profiles/calendar.fixture.json @@ -10,8 +10,9 @@ "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.", - "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." + "elements and found (found-by-the-field-never-by-type, and the world cases below): a world's elements, and the ids of those a reader finds a calendar on, in list order: by the atlas_calendar field holding one (null is absent, and a value that is not a calendar holds none), 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.", + "world and speaks (twelve cases, the world-names ones): the World's own keys, x_calendar among them when the World names a calendar, absent or null when it names none; and the id of the element whose calendar speaks, or null when none does. Every calendar in such a case is value, and its steps read as in any case; an element that carries a value that is not a calendar carries refuse-version's value." ], "cases": [ { @@ -5399,6 +5400,1166 @@ "time_range_max", "time_range_min" ] + }, + { + "name": "world-names-one-of-two-calendars", + "why": "the World's x_calendar names the second of two calendars, so that one speaks, never the first in the list", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The old calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb02", + "type": "construct", + "supertype": "calendar", + "name": "The calendar the World names", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01", + "019a3b10-0000-7000-8000-00000000cb02" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons", + "x_calendar": "019a3b10-0000-7000-8000-00000000cb02" + }, + "speaks": "019a3b10-0000-7000-8000-00000000cb02" + }, + { + "name": "world-names-an-id-no-element-has", + "why": "the World's x_calendar names an id no element of the world has: no calendar speaks, and the one calendar the world holds does not speak in its place", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb03", + "type": "character", + "supertype": "", + "name": "A Character" + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons", + "x_calendar": "019a3b10-0000-7000-8000-00000000cb09" + }, + "speaks": null + }, + { + "name": "world-names-none-the-only-calendar-speaks", + "why": "the World names no calendar and the world holds exactly one, so that one speaks", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb03", + "type": "character", + "supertype": "", + "name": "A Character" + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons" + }, + "speaks": "019a3b10-0000-7000-8000-00000000cb01" + }, + { + "name": "world-names-none-two-calendars-none-speaks", + "why": "the World names no calendar and the world holds two, so none speaks", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The first calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb02", + "type": "construct", + "supertype": "calendar", + "name": "The second calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01", + "019a3b10-0000-7000-8000-00000000cb02" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons" + }, + "speaks": null + }, + { + "name": "world-names-none-a-value-not-a-calendar-listed-first", + "why": "the World names no calendar; the first element's atlas_calendar is not a calendar, so it carries none and is not counted, and the one calendar the world holds speaks", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "A value that is not a calendar", + "atlas_calendar": { + "version": 3, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb02", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb02" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons" + }, + "speaks": "019a3b10-0000-7000-8000-00000000cb02" + }, + { + "name": "world-names-none-a-value-not-a-calendar-listed-second", + "why": "the same world with its elements in the other order: the value that is not a calendar is still not counted, and the one calendar speaks", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb02", + "type": "construct", + "supertype": "calendar", + "name": "A value that is not a calendar", + "atlas_calendar": { + "version": 3, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons" + }, + "speaks": "019a3b10-0000-7000-8000-00000000cb01" + }, + { + "name": "world-names-an-element-whose-value-is-not-a-calendar", + "why": "the World's x_calendar names an element whose atlas_calendar is not a calendar: it carries none, so no calendar speaks, and the good calendar beside it does not speak in its place", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "A value that is not a calendar", + "atlas_calendar": { + "version": 3, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb02", + "type": "construct", + "supertype": "calendar", + "name": "The good calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb02" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons", + "x_calendar": "019a3b10-0000-7000-8000-00000000cb01" + }, + "speaks": null + }, + { + "name": "world-names-the-id-in-upper-case", + "why": "the World's x_calendar holds the one calendar's id in upper case: ids are matched as written, so it names nothing and no calendar speaks", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb03", + "type": "character", + "supertype": "", + "name": "A Character" + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons", + "x_calendar": "019A3B10-0000-7000-8000-00000000CB01" + }, + "speaks": null + }, + { + "name": "world-names-null-the-only-calendar-speaks", + "why": "the World's x_calendar is null, which is absent, so it names none and the only calendar speaks", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb03", + "type": "character", + "supertype": "", + "name": "A Character" + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons", + "x_calendar": null + }, + "speaks": "019a3b10-0000-7000-8000-00000000cb01" + }, + { + "name": "world-names-an-empty-string", + "why": "the World's x_calendar is an empty string, a value that is no id and not absent: no calendar speaks, and the only calendar does not speak in its place", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb03", + "type": "character", + "supertype": "", + "name": "A Character" + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons", + "x_calendar": "" + }, + "speaks": null + }, + { + "name": "world-names-a-list-holding-the-id", + "why": "the World's x_calendar is a list holding the only calendar's id, a value that is no id: no calendar speaks", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb03", + "type": "character", + "supertype": "", + "name": "A Character" + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons", + "x_calendar": [ + "019a3b10-0000-7000-8000-00000000cb01" + ] + }, + "speaks": null + }, + { + "name": "world-names-an-element-that-carries-no-calendar", + "why": "the World's x_calendar names an element of the world that carries no atlas_calendar: no calendar speaks, and the one calendar elsewhere does not speak in its place", + "value": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + }, + "valid": true, + "steps": [ + { + "step": 0, + "words": "1 Frost, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 1, + "monthName": "Frost", + "day": 1, + "intercalary": null, + "weekday": null + } + }, + { + "step": 12, + "words": "3 Thaw, 0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": 2, + "monthName": "Thaw", + "day": 3, + "intercalary": null, + "weekday": null + } + } + ], + "elements": [ + { + "id": "019a3b10-0000-7000-8000-00000000cb01", + "type": "construct", + "supertype": "calendar", + "name": "The only calendar", + "atlas_calendar": { + "version": 1, + "grain": "day", + "bundles": { + "months": { + "names": [ + "Frost", + "Thaw" + ], + "lengths": [ + 10, + 10 + ] + } + } + } + }, + { + "id": "019a3b10-0000-7000-8000-00000000cb03", + "type": "character", + "supertype": "", + "name": "A Character" + } + ], + "found": [ + "019a3b10-0000-7000-8000-00000000cb01" + ], + "world": { + "id": "019a3b10-0000-7000-8000-00000000cb00", + "name": "A world of two seasons", + "x_calendar": "019a3b10-0000-7000-8000-00000000cb03" + }, + "speaks": null } ] } diff --git a/codegen/schema-dist/profiles/calendar.md b/codegen/schema-dist/profiles/calendar.md index ae8a7a6..80b9c6d 100644 --- a/codegen/schema-dist/profiles/calendar.md +++ b/codegen/schema-dist/profiles/calendar.md @@ -4,9 +4,16 @@ **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. +**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; the World's key is `x_calendar`. -**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. +**On which element.** Any element may carry it; a reader finds calendars by the field holding one, 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 calendar speaks.** The World may name its calendar in the key `x_calendar`, on the World (the body `GET /world` returns, `world.json` in a folder), beside the world's other settings (`time_*`, the units). Its value is the id of the element that carries the calendar: one id, so a world names one calendar or none. An element whose `atlas_calendar` is not a calendar (below) carries none. A reader reads it so: +- The World names an element that is among the world's elements and carries a calendar: that calendar speaks. +- The World names anything else (an id no element of the world has, the id in another letter case among them, since an id is matched as written, as the address profile's "The same id" says; an element that carries no calendar; a value that is no id): no calendar speaks and the dates stay bare numbers, never another calendar in its place. +- The World names none (the key absent or `null`): with exactly one calendar among the world's elements, that one speaks; with several, none. + +A tool with a person in front of it may keep that person's own pick over the World's. **The value.** A JSON object (a reader also accepts the same object as a JSON string, strict JSON only; a writer writes the object): @@ -48,8 +55,8 @@ The TypeScript SDK holds this whole as `breakdownStep` and `formatStep` (and `pa Every reader refuses the same values, or one tool shows a calendar where another shows numbers. -**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). +**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). A re-key that moves the named element's id moves the World's `x_calendar` that holds it. -**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. +**Conformance.** `calendar.fixture.json`, beside this page: 91 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), 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), 1 for serial 146 (`date-fields-by-their-name`: which fields are dates) and 12 for serial 147 (the `world-names-` cases: which calendar speaks); 48 calendars with 256 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, and twelve, the `world-names-` cases, also carry the World's own keys (`world`) beside the world's elements and the id of the element whose calendar speaks (`speaks`, or `null` when none does). 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. 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). +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). Amended 2026-11-25, serial 147 (which calendar speaks: the World may name one in `x_calendar`, the id of the element that carries it, matched as written; a named element among the world's elements that carries a calendar speaks, anything else named leaves the dates bare and never speaks another, and with none named the only calendar speaks and several leave none; an element whose value is not a calendar carries none, so it is neither counted nor spoken when named; a re-key that moves the element's id moves `x_calendar`; a tool with a person in front of it may keep that person's own pick), from the readers' runs, in which every reader spoke the only calendar or none and none stored a choice another tool could read. diff --git a/codegen/schema-pin.json b/codegen/schema-pin.json index f0d79ee..0e7de68 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.146", - "commit": "7f29ae431bd37d9f779153aac175f63fa3551432", - "manifest_sha256": "1d948463a5e8c13026ac069dd4ae91c22ba3f5fc4ba81508a7d08a600638f367", + "tag": "v0.34.1-dist.147", + "commit": "9d7fb973fd4842c68c7d39111003b7f3dbcfc9a1", + "manifest_sha256": "beaa7093c2ae47b4f47afd8ce3672223f72015f3d014f7a890af5ebb15fecc8f", "canonical_version": "00.34.01", - "dist_serial": 146, + "dist_serial": 147, "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.", + "pinned_by": "The maintainer: tree from `git archive` of the tag in a schema-dist checkout (232 files: the 231 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.146", + "manifest_sha256": "1d948463a5e8c13026ac069dd4ae91c22ba3f5fc4ba81508a7d08a600638f367", + "note": "serial 147: the World's x_calendar and twelve world-names calendar cases, eleven address cases, the world-file set at 111, fixtures/file-names.fixture.json (38)" + }, { "tag": "v0.34.1-dist.145", "manifest_sha256": "55c71236d409108a99d6336170bbc309c2d0a8309e7bd61fe20484bac19c7231", diff --git a/src/onlyworlds/_schema.py b/src/onlyworlds/_schema.py index eeef481..7eac337 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.146 (7f29ae431bd37d9f779153aac175f63fa3551432) +# Source: https://github.com/OnlyWorlds/schema-dist @ v0.34.1-dist.147 (9d7fb973fd4842c68c7d39111003b7f3dbcfc9a1) """Schema provenance, the 22 element types and their fields, from the pinned schema distribution.""" -SCHEMA_DIST_TAG = "v0.34.1-dist.146" +SCHEMA_DIST_TAG = "v0.34.1-dist.147" SCHEMA_VERSION = "00.34.01" -SCHEMA_DIST_SERIAL = 146 -SCHEMA_MANIFEST_SHA256 = "1d948463a5e8c13026ac069dd4ae91c22ba3f5fc4ba81508a7d08a600638f367" +SCHEMA_DIST_SERIAL = 147 +SCHEMA_MANIFEST_SHA256 = "beaa7093c2ae47b4f47afd8ce3672223f72015f3d014f7a890af5ebb15fecc8f" # Canonical order, as the walk declares it. ELEMENT_TYPES: tuple[str, ...] = ( diff --git a/src/onlyworlds/_version.py b/src/onlyworlds/_version.py index 73a0ec2..e9f59dd 100644 --- a/src/onlyworlds/_version.py +++ b/src/onlyworlds/_version.py @@ -1 +1 @@ -__version__ = "0.152.0" +__version__ = "0.153.0" diff --git a/src/onlyworlds/calendar.py b/src/onlyworlds/calendar.py index 7f9a40e..21386b9 100644 --- a/src/onlyworlds/calendar.py +++ b/src/onlyworlds/calendar.py @@ -1870,6 +1870,35 @@ def resolve_calendar( return next((c for c in world_calendars(elements) if _strict_eq(c.id, active_id)), None) +WORLD_CALENDAR_KEY: Final = "x_calendar" +"""The World's key that names its calendar: the id of the element that carries it.""" + + +def speaking_calendar(world: Mapping[str, Any], elements: Iterable[Mapping[str, Any]]) -> WorldCalendar | None: + """The calendar the world's dates speak in, by the World's own choice (the calendar profile, "Which calendar + speaks"). ``world`` is the World's keys (the body ``GET /world`` returns, ``world.json`` in a folder); + ``elements`` are the world's elements. + + - The World names, in ``x_calendar``, the id of an element among ``elements`` that carries a calendar: that + calendar speaks. The id is matched as written, letter case included. + - The World names anything else (an id no element has, an element with no calendar or one whose value is not + a calendar, an empty string, a value that is no string): none speaks, and the dates stay bare numbers. + Another calendar never speaks in its place. + - The World names none (the key absent or None): the only calendar among ``elements`` speaks; with several, + none. + + Pass the whole world's elements: a reader that holds part of a world can miss the named element or a second + calendar. A tool with a person in front of it may keep that person's own pick over the World's + (``resolve_calendar``). A ``world`` that is not a mapping is a TypeError. + """ + if not isinstance(world, Mapping): + raise TypeError(f"speaking_calendar: world must be the World's keys, a mapping, not {type(world).__name__}") + named = world.get(WORLD_CALENDAR_KEY) + if named is None: + return resolve_calendar(elements, fallback_to_only=True) + return resolve_calendar(elements, named) if isinstance(named, str) else None + + def resolve_calendar_lens( elements: Iterable[Mapping[str, Any]], active_id: str | _NotChosen | None = _NOT_CHOSEN, diff --git a/tests/test_address.py b/tests/test_address.py index 00fce18..2df453c 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) == 219, f"the fixture holds {len(cases)} cases, serial 146 has 219" - assert kinds == {"parse": 104, "format": 36, "prose": 77, "prose-all": 2} + assert len(cases) == 230, f"the fixture holds {len(cases)} cases, serial 147 has 230" + assert kinds == {"parse": 109, "format": 36, "prose": 83, "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 5377e43..ce0af45 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) == 79 - assert sum(c["valid"] for c in cases) == 36 and sum(not c["valid"] for c in cases) == 43 + assert len(cases) == 91 # serial 147 + assert sum(c["valid"] for c in cases) == 48 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) == 232 + assert sum(len(c.get("steps", [])) for c in cases) == 256 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 == 232 + assert replayed == 256 def test_the_reader_returns_the_value_itself_unknown_keys_kept() -> None: diff --git a/tests/test_calendar_speaks.py b/tests/test_calendar_speaks.py new file mode 100644 index 0000000..07da4f7 --- /dev/null +++ b/tests/test_calendar_speaks.py @@ -0,0 +1,71 @@ +"""Which calendar speaks (the calendar profile, serial 147): ``speaking_calendar(world, elements)`` on every case of the +vendored ``profiles/calendar.fixture.json`` that carries ``speaks``, the World's keys beside the world's elements; the +same cases as the npm SDK's ``speakingCalendar`` test.""" + +from __future__ import annotations + +import json +from collections.abc import Iterator, Mapping +from pathlib import Path +from typing import Any + +import pytest + +from onlyworlds.calendar import WORLD_CALENDAR_KEY, speaking_calendar + +FIXTURE = Path(__file__).resolve().parents[1] / "codegen" / "schema-dist" / "profiles" / "calendar.fixture.json" +CASES = [c for c in json.loads(FIXTURE.read_text(encoding="utf-8"))["cases"] if "speaks" in c] + + +def test_every_case_that_says_which_calendar_speaks_answers_as_written() -> None: + wrong = [] + for c in CASES: + try: + found = speaking_calendar(c["world"], c["elements"]) + got: Any = found.id if found is not None else None + except Exception as err: # a case that raises is wrong, never passed over + got = f"raised {err!r}" + if got != c["speaks"]: + wrong.append(f"{c['name']}: gave {got}, the fixture says {c['speaks']}") + assert wrong == [] + # After the cases, so a red pin never hides a case: serial 147 carries 12. + assert len(CASES) == 12, f"the fixture holds {len(CASES)} cases that say which calendar speaks, serial 147 has 12" + + +CAL: dict[str, Any] = { + "version": 1, + "grain": "day", + "bundles": {"months": {"names": ["Frost", "Thaw"], "lengths": [10, 10]}}, +} +ELEMENTS: list[dict[str, Any]] = [ + {"id": "a", "name": "A", "atlas_calendar": CAL}, + {"id": "b", "name": "B", "atlas_calendar": json.dumps(CAL)}, +] + + +def _id(world: Mapping[str, Any], elements: Any = ELEMENTS) -> str | None: + found = speaking_calendar(world, elements) + return found.id if found is not None else None + + +def test_the_key_is_x_calendar() -> None: + assert WORLD_CALENDAR_KEY == "x_calendar" + assert _id({"x_calendar": "b"}) == "b" # a calendar stored as a JSON string speaks + assert _id({}, ELEMENTS[:1]) == "a" # none named and one calendar: it speaks + assert _id({}) is None # none named and two: none + assert _id({"x_calendar": 7}, ELEMENTS[:1]) is None # a value that is no id speaks none + assert _id({"x_calendar": True}, ELEMENTS[:1]) is None + + +def test_elements_may_be_any_iterable() -> None: + def gen() -> Iterator[dict[str, Any]]: + yield from ELEMENTS + + assert _id({"x_calendar": "a"}, gen()) == "a" + assert _id({}, gen()) is None + + +@pytest.mark.parametrize("world", [None, "x_calendar", 3, ["a"]]) +def test_a_world_that_is_not_a_mapping_is_the_callers_bug(world: Any) -> None: + with pytest.raises(TypeError): + speaking_calendar(world, ELEMENTS) diff --git a/tests/test_calendar_steps.py b/tests/test_calendar_steps.py index ee8d625..30e72bf 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) == 36 # counted, so a fixture that stops loading fails here rather than passing on nothing + assert len(CASES) == 48 # 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_filenames.py b/tests/test_filenames.py index 31c5e54..b75537a 100644 --- a/tests/test_filenames.py +++ b/tests/test_filenames.py @@ -1,6 +1,8 @@ from __future__ import annotations import itertools +import json +from pathlib import Path import pytest @@ -65,3 +67,19 @@ def test_collision_is_case_folded() -> None: def test_duplicate_id_is_refused() -> None: with pytest.raises(ValueError): resolve_filenames([(UUID, "a"), (UUID, "b")]) + + +FILE_NAMES = Path(__file__).resolve().parents[1] / "codegen" / "schema-dist" / "fixtures" / "file-names.fixture.json" + + +def test_the_file_names_set_every_slug_as_written() -> None: + """The schema dist's file-name set (serial 147): what a conforming writer makes of a new element's name.""" + cases = json.loads(FILE_NAMES.read_text(encoding="utf-8"))["cases"] + wrong = [ + f"{c['name']}: {slugify(c['element_name'])!r} for {c['slug']!r}" + for c in cases + if slugify(c["element_name"]) != c["slug"] + ] + assert wrong == [] + # After the cases, so a red count never hides a wrong slug. + assert len(cases) == 38, f"the set holds {len(cases)} names, serial 147 has 38" diff --git a/tests/test_worldfile.py b/tests/test_worldfile.py index 90fc0f7..c15560d 100644 --- a/tests/test_worldfile.py +++ b/tests/test_worldfile.py @@ -130,8 +130,9 @@ 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) == 109, f"the set holds {run} fixtures" # serial 146: OW-23, OW-24 and name_case assert diffs == [] + # After the verdicts, so a red count never hides a disagreeing fixture. + assert run == len(on_disk) == 111, f"the set holds {run} fixtures" # serial 147: two OW-18 fold cases # Serial 58's three cases (ruled 2026-10-24), named on their own: the deflate stream read to its From 24c9a026a82da197a523ec124f0ef4b9e598ae36 Mon Sep 17 00:00:00 2001 From: Titus Date: Wed, 25 Nov 2026 14:03:10 +0100 Subject: [PATCH 2/2] The LegendKeeper test's fixture count moves to serial 147's 91, after its cases A count pin before the case check stopped the test before any case ran; it now sits after, so a red count never hides a case. Co-Authored-By: Claude Opus 5.5 --- tests/test_legendkeeper_calendars.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_legendkeeper_calendars.py b/tests/test_legendkeeper_calendars.py index 5af513b..15dc50b 100644 --- a/tests/test_legendkeeper_calendars.py +++ b/tests/test_legendkeeper_calendars.py @@ -68,14 +68,15 @@ 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 (79 cases, 36 calendars and 43 refusals): the package's + """The calendar fixture beside the profile (91 cases at serial 147, 48 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) == 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 == [] + # After the cases, so a red count never hides a case. + assert len(cases) == 91 and sum(not c["valid"] for c in cases) == 43 def test_the_reader_refuses_what_the_profile_refuses() -> None: