diff --git a/CHANGELOG.md b/CHANGELOG.md index cd963a4..59833e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ The package version runs on its own semver; the schema it is generated from is ` ## Unreleased +## 0.135.0 (2026-11-19) + +- **The schema pin moves to `v0.34.1-dist.136`** (serials 135 and 136; canonical 00.34.01 unchanged, no schema file moved, `_schema.py` changes only its provenance lines). Serial 135 adds a talk on an Object or a Construct to the room and report pages, the design state to the charter page (and that a Charter the hidden mark keeps from a reader is not that reader's), and three new fixture lists; serial 136 adds the packet page's `standing` state, `x_packet_from` and its first fixture, which no reader in this package reads yet. +- **`talks_of(element)`**: the talks on an Object or a Construct that a line in the room (`narrative` + `Message`, with the mark) is in, each `{type, id}` from its `objects` and `constructs`, the id as written; `[]` for anything that is no line. +- **`report_talks_of(narrative)`**: the talks a reader shows a report with, every Object and Construct its `objects` and `constructs` name, read as `talks_of` reads a line's; `[]` for a Narrative that is no report. +- **`design_parts_of(world, reader)`**: the design parts a reader reads, each `{type, id, state}`, an Object or a Construct served whole whose `subtype`, trimmed and folded, is `in design` or `locked`, only when `charter_of` finds a Charter for that reader; `[]` otherwise. +- Tests: the room fixture's 13 talk cases, the report fixture's 6 and the charter fixture's 13 design cases, each its own test, and the package's own cases beside them. - Tests: CI runs the whole suite against the built wheel, installed in place of the source tree (on Python 3.12), and checks that the wheel holds every tracked file of the package and nothing else. A wheel built without the vendored folder checker failed both, where the source run passes. The release runs the suite against the wheel it uploads, too, before publishing. - Tests: every Python example in the README is type-checked with `mypy --strict` against the installed package, each block on its own, so a renamed function, a keyword or an export the package no longer has fails before the README ships. - README: the folder example now checks that `folder.world` is present before reading its name (`None` when `world.json` is missing or unreadable), so it type-checks under `mypy --strict`. diff --git a/README.md b/README.md index 5c1d8ca..ace8c19 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,8 @@ A lore view (a list, a count, search, a graph, a story's context, a survey) leav `charter_of(world, reader)` reads the three aids as one reader sees them, the packet a front door shows first: `{charter, guide, domains}`. `charter` is the newest marked Charter (`{id, name, rules, skill}`: its `x_checks_rules` as stored, and the Objects its text names, by any `ow://` form, a site address or a bare id, that the reader sees, at most five), `guide` the newest marked Guide (`{id, name}`), and `domains` every marked Domain the reader sees (`{id, name, sentence, hubs}`), in the Guide's order first, then by name. `domains_of(world, reader)` is the list alone. The world and the reader are the lens reader's (below); a world open to anyone carries `open: True`, and a public reader of any other world reads nothing. The API serves the same packet as `reading_aids` on `GET /me`. The profile: [`profiles/charter.md`](https://github.com/OnlyWorlds/schema-dist/blob/main/profiles/charter.md). +`design_parts_of(world, reader)` lists the design parts that reader reads, each `{type, id, state}`: when `charter_of` finds a Charter for the reader, every Object or Construct served whole (never a known-of stub) whose `subtype`, trimmed and folded, is `in design` or `locked`. With no Charter for that reader it answers `[]`, and `locked` is an ordinary subtype. `talks_of(element)` reads the talks a line in the room is in: each id in its `objects` as `{"type": "object", "id": ...}` and each in its `constructs` as `{"type": "construct", ...}`, read as written; anything that is no line answers `[]`. `report_talks_of(narrative)` reads a report's `objects` and `constructs` the same way: the talks a reader shows the report with. + ### Lenses A lens is a saved way of reading a world: a Construct with supertype `Lens` (`is_lens(el)`) whose links are its anchors and whose `x_lens` is the recipe (`depth`, `types`, `window` or `from` and `to`, `undated`, `changed_within`, `show`, `budget`, `mail`, `notes`). `resolve_lens(world, lens, reader, as_of=None, clock=None)` resolves it for one reader over a world snapshot, the same answer as the npm SDK's `resolveLens`: the kept ids and their rows in the profile's order, the cut counted by reason, and the mail part when the lens names a mail rule. A template (`is_template(el)`, subtype `Template`) resolves to nothing; `lenses_in_use(membership, character.get("x_lens_uses"))` gives the lenses a seat reads (the membership's choice wins). diff --git a/codegen/schema-dist/MANIFEST.json b/codegen/schema-dist/MANIFEST.json index 4f257c1..ac79cb7 100644 --- a/codegen/schema-dist/MANIFEST.json +++ b/codegen/schema-dist/MANIFEST.json @@ -146,8 +146,8 @@ "profiles/address.md": "2fd4fe31e90d51818ba48e52e64ffcbdfa0a6a9e1404d7cca85646c52b2b5fd9", "profiles/calendar.fixture.json": "0a013c3732eda70a42c4eab30555669af28983a5ba9f4a233addf0f06bedb4cd", "profiles/calendar.md": "c81c63a46eb886cb9aeedf3a668f117ffc626ff711ee2b23a2a8a402b81c7c82", - "profiles/charter.fixture.json": "ba80d4e276ed81a7c185dcd66c3d6ea7af9c9e49fb947bacde2d52136acb2cd5", - "profiles/charter.md": "f61a4958602bd9f8f466c0660e8ae1aff5e6fc6da397c5c493d971a8bfe286ca", + "profiles/charter.fixture.json": "972eda71e3538310df7ccd4166a2e7f2807eb55b6f512a03ced28c9220ea668a", + "profiles/charter.md": "0c4c87172bb6dc94ff3cc41751616580c9082460e5ffc750c661536e2f5a6913", "profiles/checks.fixture.json": "43586fddd94ebe9678bf46e6d744768a094f856b668c5917fe9e0dda46599251", "profiles/checks.md": "6778b7e6b9cebc447486e5679ef6036dbf2f8c875c70a2f0f55660fc2c885ce9", "profiles/identity.md": "bb631fe3cae3cc7b57f1c866ebac496bb426ad0cb661ff5fdec928cccffe1616", @@ -166,15 +166,16 @@ "profiles/message.md": "768e09ef6370deb2af331da8d665128746553498da2cb6e065bbdcaa326d6d2c", "profiles/names.fixture.json": "7d012081b5df7bab3e2223333f87a347417c3061c62b38947fc952e8c4d2377a", "profiles/names.md": "401e1c37624d01f43304924374009e5ae89949503a8bc3ff8bc3ddce11ba38cd", - "profiles/packet.md": "c1996f357f5d7562741d1a5d842190cba97cfb27d35de5caba41fea6ccd13c5b", + "profiles/packet.fixture.json": "b9f7799f5278b27caca06505d9c3863874f324d6718f652936b823a34de82b90", + "profiles/packet.md": "1bdf9770a03a28a3fbe93326a4f06150a50aa76cd227ba917bbf50159e0ea5e0", "profiles/record.fixture.json": "a0dc588db339eeb9ae2732a6828af34412235ac8a9aaa27bef566391685f611e", "profiles/record.md": "b2c7a083a64010bab653675cad08c23d8e4402074730a72a87518622dc2cde2f", "profiles/report-lines.fixture.json": "2face7cd693235d806e34d3884164b6934a78a299fb77f5ac283b89374e1b47a", - "profiles/report.fixture.json": "c87c6165829858b58126bc5ccab2391647e8e4971a46deee39dde9b5d1f3593e", - "profiles/report.md": "7650eb4013337bff5d4b51dcf0ddf01e67cfeac97300c92013b17de1c6a66b70", + "profiles/report.fixture.json": "0d83ce1ee76f93c79b786bb10e1e97bfb94c6983a8b3b00d1867e65f03722e94", + "profiles/report.md": "e459ffcd5cdcbb493a61eb29302ae4cfffc7a28a21ad8b2f58984819e8195132", "profiles/review.md": "aae3ad18b6275e146f9146c6fc7d6da04f7d1582b240444edf07ba97e5c8f67b", - "profiles/room.fixture.json": "a1700126b8025d3b5f31c5542c3e6a50e623e915086ef6834fe7905086bc41b3", - "profiles/room.md": "27472fe099e37a0c0c22a66c66bf48b99f42a37b51b22f9102970735579d3b2d", + "profiles/room.fixture.json": "43d84e0012537a9899f67bd1950b7223b0c2b4ff87e57cfab395a232e44a85c7", + "profiles/room.md": "6555063aec83e34fc4f3babf3d0561cd2920b2358735240c53afb57e0e4817a4", "profiles/spine.fixture.json": "84a130adf7eb0d4d981cf71b4f4f5914484fdc332904751259ba01cb45c56267", "profiles/spine.md": "6bd367c3f4b101878fbc54a3c8c806630b7760173f24fef995db801b6103d92e", "profiles/strand.fixture.json": "7bc2d2dae11c0722b1db987c070b249ddcbc55b81683c4bfa26900c7ffe0fc53", @@ -206,7 +207,7 @@ "schema/zone.yaml": "cca04ee498fb813fa18b96f1ac99816e7f1a8ae1fb9e21c48b37620dbb674856", "schema.json": "581dc7b5e890acc06b1c89b0d7bdcc2f20f54f52d5a3b4af8c5a184e1e6fd48c", "SECURITY.md": "939ee364b06f0b749bdd4cbe66b2fe49322c95abe732650ec4ef062a0c03820a", - "VERSION": "d9951b2802d73c34c49e9a75661458239102b3999ab3b95891def07238a00577", + "VERSION": "b92f129c447a35f30782f0f319ca9c17e2f4c1ce849e93b8e234068e48a48b0f", "views.fixture.json": "6fda45c2d36cc82a613a4b4d99d14ba9646db2c5bf912b82e68c6b62b20441c1", "views.json": "f4d06ee16bd6c66fc28cf27146b8d199c85164e5deecabafc23af53408746fe0", "walk/lint_folder.py": "28efffa3a39d7f2ceaf69cae5c4ddce023e4989e7a5d2c26c1b4d4815eff386e", diff --git a/codegen/schema-dist/VERSION b/codegen/schema-dist/VERSION index 2fb5222..7fb1473 100644 --- a/codegen/schema-dist/VERSION +++ b/codegen/schema-dist/VERSION @@ -1,3 +1,3 @@ canonical: 00.34.01 -serial: 134 -published: 2026-11-17 +serial: 136 +published: 2026-11-19 diff --git a/codegen/schema-dist/profiles/charter.fixture.json b/codegen/schema-dist/profiles/charter.fixture.json index ec04aef..a07204f 100644 --- a/codegen/schema-dist/profiles/charter.fixture.json +++ b/codegen/schema-dist/profiles/charter.fixture.json @@ -4,11 +4,12 @@ "notes": [ "aids: an element is a reading aid when its type and supertype, each trimmed and folded as the room profile defines it, are one of pairs, and it carries mark.field, read by presence: any value but null, a string only when something is left after trimming White_Space, an empty list or an empty object never (serial 126). The pair without the mark is lore; the mark on no pair makes nothing. Wherever a type is compared to a kind (a pair, a hub's kind, a skill's being an Object), it is trimmed and folded as the room profile defines it.", "element: isCharterElement(element), in the room profile's matcher-case shape: element gives type, supertype and the mark as a body might carry them; is_charter_element is what the reader must answer, the pair AND the mark. A mark counts when its value is not null: a string only when something is left after the White_Space trim, an empty list or an empty object as absent, any other value (a number, a list or an object with something in it) as present; the value is never compared.", - "worlds: each world's elements as its owner is served them, the ids its hidden mark keeps from every reader but the owner, and its readers, in the lens fixture's shape. A reader's rung is owner (the whole world), contributor (the world less the hidden), guest (exactly the whole and known_of ids it lists; known_of is a stub: its id, type and name, its description and its dates, no link and no extension field) or public (the world less the hidden and the room elements, and nothing at all unless the world carries open: true, a world open to anyone). A case's world is a name in worlds or, as a graph case's is, a world of its own.", + "worlds: each world's elements as its owner is served them, the ids its hidden mark keeps from every reader but the owner, and its readers, in the lens fixture's shape. A reader's rung is owner (the whole world), contributor (the world less the hidden), guest (exactly the whole and known_of ids it lists; known_of is a stub, served as the lens profile serves one: its id, type, name, description, supertype, subtype and image_url, the server's times and its type's public fields, no link and no extension field) or public (the world less the hidden and the room elements, and nothing at all unless the world carries open: true, a world open to anyone). A case's world is a name in worlds or, as a graph case's is, a world of its own.", "a stub's standing: a stub serves no extension field, so whether an element the reader holds only as a stub is a reading aid is read from the element as the owner is served it; what the reading shows of it is what the stub serves.", - "charter: want is charterOf(world, reader). charter is {id, type, name, rules, skill} or null, type law: the newest marked Charter the reader sees, by created_at compared as instants (none sorts oldest), then the higher id by code point; rules the rules_field list as stored, [] when absent or null; skill the ids its description names (any id written as 8-4-4-4-12 hex, so every ow:// form, a site address and a bare id), in lowercase, each once in the order written, kept when it is an Object of this world the reader sees (served whole to every reader who reads the Charter; a hidden one is not seen and not kept), the first skill_max of those kept. guide is {id, type, name} or null, type construct, chosen the same way among marked Guides. domains is every marked Domain the reader sees, each {id, type, name, sentence, hubs}, type construct: in the order of the Guide's constructs as the reader is served them first (an id named twice keeps its first place, an entry that is no marked Domain is skipped), then the rest by folded name and then id; with no Guide seen, by folded name and id alone.", + "charter: want is charterOf(world, reader). charter is {id, type, name, rules, skill} or null, type law: the newest marked Charter the reader sees, by created_at compared as instants (none sorts oldest), then the higher id by code point; rules the rules_field list as stored, [] when absent or null; skill the ids its description names (any id written as 8-4-4-4-12 hex, so every ow:// form, a site address and a bare id), in lowercase, each once in the order written, kept when it is an Object of this world the reader sees (served whole to every reader who reads the Charter; one the hidden mark keeps from the reader is not seen and not kept), the first skill_max of those kept. guide is {id, type, name} or null, type construct, chosen the same way among marked Guides. domains is every marked Domain the reader sees, each {id, type, name, sentence, hubs}, type construct: in the order of the Guide's constructs as the reader is served them first (an id named twice keeps its first place, an entry that is no marked Domain is skipped), then the rest by folded name and then id; with no Guide seen, by folded name and id alone.", "sentence: the description as served, trimmed of White_Space at both ends, cut at its first line break (a line feed or a carriage return) and trimmed again, so its first line that holds something; an empty string when there is none. hubs: the distinct {type, id} the Domain's served link fields name, each an element of its field's kind in the reader's view (any other id names no hub), in hub_fields' order (the Construct's link fields, the schema's order) and each list's own order, the Domain itself excluded; a stub serves no links, so a stub Domain's hubs are [].", - "compare: objects are compared as values; the order of keys carries no meaning, so a reader that writes {type, id} or {id, type, name} in another order answers the same." + "compare: objects are compared as values; the order of keys carries no meaning, so a reader that writes {type, id} or {id, type, name} in another order answers the same.", + "design_cases: each case is a world of its own, a reader and want, every design part the reader sees: an Object or a Construct the reader is served whole (a known-of stub has none, though it is served its subtype) whose subtype, trimmed and folded as the room profile defines it, is in design or locked, in a world where charterOf finds a Charter for that reader; each {type, id, state}, type object or construct and state the page's word (in design or locked), whatever the spelling stored. want compares as a set." ], "pairs": [ { @@ -3037,5 +3038,529 @@ }, "note": "The answer is the room profile's (its trim, the White_Space set, and its fold, simple case folding by the C and S rows), never a language's own. Domains: an ideographic space each side of construct is trimmed (a Domain); con + U+FB06 + ruct is not construct, since the ligature has no simple folding (no Domain; a full fold would make one); CON + U+017F + TRUCT folds to construct, the long s to s (a Domain; lower-casing leaves it). Hubs: U+FEFF before Location is no White_Space, so the type is not location (no hub; a trim that takes a byte order mark would make one); location + U+001F likewise (no hub; a trim that takes the unit separator would make one); an em space, U+2003, before LOCATION is trimmed and the word folds (a hub). Birch Row is no Domain, so the order is Alder Quay, Cinder Point." } + ], + "design_cases": [ + { + "name": "a-locked-object-in-a-world-with-a-charter-is-a-design-part", + "note": "The world's Charter carries the mark: the Object's subtype locked is its design state.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f150", + "name": "Design 1", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000600", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f150" + }, + { + "id": "019a7f00-0000-7000-8000-000000000601", + "type": "object", + "name": "Control panel", + "subtype": "locked", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [ + { + "type": "object", + "id": "019a7f00-0000-7000-8000-000000000601", + "state": "locked" + } + ] + }, + { + "name": "a-construct-in-design-is-a-design-part", + "note": "A Construct carries the state as an Object does; no list of kinds decides it.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f151", + "name": "Design 2", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000610", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f151" + }, + { + "id": "019a7f00-0000-7000-8000-000000000611", + "type": "construct", + "name": "Sign-in flow", + "subtype": "in design", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [ + { + "type": "construct", + "id": "019a7f00-0000-7000-8000-000000000611", + "state": "in design" + } + ] + }, + { + "name": "a-subtype-with-a-capital-and-a-trailing-space-is-in-design", + "note": "The subtype is trimmed and folded as the room profile defines it; the state is the page's word, never the spelling stored.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f152", + "name": "Design 3", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000620", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f152" + }, + { + "id": "019a7f00-0000-7000-8000-000000000621", + "type": "object", + "name": "Settings screen", + "subtype": "In Design ", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [ + { + "type": "object", + "id": "019a7f00-0000-7000-8000-000000000621", + "state": "in design" + } + ] + }, + { + "name": "a-deprecated-construct-is-no-design-part", + "note": "A world's own further subtype is an ordinary subtype: no design state.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f153", + "name": "Design 4", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000630", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f153" + }, + { + "id": "019a7f00-0000-7000-8000-000000000631", + "type": "construct", + "name": "Old export rule", + "subtype": "deprecated", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [] + }, + { + "name": "a-law-with-a-subtype-is-no-design-part", + "note": "Only an Object or a Construct has a design state.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f154", + "name": "Design 5", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000640", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f154" + }, + { + "id": "019a7f00-0000-7000-8000-000000000641", + "type": "law", + "name": "Naming rule", + "subtype": "accepted", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [] + }, + { + "name": "a-locked-object-in-a-world-whose-charter-has-no-mark-is-no-design-part", + "note": "The world's only Law with supertype Charter has no mark, so charterOf finds no Charter and no element has a design state: locked is a word any world may use.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f155", + "name": "Design 6", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000650", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop." + }, + { + "id": "019a7f00-0000-7000-8000-000000000651", + "type": "object", + "name": "Control panel", + "subtype": "locked", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [] + }, + { + "name": "a-workshops-spec-in-design-is-a-design-part", + "note": "The Construct is a room element (the room profile's pair construct + Spec, and the room's mark, which holds its sitting's id as a workshop's element does; the sitting's own mark holds the world's id): no kind is excluded, so its subtype in design is its design state in a world with a Charter.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f156", + "name": "Design 7", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000660", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f156" + }, + { + "id": "019a7f00-0000-7000-8000-000000000662", + "type": "event", + "name": "Settings workshop", + "supertype": "Sitting", + "created_at": "2026-11-02T11:00:00Z", + "x_room_of": "019a7f00-0000-7000-8000-00000000f156" + }, + { + "id": "019a7f00-0000-7000-8000-000000000661", + "type": "construct", + "name": "Settings screen", + "supertype": "Spec", + "subtype": "in design", + "created_at": "2026-11-02T12:00:00Z", + "x_room_of": "019a7f00-0000-7000-8000-000000000662" + } + ] + }, + "reader": "owner", + "want": [ + { + "type": "construct", + "id": "019a7f00-0000-7000-8000-000000000661", + "state": "in design" + } + ] + }, + { + "name": "a-locked-law-is-no-design-part", + "note": "Only an Object or a Construct has a design state: a Law whose subtype is locked, in a world with a Charter, is no design part.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f157", + "name": "Design 8", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000670", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f157" + }, + { + "id": "019a7f00-0000-7000-8000-000000000671", + "type": "law", + "name": "Naming rule", + "subtype": "locked", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [] + }, + { + "name": "a-locked-object-with-a-unit-separator-after-it-has-no-design-state", + "note": "The subtype is locked followed by U+001F, the unit separator, which has no White_Space property: the room profile's trim leaves it, so the trimmed subtype is no design state (a language's own trim may take it).", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f158", + "name": "Design 9", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000680", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f158" + }, + { + "id": "019a7f00-0000-7000-8000-000000000681", + "type": "object", + "name": "Control panel", + "subtype": "locked\u001f", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [] + }, + { + "name": "a-locked-object-a-guest-holds-only-as-a-stub-has-no-design-state", + "note": "The guest reads the marked Charter whole and holds the Object only as a known-of stub, which is served its subtype locked (the lens profile): the state is read only from an element served whole, so the stub has none.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f159", + "name": "Design 10", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + }, + "guest": { + "rung": "guest", + "character": null, + "whole": [ + "019a7f00-0000-7000-8000-000000000690" + ], + "known_of": [ + "019a7f00-0000-7000-8000-000000000691" + ] + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-000000000690", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f159" + }, + { + "id": "019a7f00-0000-7000-8000-000000000691", + "type": "object", + "name": "Control panel", + "subtype": "locked", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "guest", + "want": [] + }, + { + "name": "a-hidden-charter-gives-its-owner-a-design-part", + "note": "The world's marked Charter carries the hidden mark. Its owner sees it, so the locked Object is a design part for the owner. The next case is the same world read by a contributor.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f15a", + "name": "Design 11", + "hidden": [ + "019a7f00-0000-7000-8000-0000000006a0" + ], + "readers": { + "owner": { + "rung": "owner", + "character": null + }, + "contributor": { + "rung": "contributor", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-0000000006a0", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f15a" + }, + { + "id": "019a7f00-0000-7000-8000-0000000006a1", + "type": "object", + "name": "Control panel", + "subtype": "locked", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [ + { + "type": "object", + "id": "019a7f00-0000-7000-8000-0000000006a1", + "state": "locked" + } + ] + }, + { + "name": "a-hidden-charter-gives-a-contributor-no-design-part", + "note": "The same world as the case before, read by a contributor: the hidden mark keeps the Charter from it, and it wins over rule 5, so charterOf finds no Charter for this reader and the locked Object, which it reads whole, has no design state.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f15a", + "name": "Design 11", + "hidden": [ + "019a7f00-0000-7000-8000-0000000006a0" + ], + "readers": { + "owner": { + "rung": "owner", + "character": null + }, + "contributor": { + "rung": "contributor", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-0000000006a0", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f15a" + }, + { + "id": "019a7f00-0000-7000-8000-0000000006a1", + "type": "object", + "name": "Control panel", + "subtype": "locked", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "contributor", + "want": [] + }, + { + "name": "a-part-whose-type-is-stored-with-spaces-and-a-capital-is-written-object", + "note": "The Object's type is stored as \" Object \": trimmed and folded it is an Object, and its type in the answer is object, the kind's own word, as the packet writes a type.", + "world": { + "id": "019a7f00-0000-7000-8000-00000000f15b", + "name": "Design 12", + "hidden": [], + "readers": { + "owner": { + "rung": "owner", + "character": null + } + }, + "elements": [ + { + "id": "019a7f00-0000-7000-8000-0000000006b0", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "description": "The rules of the workshop.", + "x_charter_of": "019a7f00-0000-7000-8000-00000000f15b" + }, + { + "id": "019a7f00-0000-7000-8000-0000000006b1", + "type": " Object ", + "name": "Control panel", + "subtype": "locked", + "created_at": "2026-11-02T12:00:00Z" + } + ] + }, + "reader": "owner", + "want": [ + { + "type": "object", + "id": "019a7f00-0000-7000-8000-0000000006b1", + "state": "locked" + } + ] + } ] } diff --git a/codegen/schema-dist/profiles/charter.md b/codegen/schema-dist/profiles/charter.md index dd4daaa..33412aa 100644 --- a/codegen/schema-dist/profiles/charter.md +++ b/codegen/schema-dist/profiles/charter.md @@ -12,19 +12,21 @@ **Which one, when there are several.** The Charter is the newest marked Charter Law, newest by `created_at` and then by the higher id, so editing it never changes which one leads (D152's rule, with the mark in place of the maker test); the Guide the same among marked Guides. A proposed element (one whose `x_review_proposed` counts as present by the review profile's rule 1, a mark or a doubt; absent, null and an empty value, `""`, White_Space alone, `[]` or `{}`, are no proposal, so an element with an empty mark is settled) is in no reader's view, the owner's included, as the lens profile's rule 1 has it: a proposed Charter, Guide or Domain is no reader's aid until a keeper settles it, so the newest settled one leads, and a proposed Object is kept neither in `skill` nor in a Domain's `hubs`. The ties, named once: an element with no `created_at` (a folder element may carry none) sorts as the oldest; a `created_at` is read as the message profile reads one (the one form, as an instant, a time with no offset as UTC), and one that cannot be read is read as absent; the higher id by code point, as the folder's tie-break; a name by the room profile's fold. The Domains are every marked Domain Construct the reader sees, in the Guide's `constructs` order first (a Domain named twice keeps its first place; an entry that is not a marked Domain, or one the reader cannot see, is skipped), then the rest by folded name and id; when the reader sees no Guide, the order is by folded name and id alone. An older Charter or Guide is superseded, not deleted; a tool offers to retire it. Retiring is the keeper's one write that sets its `x_charter_of` to null: the element stays in the world as lore, and no flag of its own marks it retired. A folder's `world.json` may carry `charter` (folder spec §4.6 (a)) as a shortcut and tie-break: it picks among marked Charters only and never stands in for the mark. +**The design state.** In a world where `charterOf` finds a Charter for the reader (the selection above: a marked Charter Law, settled), the design state of an Object or a Construct is its `subtype` when that subtype, trimmed and compared without regard to case as the room profile defines it, is `in design` or `locked`; the state is that word, whatever spelling the subtype is stored in (`In Design ` is `in design`). The state is read only from an Object or a Construct the reader is served whole: a known-of stub has none, though it is served its `subtype` (the lens profile). An Object or a Construct with a design state is a design part. The state alone makes it one, whatever the element's supertype: no list of kinds, in the Charter or anywhere else, decides it. No other subtype is a design state and no other type has one: a world may keep further subtypes of its own (`deprecated` on a Construct, a ladder of states on its Laws), which this page reads as ordinary subtypes, so a reader that reads the two words on the two types reads every design state there is. The Charter alone opens the gate, whatever kind of world keeps it: a world that keeps a marked Charter has design states, a story's world included, so there an Object whose subtype is `locked` (a locked chest) is a design part. In a world where `charterOf` finds no Charter for the reader (none, only a Law with supertype Charter and no mark, or only a proposed one), no element has a design state, whatever its subtype: there `locked` is an ordinary subtype, a word any world may use. The gate is read for each reader, as `charterOf` is: a reader for whom it finds no Charter reads no design state, even where another reader of the same world, for whom it finds one, reads design parts. A design state takes an element out of no view. The page orders no parts: a tool may show an Object that is a part under its `parent_object`; a Construct has no parent link, so by this page nothing is under a Construct. + **The rule for readers.** 1. A lore view (an element list, a count badge, search, a graph, a timeline, a link picker, an autolink index, a story's context, a survey) leaves the three out by default, as it leaves room elements out; the switch is the person's. Counts beside a lore view count what the view shows. -2. Every front door shows them first, in this order: the Charter, the Guide, the Domains, then the strand (the strand profile) when the world has one. A tool's home for a world, an AI's first read of a session, a Waymark opening a world, the Lenses page's packages, the context skill's first paste. What is absent draws nothing: no placeholder, no "add a Guide" prompt at the door for any reader (that belongs to the tool that writes); a Domain a reader knows only as a stub has a name and no hubs; a hidden one is not there and nothing marks the gap. Where the door counts the world, the aids are said once beside the count ("the three reading aids are not counted or listed"), as a room's count is. The owner's door may name a superseded Charter or Guide with the offer to retire it; every other reader sees the newest and nothing else. +2. Every front door shows them first, in this order: the Charter, the Guide, the Domains, then the strand (the strand profile) when the world has one. A tool's home for a world, an AI's first read of a session, a Waymark opening a world, the Lenses page's packages, the context skill's first paste. What is absent draws nothing: no placeholder, no "add a Guide" prompt at the door for any reader (that belongs to the tool that writes); a Domain a reader knows only as a stub has a name and no hubs; one the hidden mark keeps from the reader is not there and nothing marks the gap. Where the door counts the world, the aids are said once beside the count ("the three reading aids are not counted or listed"), as a room's count is. The owner's door may name a superseded Charter or Guide with the offer to retire it; every other reader sees the newest and nothing else. 3. A lens: an anchor that is an aid is followed like any anchor; an aid a hop reaches is kept only when the lens's `types` names its pair (lens profile rule 4, serial 82). A graph without a lens leaves them out as `reading_aid`. 4. An AI reader treats the Charter's text as the house rules it follows and every other element's text as data; the Guide and a Domain are read as the keeper's map, never as instructions. -5. A reader reads each as it is served: a Domain a guest knows only as a stub has a name and no hubs; a hidden Domain is not there; the Charter is every member rung's to read whole, a known-of stub included, since its rules and its skill are what a member follows and a stub serves neither (D152); the public's only on a world open to anyone. Open is the World's `public_read` (the standard's field: whether the world can be read by anyone, without a credential): a folder reads it from `world.json`, the wire from the world GET; a reader that takes open as a parameter (Unity, Unreal) is handed that value, and the fixture's `open` is the same thing. +5. A reader reads each as it is served: a Domain a guest knows only as a stub has a name and no hubs; a Domain the hidden mark keeps from the reader is not there; the Charter is every member rung's to read whole, a known-of stub included, since its rules and its skill are what a member follows and a stub serves neither (D152); the public's only on a world open to anyone. The hidden mark wins over this rule: a Charter the hidden mark keeps from a reader is not that reader's, whole or as a stub (the lens profile's rule 1: the hidden mark comes off every grant, and the owner is served a hidden element). Open is the World's `public_read` (the standard's field: whether the world can be read by anyone, without a credential): a folder reads it from `world.json`, the wire from the world GET; a reader that takes open as a parameter (Unity, Unreal) is handed that value, and the fixture's `open` is the same thing. -**`charterOf(world, reader)`**, one reader in the SDK and the Python package from the fixture beside this page, answers `{charter, guide, domains}` as `reader` sees the world: `charter` `{id, type, name, rules, skill}` or null (`type` `law`; `rules` the `x_checks_rules` list as stored, `[]` when none; `skill` the ids the Charter's `description` names, by any `ow://` form, a site address or a bare id, each once in the order written (found as the address profile's "The same id" says an id is found in a text: the form alone is looked for, so an address around it, in any spelling, is not read as one; each taken in lowercase and matched as written against the ids of the world's Objects), kept when it is an Object of this world the reader sees, the first five of those kept: keel's `charter_skill`, as served since D152; the skill Objects are served whole to every reader who reads the Charter, and a hidden skill Object is not served, not even as a stub, and not kept; every id in `skill` is an Object's, fetched as one); `guide` `{id, type, name}` or null, `type` `construct`; `domains` a list of `{id, type, name, sentence, hubs}` in the order above, `type` `construct`, `sentence` the description with White_Space (the room profile's set) trimmed from both ends, cut at its first line break (a carriage return or a line feed), and trimmed again: its first line that holds something, trimmed, or an empty string when the description holds nothing, `hubs` the distinct `{type, id}` its link fields name, itself excluded, that the reader sees, in the schema's field order: a hub is an element of the kind its link field links to, in the reader's view, and its `type` is that kind; an id in a link field that names no element of that kind in the reader's view names no hub. Each `type` is a type's name as the API's routes and a folder's directories write it, singular and lowercase; on the Charter, the Guide and a Domain it is the pair's own word in the table above, whatever spelling the element's type is stored in. The packet is handed to a reader that may hold nothing else of the world, and an id is fetched by its type. **`domainsOf(world, reader)`** is the list alone. **`isCharterElement(element)`** is the pair-and-mark test. **`readingAidOf(element)`** (Python `reading_aid_of`) answers `'charter'`, `'guide'`, `'domain'` or null from the type and supertype alone, trimmed and folded as the pairs above, the whole word, the mark ignored: an unmarked Law with supertype Charter answers `'charter'`, which is what a tool offering to mark one needs; whether an element is a reading aid stays `isCharterElement`'s question. Keel serves the same packet to a key as `reading_aids` beside `front_door` on `GET /me` and the join reply (`front_door.charter` and `charter_skill` stay as served; a removal is a dated notice), and at the world's door on the site. +**`charterOf(world, reader)`**, one reader in the SDK and the Python package from the fixture beside this page, answers `{charter, guide, domains}` as `reader` sees the world: `charter` `{id, type, name, rules, skill}` or null (`type` `law`; `rules` the `x_checks_rules` list as stored, `[]` when none; `skill` the ids the Charter's `description` names, by any `ow://` form, a site address or a bare id, each once in the order written (found as the address profile's "The same id" says an id is found in a text: the form alone is looked for, so an address around it, in any spelling, is not read as one; each taken in lowercase and matched as written against the ids of the world's Objects), kept when it is an Object of this world the reader sees, the first five of those kept: keel's `charter_skill`, as served since D152; the skill Objects are served whole to every reader who reads the Charter, and a skill Object the hidden mark keeps from the reader is not served, not even as a stub, and not kept; every id in `skill` is an Object's, fetched as one); `guide` `{id, type, name}` or null, `type` `construct`; `domains` a list of `{id, type, name, sentence, hubs}` in the order above, `type` `construct`, `sentence` the description with White_Space (the room profile's set) trimmed from both ends, cut at its first line break (a carriage return or a line feed), and trimmed again: its first line that holds something, trimmed, or an empty string when the description holds nothing, `hubs` the distinct `{type, id}` its link fields name, itself excluded, that the reader sees, in the schema's field order: a hub is an element of the kind its link field links to, in the reader's view, and its `type` is that kind; an id in a link field that names no element of that kind in the reader's view names no hub. Each `type` is a type's name as the API's routes and a folder's directories write it, singular and lowercase; on the Charter, the Guide and a Domain it is the pair's own word in the table above, whatever spelling the element's type is stored in. The packet is handed to a reader that may hold nothing else of the world, and an id is fetched by its type. **`domainsOf(world, reader)`** is the list alone. **`isCharterElement(element)`** is the pair-and-mark test. **`readingAidOf(element)`** (Python `reading_aid_of`) answers `'charter'`, `'guide'`, `'domain'` or null from the type and supertype alone, trimmed and folded as the pairs above, the whole word, the mark ignored: an unmarked Law with supertype Charter answers `'charter'`, which is what a tool offering to mark one needs; whether an element is a reading aid stays `isCharterElement`'s question. Keel serves the same packet to a key as `reading_aids` beside `front_door` on `GET /me` and the join reply (`front_door.charter` and `charter_skill` stay as served; a removal is a dated notice), and at the world's door on the site. **What a writer must do.** A keeper (the owner or a co-builder) writes the pair and the mark together, the mark the id of the world the element is in, byte for byte like every extension field. The server refuses `x_charter_of` set or changed by any other key, by name, before anything is written (a guest's own Law must never become what every AI reads first). A tool never writes the mark on lore on its own; it may offer a keeper "Mark this as the world's Charter" (or Guide, or a Domain) on a Law or Construct the keeper names, one write that sets the pair and the mark together, which is how a world that never met a server (a folder, a browser world) keeps its door. A tool that offers supertype suggestions may still offer these words, since the mark, not the word, makes the aid. One Charter and one Guide at a time: a tool that makes a new one offers to retire the old. A Domain's hubs are its links and its sentence its description; a tool that proposes Domains (from a world's own link counts) writes them as proposed (the review profile) or not at all, never silently. **Health, measured, never promised.** How many of the world's elements the Domains reach in one hop; a Domain or Guide entry that names a hidden or deleted element (a leak bound: the page warns at save, the doctor flags on its cadence, two checks that each fail alone); a hub carrying more links than any Domain names; two marked Charters. The doctor reports these; nothing here prevents them. -**Where the list is read from.** The SDK and the Python package export the three pairs, `isCharterElement`, `readingAidOf`, `charterOf` and `domainsOf`; a tool with its own charter lookup (Atlas's `findCharter`, the doctor's Charter rule, keel's front door) replaces it with this selection the release after the packages carry it. The conformance fixture beside this page, `charter.fixture.json`, holds the cases every reader must agree on. +**Where the list is read from.** The SDK and the Python package export the three pairs, `isCharterElement`, `readingAidOf`, `charterOf` and `domainsOf`; a tool with its own charter lookup (Atlas's `findCharter`, the doctor's Charter rule, keel's front door) replaces it with this selection the release after the packages carry it. The conformance fixture beside this page, `charter.fixture.json`, holds the cases every reader must agree on; its second list, `design_cases`, holds, of a world and one reader, the design parts that reader reads, each `{type, id, state}`, its `type` a type's name as the packet writes one (`object` or `construct`, whatever spelling the element's type is stored in), compared as a set. -**Ruled**: Skeld, 2026-10-28, serial 83 (the reading aids by pair and mark were ruled in the lens and room profiles on serial 82; this page gathers them and adds the selection, the packet and the writer's rule); Skeld, 2026-10-28, serial 85: what retiring writes, and `readingAidOf`. Skeld, 2026-10-30, serial 94: three readings found by porting the reader, ruled and cased: a proposed aid, skill Object or hub is in no reader's view, the owner's included; a member reads the Charter whole from a stub; a skill id compares as a UUID, whatever its case. Serial 100 (2026-10-31): the order names the strand fourth; keel's reading_aids packet carries it as strand, the strand profile's reading. Serial 107 (2026-11-03): open is the World's `public_read`, named where an engine port could not settle it from the page; no fixture change. 2026-11-13, serial 122: a skill id found in the Charter's `description` is taken in lowercase and matched as written against the world's Objects, wherever it stands in the text, and a `created_at` is read as the message profile reads one, one that cannot be read sorting as the oldest; seven more cases in the fixture. 2026-11-14, serial 126: an `x_charter_of` that is an empty list or an empty object is no mark, as the review profile reads an empty mark, so an aid reads the same in its full and its compact form; three more cases in the fixture, two packets whose newer Law carries an empty mark and `false` as a mark. 2026-11-16, serial 133: the Charter, the Guide and each Domain in the packet carry `type` beside `id`, the pair's own word (`law`, `construct`, `construct`) whatever spelling the element's type is stored in, since a reader handed the packet alone fetches an id by its type; a hub is an element of the kind its link field links to, in the reader's view, so an id of another kind, or of no element, in a link field names no hub; wherever the page compares an element's type to a kind (a pair, a hub's kind, a skill's being an Object), the type is trimmed and compared without regard to case, as the room profile defines it; rule 2's stub Domain has a name and no hubs, as rule 5 has it; the Charter, the Guide, each Domain and each hub carry the key (`skill` stays a list of Object ids), and six more cases in the fixture: a Domain whose `characters` names a Location and an id of no element, a Charter whose type is stored as ` Law `, a Domain whose type is stored as `CONSTRUCT`, a hub Location whose type is stored as ` Location `, a skill Object whose type is stored as `Object`, and one world whose Domains and hubs are typed so that only the room profile's own trim and fold reads them right. +**Ruled**: Skeld, 2026-10-28, serial 83 (the reading aids by pair and mark were ruled in the lens and room profiles on serial 82; this page gathers them and adds the selection, the packet and the writer's rule); Skeld, 2026-10-28, serial 85: what retiring writes, and `readingAidOf`. Skeld, 2026-10-30, serial 94: three readings found by porting the reader, ruled and cased: a proposed aid, skill Object or hub is in no reader's view, the owner's included; a member reads the Charter whole from a stub; a skill id compares as a UUID, whatever its case. Serial 100 (2026-10-31): the order names the strand fourth; keel's reading_aids packet carries it as strand, the strand profile's reading. Serial 107 (2026-11-03): open is the World's `public_read`, named where an engine port could not settle it from the page; no fixture change. 2026-11-13, serial 122: a skill id found in the Charter's `description` is taken in lowercase and matched as written against the world's Objects, wherever it stands in the text, and a `created_at` is read as the message profile reads one, one that cannot be read sorting as the oldest; seven more cases in the fixture. 2026-11-14, serial 126: an `x_charter_of` that is an empty list or an empty object is no mark, as the review profile reads an empty mark, so an aid reads the same in its full and its compact form; three more cases in the fixture, two packets whose newer Law carries an empty mark and `false` as a mark. 2026-11-16, serial 133: the Charter, the Guide and each Domain in the packet carry `type` beside `id`, the pair's own word (`law`, `construct`, `construct`) whatever spelling the element's type is stored in, since a reader handed the packet alone fetches an id by its type; a hub is an element of the kind its link field links to, in the reader's view, so an id of another kind, or of no element, in a link field names no hub; wherever the page compares an element's type to a kind (a pair, a hub's kind, a skill's being an Object), the type is trimmed and compared without regard to case, as the room profile defines it; rule 2's stub Domain has a name and no hubs, as rule 5 has it; the Charter, the Guide, each Domain and each hub carry the key (`skill` stays a list of Object ids), and six more cases in the fixture: a Domain whose `characters` names a Location and an id of no element, a Charter whose type is stored as ` Law `, a Domain whose type is stored as `CONSTRUCT`, a hub Location whose type is stored as ` Location `, a skill Object whose type is stored as `Object`, and one world whose Domains and hubs are typed so that only the room profile's own trim and fold reads them right. 2026-11-18, serial 135: the design state of an Object or a Construct is its `subtype` when that is `in design` or `locked`, trimmed and folded as the room profile defines it, read only from an element the reader is served whole (a known-of stub has none, though it is served its subtype), and only in a world where `charterOf` finds a Charter for the reader, so a story's world that keeps a marked Charter has design states, and a reader for whom `charterOf` finds no Charter reads none where another reader of the same world does; rule 5's Charter for every member rung yields to the hidden mark, so a Charter the hidden mark keeps from a reader is not that reader's; carrying it makes the element a design part, whatever its supertype, and no other subtype or type has one; nothing is under a Construct by this page; a design part's `type` is written as the packet writes a type, whatever spelling the element's type is stored in; thirteen cases in the fixture's new list, `design_cases`: a locked Object, a Construct in design and a workshop's spec in design (a room element: no kind is excluded), a subtype stored as `In Design `, a Construct that is `deprecated`, a Law that is `accepted` and a Law that is `locked`, which are no parts, a locked Object in a world whose only Charter has no mark, and an Object whose subtype is `locked` followed by U+001F, which is no White_Space by the room profile, so it has no design state, a locked Object a guest holds only as a known-of stub, which has none, and one world whose Charter carries the hidden mark, read twice: its owner reads a locked Object as a design part, a contributor reads none, and a locked Object whose type is stored as ` Object `, written `object`; the fixture's note on what a stub holds now names its supertype, subtype, image_url and its type's public fields, as the lens profile serves a stub. diff --git a/codegen/schema-dist/profiles/packet.fixture.json b/codegen/schema-dist/profiles/packet.fixture.json new file mode 100644 index 0000000..50a7c43 --- /dev/null +++ b/codegen/schema-dist/profiles/packet.fixture.json @@ -0,0 +1,1463 @@ +{ + "profile": "packet", + "profile_page": "profiles/packet.md", + "notes": [ + "Each case is the work items as one reader is given them, in the order given, all Relations with supertype Work item in the world below, and a want worked by hand from the page's rules 1, 5, 7 and 8.", + "world: the world the work items sit in: its id, its Characters, and others, the ids of every other element of it the reader holds. A value written as no id in either list names no element the reader holds. x_packet_source names the same world, as a folder (server null), except where an item's elements are the source_world's.", + "source_world: another world, the source of the packets that name its elements, whose elements the reader holds too, having resolved those packets there (rule 2); its Characters are no Characters of the world the items sit in.", + "state_cases want: states, for each item its state, the word `open`, `taken`, `done` or `standing` matched trimmed and without regard to case as the room profile defines it, or null for no state (rule 5); shown, every item (no item is hidden for its state); open_work, for each element any item names in x_packet_elements, the ids of the open work that names it (the items whose state is `open` or `taken`); elements, where present, an item's elements in x_packet_elements' order (rules 1 and 7).", + "asker_cases want: askers, for each item the Character id x_packet_from names or null (rule 8); lints, each {kind, item}, the one kind `asker`, for a key that is not one id (not a string, or a string empty once trimmed of White_Space as the room profile trims) or that is, written exactly so, an id in others or in the source_world (absent, null and a value that names no element the reader holds, in any spelling, are no lint); waiting_on, for each Character of the world, the ids of the open work whose asker is that Character.", + "Order: the page orders no list of work items, so shown, each list in open_work, each list in waiting_on, and lints compare as sets, written here in the order the items are given. Only elements is a list in order, x_packet_elements' order (rule 1). states and askers compare as maps.", + "created_by holds a maker's id, which is no Character of the world. A case's note is prose for the reader of the fixture, never an input." + ], + "world": { + "id": "019a8136-0000-7000-8000-000000000000", + "characters": [ + "019a8136-0000-7000-8000-000000000201", + "019a8136-0000-7000-8000-000000000202", + "019a8136-0000-7000-8000-000000000203", + "019A8136-0000-7000-8000-000000000204" + ], + "others": [ + "019a8136-0000-7000-8000-000000000301", + "019a8136-0000-7000-8000-000000000302", + "019a8136-0000-7000-8000-000000000321", + "019a8136-0000-7000-8000-000000000322", + "019a8136-0000-7000-8000-000000000331", + "019a8136-0000-7000-8000-000000000341" + ] + }, + "source_world": { + "id": "019a8136-0000-7000-8000-000000000500", + "characters": [ + "019a8136-0000-7000-8000-000000000501" + ], + "others": [ + "019a8136-0000-7000-8000-000000000511" + ] + }, + "state_cases": [ + { + "name": "standing-is-not-open-work", + "note": "A standing item is shown as itself and is open work on none of the elements it names.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000101", + "type": "relation", + "supertype": "Work item", + "subtype": "standing", + "name": "The order of work", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + }, + { + "type": "object", + "id": "019a8136-0000-7000-8000-000000000321", + "reason": "No description." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000101": "standing" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000101" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000301": [], + "019a8136-0000-7000-8000-000000000321": [] + } + } + }, + { + "name": "standing-with-a-capital-and-a-trailing-space", + "note": "The state is matched trimmed and without regard to case: `Standing ` is `standing`.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000102", + "type": "relation", + "supertype": "Work item", + "subtype": "Standing ", + "name": "The kept list", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + }, + { + "type": "object", + "id": "019a8136-0000-7000-8000-000000000321", + "reason": "No description." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000102": "standing" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000102" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000301": [], + "019a8136-0000-7000-8000-000000000321": [] + } + } + }, + { + "name": "open-taken-and-done-beside-a-standing-item", + "note": "The three states read as before; the open and the taken item are open work on the element they share, the done and the standing item are not.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000103", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "name": "Name the harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000104", + "type": "relation", + "supertype": "Work item", + "subtype": "taken", + "name": "Map the harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000105", + "type": "relation", + "supertype": "Work item", + "subtype": "done", + "name": "Date the harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000106", + "type": "relation", + "supertype": "Work item", + "subtype": "standing", + "name": "Keep the harbour tidy", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000103": "open", + "019a8136-0000-7000-8000-000000000104": "taken", + "019a8136-0000-7000-8000-000000000105": "done", + "019a8136-0000-7000-8000-000000000106": "standing" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000103", + "019a8136-0000-7000-8000-000000000104", + "019a8136-0000-7000-8000-000000000105", + "019a8136-0000-7000-8000-000000000106" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000301": [ + "019a8136-0000-7000-8000-000000000103", + "019a8136-0000-7000-8000-000000000104" + ] + } + } + }, + { + "name": "a-standing-item-keeps-the-packets-order", + "note": "Five elements, given in no sorted order: the reader shows them in the order of x_packet_elements.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000107", + "type": "relation", + "supertype": "Work item", + "subtype": "standing", + "name": "The order of work", + "x_packet_elements": [ + { + "type": "object", + "id": "019a8136-0000-7000-8000-000000000322", + "reason": "First in the order." + }, + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "Second in the order." + }, + { + "type": "narrative", + "id": "019a8136-0000-7000-8000-000000000341", + "reason": "Third in the order." + }, + { + "type": "construct", + "id": "019a8136-0000-7000-8000-000000000331", + "reason": "Fourth in the order." + }, + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000302", + "reason": "Fifth in the order." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000107": "standing" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000107" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000322": [], + "019a8136-0000-7000-8000-000000000301": [], + "019a8136-0000-7000-8000-000000000341": [], + "019a8136-0000-7000-8000-000000000331": [], + "019a8136-0000-7000-8000-000000000302": [] + }, + "elements": { + "019a8136-0000-7000-8000-000000000107": [ + "019a8136-0000-7000-8000-000000000322", + "019a8136-0000-7000-8000-000000000301", + "019a8136-0000-7000-8000-000000000341", + "019a8136-0000-7000-8000-000000000331", + "019a8136-0000-7000-8000-000000000302" + ] + } + } + }, + { + "name": "elements-are-compared-on-the-items-the-want-names", + "note": "Two items; the want carries elements for the standing one only. A reader shows every item's elements, and only the standing item's are compared, in x_packet_elements' order.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000146", + "type": "relation", + "supertype": "Work item", + "subtype": "standing", + "name": "The order of work", + "x_packet_elements": [ + { + "type": "object", + "id": "019a8136-0000-7000-8000-000000000322", + "reason": "First in the order." + }, + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000302", + "reason": "Second in the order." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000147", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "name": "Name the headland", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000146": "standing", + "019a8136-0000-7000-8000-000000000147": "open" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000146", + "019a8136-0000-7000-8000-000000000147" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000322": [], + "019a8136-0000-7000-8000-000000000302": [], + "019a8136-0000-7000-8000-000000000301": [ + "019a8136-0000-7000-8000-000000000147" + ] + }, + "elements": { + "019a8136-0000-7000-8000-000000000146": [ + "019a8136-0000-7000-8000-000000000322", + "019a8136-0000-7000-8000-000000000302" + ] + } + } + }, + { + "name": "a-subtype-none-of-the-four-is-no-state", + "note": "`blocked` is no state: the item is shown and is no open work; the open item beside it is.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000108", + "type": "relation", + "supertype": "Work item", + "subtype": "blocked", + "name": "Wait on the survey", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000109", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "name": "Name the bay", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000108": null, + "019a8136-0000-7000-8000-000000000109": "open" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000108", + "019a8136-0000-7000-8000-000000000109" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000301": [ + "019a8136-0000-7000-8000-000000000109" + ] + } + } + }, + { + "name": "an-empty-or-absent-subtype-is-no-state", + "note": "No subtype, a null one, an empty string and spaces alone are none of the four: each is shown and none is open work.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000110", + "type": "relation", + "supertype": "Work item", + "name": "No subtype", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000111", + "type": "relation", + "supertype": "Work item", + "subtype": null, + "name": "A null subtype", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000112", + "type": "relation", + "supertype": "Work item", + "subtype": "", + "name": "An empty subtype", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000113", + "type": "relation", + "supertype": "Work item", + "subtype": " ", + "name": "Spaces alone", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000114", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "name": "Name the cape", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000110": null, + "019a8136-0000-7000-8000-000000000111": null, + "019a8136-0000-7000-8000-000000000112": null, + "019a8136-0000-7000-8000-000000000113": null, + "019a8136-0000-7000-8000-000000000114": "open" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000110", + "019a8136-0000-7000-8000-000000000111", + "019a8136-0000-7000-8000-000000000112", + "019a8136-0000-7000-8000-000000000113", + "019a8136-0000-7000-8000-000000000114" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000301": [ + "019a8136-0000-7000-8000-000000000114" + ] + } + } + }, + { + "name": "a-state-followed-by-a-unit-separator", + "note": "U+001F is no White_Space, so the room profile's trim leaves it: `open` followed by it is none of the four, no state. A language's trim that strips control characters reads `open`.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000115", + "type": "relation", + "supertype": "Work item", + "subtype": "open\u001f", + "name": "Name the reef", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000116", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "name": "Name the point", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000115": null, + "019a8136-0000-7000-8000-000000000116": "open" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000115", + "019a8136-0000-7000-8000-000000000116" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000301": [ + "019a8136-0000-7000-8000-000000000116" + ] + } + } + }, + { + "name": "a-byte-order-mark-is-not-trimmed", + "note": "U+FEFF is no White_Space, so the room profile's trim leaves it, as its own fixture's byte-order-mark case does: `open` after it is none of the four, no state. A trim that strips U+FEFF reads `open`.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000117", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "name": "Name the sound", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000118", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "name": "Name the strait", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000117": null, + "019a8136-0000-7000-8000-000000000118": "open" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000117", + "019a8136-0000-7000-8000-000000000118" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000301": [ + "019a8136-0000-7000-8000-000000000118" + ] + } + } + }, + { + "name": "the-long-s-folds", + "note": "The long s (U+017F) folds to s by simple case folding, as the room profile's own fixture folds it: the word is `standing`. Lower-casing leaves the long s, and reads no state.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000119", + "type": "relation", + "supertype": "Work item", + "subtype": "ſTANDING", + "name": "The kept list", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + }, + { + "type": "object", + "id": "019a8136-0000-7000-8000-000000000321", + "reason": "No description." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "states": { + "019a8136-0000-7000-8000-000000000119": "standing" + }, + "shown": [ + "019a8136-0000-7000-8000-000000000119" + ], + "open_work": { + "019a8136-0000-7000-8000-000000000301": [], + "019a8136-0000-7000-8000-000000000321": [] + } + } + } + ], + "asker_cases": [ + { + "name": "the-asker-is-the-character-the-key-names", + "note": "The asker is the key's Character, not the maker and not actor.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000121", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "actor": "019a8136-0000-7000-8000-000000000203", + "created_by": "019a8136-0000-7000-8000-000000000901", + "x_packet_from": "019a8136-0000-7000-8000-000000000201", + "name": "Name the harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000121": "019a8136-0000-7000-8000-000000000201" + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [ + "019a8136-0000-7000-8000-000000000121" + ], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "no-key-names-no-asker", + "note": "Without the key, or with it null, nobody is the asker and there is no lint: neither the maker in created_by, nor the tool in x_packet_producer, nor actor.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000122", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "actor": "019a8136-0000-7000-8000-000000000203", + "created_by": "019a8136-0000-7000-8000-000000000901", + "name": "Name the bay", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000123", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "created_by": "019a8136-0000-7000-8000-000000000901", + "x_packet_producer": { + "tool": "world-doctor", + "version": "0.11.0" + }, + "name": "Doctor's findings", + "x_packet_elements": [ + { + "type": "object", + "id": "019a8136-0000-7000-8000-000000000321", + "reason": "No description." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000134", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "actor": "019a8136-0000-7000-8000-000000000203", + "created_by": "019a8136-0000-7000-8000-000000000901", + "x_packet_from": null, + "name": "Date the bay", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000122": null, + "019a8136-0000-7000-8000-000000000123": null, + "019a8136-0000-7000-8000-000000000134": null + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "a-key-that-is-no-character-names-no-asker", + "note": "The id of a Location the reader holds, an empty string and a list: no asker, each with a lint, never guessed at.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000124", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "created_by": "019a8136-0000-7000-8000-000000000901", + "x_packet_from": "019a8136-0000-7000-8000-000000000301", + "name": "Map the cape", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000125", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "created_by": "019a8136-0000-7000-8000-000000000901", + "x_packet_from": "", + "name": "Map the bay", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000126", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "created_by": "019a8136-0000-7000-8000-000000000901", + "x_packet_from": [ + "019a8136-0000-7000-8000-000000000201" + ], + "name": "Map the harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000124": null, + "019a8136-0000-7000-8000-000000000125": null, + "019a8136-0000-7000-8000-000000000126": null + }, + "lints": [ + { + "kind": "asker", + "item": "019a8136-0000-7000-8000-000000000124" + }, + { + "kind": "asker", + "item": "019a8136-0000-7000-8000-000000000125" + }, + { + "kind": "asker", + "item": "019a8136-0000-7000-8000-000000000126" + } + ], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "an-asker-the-reader-cannot-name", + "note": "An id the reader holds no element for (deleted, hidden from this reader, not served): no asker shown, no lint, never a guess.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000135", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "created_by": "019a8136-0000-7000-8000-000000000901", + "x_packet_from": "019a8136-0000-7000-8000-000000000299", + "name": "Name the shoal", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000135": null + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "an-asker-in-upper-case-names-nothing", + "note": "Read as written: the first Character's id in upper case is a spelling no element's own id is written in, so it names nothing the reader holds: no asker, no lint.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000136", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "019A8136-0000-7000-8000-000000000201", + "name": "Name the spit", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000136": null + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "a-character-whose-own-id-is-in-upper-case", + "note": "The fourth Character's own id is written in upper case. The first item writes it exactly so and names that Character as its asker; the second writes it in lowercase, a spelling no element's own id is written in, so it names nothing the reader holds: no asker, no lint.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000141", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "019A8136-0000-7000-8000-000000000204", + "name": "Name the creek", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000142", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "019a8136-0000-7000-8000-000000000204", + "name": "Date the creek", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000141": "019A8136-0000-7000-8000-000000000204", + "019a8136-0000-7000-8000-000000000142": null + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [ + "019a8136-0000-7000-8000-000000000141" + ] + } + } + }, + { + "name": "an-asker-with-a-space-names-nothing", + "note": "Read as written: the first Character's id with a space after it is a spelling no element's own id is written in, so it names nothing the reader holds: no asker, no lint. The key is trimmed only to find whether it is empty.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000139", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "019a8136-0000-7000-8000-000000000201 ", + "name": "Name the inlet", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000139": null + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "an-asker-that-is-a-number-is-no-id", + "note": "A number is not one id: no asker, with a lint, never read as absent.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000140", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": 7, + "name": "Name the lagoon", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000140": null + }, + "lints": [ + { + "kind": "asker", + "item": "019a8136-0000-7000-8000-000000000140" + } + ], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "an-asker-of-white-space-alone-is-no-id", + "note": "An ideographic space, a space and a tab are White_Space alone: empty once trimmed as the room profile trims, the key reads as an empty string does, not one id: no asker, with a lint.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000143", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "  \t", + "name": "Name the cove", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000143": null + }, + "lints": [ + { + "kind": "asker", + "item": "019a8136-0000-7000-8000-000000000143" + } + ], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "an-asker-of-a-unit-separator-alone-names-nothing", + "note": "U+001F alone is no White_Space, so the room profile's trim leaves it and the key is not empty: a string that names nothing the reader holds, no asker, no lint. A language's trim that strips control characters reads it as empty.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000144", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "\u001f", + "name": "Name the firth", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000144": null + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "a-word-that-is-no-id-names-nothing", + "note": "A non-empty string not written in an id's form is still a string: it names nothing the reader holds, no asker, no lint.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000145", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "hello", + "name": "Name the estuary", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000145": null + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "the-asker-is-of-the-world-the-item-sits-in", + "note": "Both items sit in the world below and are about another world, the source. The asker is read among this world's Characters: the first Character asks the first item; the second names a Character of the source world only, which is no Character of this world, so no asker, with a lint.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000137", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "019a8136-0000-7000-8000-000000000201", + "name": "Name the source's harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000511", + "reason": "No name." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000500" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000138", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "019a8136-0000-7000-8000-000000000501", + "name": "Date the source's harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000511", + "reason": "No date." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000500" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000137": "019a8136-0000-7000-8000-000000000201", + "019a8136-0000-7000-8000-000000000138": null + }, + "lints": [ + { + "kind": "asker", + "item": "019a8136-0000-7000-8000-000000000138" + } + ], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [ + "019a8136-0000-7000-8000-000000000137" + ], + "019a8136-0000-7000-8000-000000000202": [], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + }, + { + "name": "what-am-i-waiting-on", + "note": "The open and taken items each Character asked for; a done, a standing and an item of no state are no waiting.", + "items": [ + { + "id": "019a8136-0000-7000-8000-000000000127", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "019a8136-0000-7000-8000-000000000201", + "name": "Name the harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000128", + "type": "relation", + "supertype": "Work item", + "subtype": "done", + "x_packet_from": "019a8136-0000-7000-8000-000000000201", + "name": "Date the harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000129", + "type": "relation", + "supertype": "Work item", + "subtype": " Taken", + "x_packet_from": "019a8136-0000-7000-8000-000000000201", + "name": "Map the harbour", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000130", + "type": "relation", + "supertype": "Work item", + "subtype": "standing", + "x_packet_from": "019a8136-0000-7000-8000-000000000201", + "name": "Keep the harbour tidy", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000131", + "type": "relation", + "supertype": "Work item", + "subtype": "blocked", + "x_packet_from": "019a8136-0000-7000-8000-000000000201", + "name": "Wait on the survey", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000132", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "x_packet_from": "019a8136-0000-7000-8000-000000000202", + "name": "Name the bay", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + }, + { + "id": "019a8136-0000-7000-8000-000000000133", + "type": "relation", + "supertype": "Work item", + "subtype": "open", + "name": "Name the cape", + "x_packet_elements": [ + { + "type": "location", + "id": "019a8136-0000-7000-8000-000000000301", + "reason": "No parent location." + } + ], + "x_packet_source": { + "server": null, + "world": "019a8136-0000-7000-8000-000000000000" + } + } + ], + "want": { + "askers": { + "019a8136-0000-7000-8000-000000000127": "019a8136-0000-7000-8000-000000000201", + "019a8136-0000-7000-8000-000000000128": "019a8136-0000-7000-8000-000000000201", + "019a8136-0000-7000-8000-000000000129": "019a8136-0000-7000-8000-000000000201", + "019a8136-0000-7000-8000-000000000130": "019a8136-0000-7000-8000-000000000201", + "019a8136-0000-7000-8000-000000000131": "019a8136-0000-7000-8000-000000000201", + "019a8136-0000-7000-8000-000000000132": "019a8136-0000-7000-8000-000000000202", + "019a8136-0000-7000-8000-000000000133": null + }, + "lints": [], + "waiting_on": { + "019a8136-0000-7000-8000-000000000201": [ + "019a8136-0000-7000-8000-000000000127", + "019a8136-0000-7000-8000-000000000129" + ], + "019a8136-0000-7000-8000-000000000202": [ + "019a8136-0000-7000-8000-000000000132" + ], + "019a8136-0000-7000-8000-000000000203": [], + "019A8136-0000-7000-8000-000000000204": [] + } + } + } + ] +} diff --git a/codegen/schema-dist/profiles/packet.md b/codegen/schema-dist/profiles/packet.md index a7609fa..9747150 100644 --- a/codegen/schema-dist/profiles/packet.md +++ b/codegen/schema-dist/profiles/packet.md @@ -2,9 +2,9 @@ **What it is.** A packet of work about a world: a list of elements with a reason each, made by a tool (a world doctor's findings), a person (an ask: "look at these four") or an AI (a proposal). The packet travels as JSON until it lands as an element; landed, it is a Relation with supertype `Work item` and the packet's fields ride on it, so every tool that follows a work item reads one shape: the parlor's list, Atlas's import by the id list, the doctor's output, a seat's proposal. -**Key names.** Profile `packet`, four fields: `x_packet_elements`, `x_packet_source`, `x_packet_producer`, and a fourth, optional, `x_packet_for`. The grammar is `x__`; the prefix `x_packet_` is reserved. +**Key names.** Profile `packet`, five fields: `x_packet_elements`, `x_packet_source`, `x_packet_producer`, and two optional, `x_packet_for` and `x_packet_from`. The grammar is `x__`; the prefix `x_packet_` is reserved. -**On which element.** A Relation with supertype `Work item`. **Where real links can exist**, the Relation's own typed link fields (`characters`, `locations` and the rest) carry the same elements as real links, so a tool that knows nothing of this profile still follows them: that is when the work item lives in the world its elements live in (a world's own room, a doctor filing into the world it checked). Across worlds (a link to an id the world does not hold is refused by the platform), and for the types a Relation has no link field for (Law, Map, Pin, Marker, Relation), `x_packet_elements` is the only carrier, and **a reader never lands a foreign id as a link**; `actor` is the one person the work is for, and `x_packet_for` the roles it is for (below); the description is the packet's own summary; the subtype is its state (`open`, `taken`, `done`). Before landing, the same keys sit in a bare JSON object with `type: "relation"`, `supertype: "Work item"`, `name` and `description`, and no `id` (the landing tool mints one). +**On which element.** A Relation with supertype `Work item`. **Where real links can exist**, the Relation's own typed link fields (`characters`, `locations` and the rest) carry the same elements as real links, so a tool that knows nothing of this profile still follows them: that is when the work item lives in the world its elements live in (a world's own room, a doctor filing into the world it checked). Across worlds (a link to an id the world does not hold is refused by the platform), and for the types a Relation has no link field for (Law, Map, Pin, Marker, Relation), `x_packet_elements` is the only carrier, and **a reader never lands a foreign id as a link**; `actor` is the one person the work is for, and `x_packet_for` the roles it is for (below); the description is the packet's own summary; the subtype is its state (`open`, `taken`, `done` or `standing`: rule 5). Before landing, the same keys sit in a bare JSON object with `type: "relation"`, `supertype: "Work item"`, `name` and `description`, and no `id` (the landing tool mints one); it may carry its state in `subtype` already, as both examples below do. **The values.** @@ -14,21 +14,26 @@ | `x_packet_source` | `{"server": "", "world": ""}`: which world the ids belong to, in the shape of the folder format's provenance line (the folder format's `source`: its `server` and `world`), so a packet made from a folder on disk (`server: null`) and one made from an account world read the same. A packet read in a parlor world points at the SOURCE world, never at the parlor. | | `x_packet_producer` | `{"tool": "", "version": ""}`, present only when a tool made the packet (the doctor, an agent's harness). A person's packet carries no producer: `created_by` already names them. `tool` is required whenever the key is present; `version` is optional: a writer that does not know the version leaves the key out, never invents one and never writes the word "unknown", and a reader takes a producer with no version as a producer whose version is not known. The `tool` and `version` of a world folder's `producer` (the folder format). | | `x_packet_for` | Optional. A list of Title ids: the work item is for whoever holds one of them; `actor` stays the one person it is for. Both may be set. The ids are Titles of the world the work item sits in, as `actor` is a Character of that world; never of the world `x_packet_source` names. In a parlor world apart from its source, the people and their roles are the parlor's. It is not a link, so nothing follows it and no lens reaches a work item through it. | +| `x_packet_from` | Optional. One Character id, as a string: who asked for the work. The Character is one of the world the work item sits in, as `actor` is; never of the world `x_packet_source` names. Any Character of the world may ask, an AI's own Character included. Absent, the asker is not named (rule 8). It is not a link, as `x_packet_for` is not. | **How a reader uses it.** 1. The elements are `x_packet_elements`, in that order; the Relation's typed links are the same set and a reader may use either. When the two disagree (a landing tool failed half way), `x_packet_elements` is the packet and the links are a view of it. 2. A reader resolves each `{type, id}` in the source world named by `x_packet_source`; an id it cannot find is reported as missing, never dropped and never guessed at. The source world is not the world the Relation sits in when the Relation lives in a parlor. 3. Who made it: `x_packet_producer` names the tool; absent, the maker is `created_by` (a person's membership, or a seat); `changed_via` says which door it came through. A reader shows "the doctor, 0.11.0" from the producer line and never infers a tool from the seat. A producer whose `tool` is missing, empty or not a string is ignored, never repaired (the packet reads as one no tool signed); a producer with no version is shown by its tool's name alone ("the doctor"). 4. A packet's size is bounded by the extension cap (the platform's cap on extension keys; on onlyworlds.com, 64 KB per element for all its extension keys together, counted as compact JSON): about 400 to 700 entries. A producer with more splits the packet into several work items, named ` (1 of 3)`, `(2 of 3)`, each complete on its own; a reader sees several, never a truncated one. A writer that would exceed the cap refuses to write, never trims. -5. The state is the subtype (`open`, `taken`, `done`); a reader changes the state by changing the subtype and nothing in the packet. +5. The state is the subtype, one of four words: `open`, `taken`, `done` and `standing` (rule 7). Every state is matched trimmed and without regard to case, as the room profile defines it, so ` Standing` and `OPEN` are `standing` and `open`. A subtype that is none of the four is no state, an empty or absent one included: the work item is shown, and is never open work. **Open work** is a work item whose state is `open` or `taken`: work that is not done; a `done` item, a `standing` one and one with no state are never open work. A reader offers to take a work item, or to set it done, only when it is open work. A reader changes the state by changing the subtype and nothing in the packet. 6. **For whom.** A work item is for a seat when `actor` is the seat's Character, or a Title in `x_packet_for` names that Character in its `holders`. Neither set: addressed to no one; a reader shows it apart ("not addressed to anyone"), never as for every role. An id in `x_packet_for` that is no Title of this world, or an empty string, is ignored and reported by a lint, never guessed at; an empty list reads as absent. A reader that does not know the key loses nothing: a packet without it is whole. +7. **A standing work item** (state `standing`) is never done: a standing order of work, a kept list. It is never open work: a reader of open work leaves it out, and counts it on none of the elements it names. A reader that shows it shows it as itself: its name, and beside each element the reason, in `x_packet_elements`' order (rule 1). Being no open work, it is never offered to take or to set done (rule 5), and no report sets it done (the report profile sets `done` only on open work, a work item that is still `open` or `taken`). +8. **Who asked.** The asker is the Character `x_packet_from` names. Absent or `null` (as the room profile's mark and the report profile's parent read a `null`), the asker is not named, with no lint, and a reader names none: never the maker (`created_by`, or the tool `x_packet_producer` names) and never `actor`. The key is read as written, as the address profile's "The same id" reads an id in an `x_` value: it names the element whose own `id` is written exactly so, and any other spelling is another value that names nothing. It is no asker, reported by a lint and never guessed at, when it is not one id (a value that is not a string, such as a list or a number, or a string that is empty once trimmed of White_Space, as the room profile trims; the trim decides only that, as in the report profile's rule 9) or when it names an element the reader holds that is no Character of this world (a Location, or a Character of the source world only). A value that names no element the reader holds (the id of one deleted, hidden from this reader or not served to it, or a spelling that no element's own `id` is written in) is an asker this reader cannot name: no asker is shown, with no lint, and none is guessed. "What am I waiting on" is a read: the open work whose `x_packet_from` is my Character, the Character the reader plays, so a person and an AI that play the same Character wait on the same items. A reader that does not know the key loses nothing. **What a writer must do.** - Write `x_packet_elements` and `x_packet_source` together, with `x_packet_elements` never empty, and `x_packet_producer` beside them only when a tool made the packet; a work item with no elements is a plain Relation, not a packet. - Write the fourth, `x_packet_for`, only when the work is for a role, and never as an empty list: a writer leaves the key out instead of writing one. +- Write the fifth, `x_packet_from`, when the writer knows who asks, itself included when it asks (the Character it plays); a writer that does not know leaves the key out, never writes an empty string, and never puts a guess in it. +- Whoever writes the work item as an element writes its state in the subtype and never leaves it empty: `open` for work to be done, `standing` for work that is never done. A work item with no state is never open work (rule 5). - Keep every entry's three keys; keep the source as the server and world it was made from; split past the cap. - Keep it byte for byte when it is not yours to change, like every extension field. A re-key (a tool deliberately giving an element a new id, which may rewrite a value that is that old id, whole) never enters it: a packet is about the world named in `x_packet_source` with the ids that world had when the packet was made, and a copy of the world under fresh ids is a different world, where rule 2 reports the ids as missing. -- Reserve the prefix. A tool that lets people add their own fields reserves `x_packet_` and shows the four fields read-only, like `x_identity_`. +- Reserve the prefix. A tool that lets people add their own fields reserves `x_packet_` and shows the five fields read-only, like `x_identity_`. **What it is not.** A link field (a reader that ignores the profile still has the typed links), a record of what was done (the state is the subtype; the doing is in the elements' own changes), or a store of element text (a reason is one sentence about why, never a copy of the element). `x_packet_for` is a key and not the Relation's `titles` link because the typed links carry the packet's own elements (rule 1: the same set), so a Title in `titles` is one of the work's elements, never whom the work is for. @@ -72,4 +77,6 @@ } ``` -Readers today: none shipped; the parlor, the world doctor in the Python package and Atlas's import by id list are the first three, each named here as it ships. No reader of `x_packet_for` has shipped either. Ruled: the shape the doctor reads, 2026-10-21; `x_packet_for`, 2026-11-10, serial 112; a producer's `tool` required and its `version` optional, 2026-11-11, serial 115. +**The fixture.** `packet.fixture.json`, beside this page, holds the cases of rules 5, 7 and 8 every reader must agree on, read in the world its `world` names, with that world's Characters and the other elements of it the reader holds, and its `source_world` where a packet is about another world: each case is the work items as one reader is given them, in the order given, and a `want`. `state_cases`: each item's state (one of the four words, or `null` for no state), every item shown, and, for each element the items name, the open work that names it; and an item's elements in their order, compared only where the want carries them. `asker_cases`: each item's asker (a Character's id, or `null`), the lints, and for each Character what it is waiting on. In the want, `states`, `askers` and `elements` are keyed by the item's id, `open_work` by the element's id and `waiting_on` by the Character's; each but `elements` compares as a map, and `elements` is compared on the items the want names, each a list of element ids in order; `shown`, each list of work items in those maps and `lints`, each `{kind, item}` of the one kind `asker`, compare as sets. The cases cover: a standing item; `Standing ` with a capital and a trailing space; `open`, `taken` and `done` beside a standing item; a standing item with five elements; a standing item beside an open one, the want carrying only the standing item's elements; the subtype `blocked`; a work item with no subtype, a `null` one, an empty one and one of spaces alone; `open` followed by U+001F and `open` after U+FEFF, neither of which is White_Space; `ſTANDING`, whose long s folds to s; an asker; an item with no key, made by a person and one made by a tool, and one whose key is `null`; a key that names a Location, an empty string and a list; an asker the reader holds no element for; a Character's id in upper case and one with a space after it; an asker that is a number, one of White_Space alone and one of U+001F alone, which is no White_Space, and a word in no id's form; a Character whose own id is in upper case, named by that spelling and not by its lowercase one; two work items about another world, one asked by a Character of the world they sit in and one naming a Character of the source world only; and what a Character is waiting on. The rest of the page has no cases. + +Readers today: keel's context read of a Character (on onlyworlds.com, `GET /api/v2/character/{id}/context`, and the MCP tool `get_draught`) hands her open work, each work item whose state is `open` or `taken`, trimmed and folded as the room profile defines it, that is for her by `actor` or by a Title she holds that `x_packet_for` names (rule 6), as that reader is served the Title and the work item, with its `x_packet_elements`; it hands no other work item as work, a `standing` one and one with no state among them. The `@onlyworlds/sdk` package types those rows, with the Titles `x_packet_for` names as `by_role` since 4.178.0. Other tools that read work items are named here once their reading is checked against this page. No reader of `x_packet_from` has shipped. Ruled: the shape the doctor reads, 2026-10-21; `x_packet_for`, 2026-11-10, serial 112; a producer's `tool` required and its `version` optional, 2026-11-11, serial 115; a fourth state, `standing`, a work item that is never done, which is never open work and which no reader offers to take or sets done, open work being a work item whose state is `open` or `taken`, every state matched trimmed and without regard to case as the room profile defines it, a subtype that is none of the four (an empty or absent one included) no state, shown and never open work, a reader offering to take or to set done only open work, whoever writes the work item as an element writing its state, an optional fifth key, `x_packet_from`, the Character who asked, never guessed when absent, and the page's first fixture, 2026-11-18, serial 136. diff --git a/codegen/schema-dist/profiles/report.fixture.json b/codegen/schema-dist/profiles/report.fixture.json index 5ab0607..a47c8d4 100644 --- a/codegen/schema-dist/profiles/report.fixture.json +++ b/codegen/schema-dist/profiles/report.fixture.json @@ -10,7 +10,8 @@ "groups: each {parent, kind, reports}: the parent's id, report or board, and the ids of the reports that name it, ordered by created_at as the message profile orders messages (read in the one form the message profile gives, as an instant, a time with no offset as UTC; two at the same instant keep the order given; one that cannot be read after every one that can, in the order given). The parent itself is not in reports. A report in no group and heading none is not listed.", "lints: each {kind, report}: chain on a report whose parent is a report that itself has a report for its parent (one the reader holds, the pair and the mark, its own parent read by this rule); self on a report that names itself. A report that names itself is read as naming no parent, so a report that names it is no chain. These are the only lints: a parent that is missing or of no kind is no lint.", "The page rules the order inside a group and none between groups: groups and lints each compare as a set. Here groups are listed in the order their parent is first named in the list given, and lints in the order of their reports.", - "A case's note is prose for the reader of the fixture, never an input." + "A case's note is prose for the reader of the fixture, never an input.", + "talk_cases: each case is one Narrative as a reader is given it and its talks; a Narrative that is no report (the pair and the mark, both) is shown with no talk. talks: every talk on an element a reader shows the report with, each {type, id}, an id in objects as object and an id in constructs as construct, each entry read as the room profile reads a line's (one that is not a string, or is empty once trimmed of White_Space, names nothing; a field that is not a list names none; every other entry is an id read as written), read from the report alone, compared as a set. A reader shows a report with the talk on each Object or Construct it links, whether or not it names a sitting in events; talks never says which of them, if any, the report closed." ], "pair": { "type": "narrative", @@ -1380,5 +1381,123 @@ "lints": [] } } + ], + "talk_cases": [ + { + "name": "a-report-linking-an-object-is-shown-with-the-talk-on-it", + "note": "No events: a talk on an element hangs on the element, in every sitting.", + "report": { + "id": "019a7120-0000-7000-8000-000000000a21", + "type": "narrative", + "supertype": "Report", + "x_room_of": "019a7120-0000-7000-8000-000000000000", + "subtype": "completed", + "objects": [ + "019a7120-0000-7000-8000-000000000a01" + ] + }, + "talks": [ + { + "type": "object", + "id": "019a7120-0000-7000-8000-000000000a01" + } + ] + }, + { + "name": "a-report-linking-a-construct-is-shown-with-the-talk-on-it", + "note": "No events: a talk on an element hangs on the element, in every sitting.", + "report": { + "id": "019a7120-0000-7000-8000-000000000a22", + "type": "narrative", + "supertype": "Report", + "x_room_of": "019a7120-0000-7000-8000-000000000000", + "subtype": "completed", + "constructs": [ + "019a7120-0000-7000-8000-000000000a11" + ] + }, + "talks": [ + { + "type": "construct", + "id": "019a7120-0000-7000-8000-000000000a11" + } + ] + }, + { + "name": "a-report-without-the-mark-linking-an-object-is-shown-with-no-talk", + "note": "A Narrative with supertype Report and no mark is lore, and nothing on the report page applies to it.", + "report": { + "id": "019a7120-0000-7000-8000-000000000a23", + "type": "narrative", + "supertype": "Report", + "subtype": "completed", + "objects": [ + "019a7120-0000-7000-8000-000000000a01" + ] + }, + "talks": [] + }, + { + "name": "a-report-whose-objects-hold-a-number-and-an-empty-string-is-shown-with-the-one-talk", + "note": "Its objects hold a number and the empty string beside one id: read as the room profile reads a line's entries, only the id names an element.", + "report": { + "id": "019a7120-0000-7000-8000-000000000a24", + "type": "narrative", + "supertype": "Report", + "x_room_of": "019a7120-0000-7000-8000-000000000000", + "subtype": "completed", + "objects": [ + 7, + "", + "019a7120-0000-7000-8000-000000000a01" + ] + }, + "talks": [ + { + "type": "object", + "id": "019a7120-0000-7000-8000-000000000a01" + } + ] + }, + { + "name": "a-marked-message-linking-an-object-is-no-report-and-shown-with-no-talk", + "note": "A line in the room (the pair narrative + Message, with the mark) is no report: a report is the pair narrative + Report and the mark, both.", + "report": { + "id": "019a7120-0000-7000-8000-000000000a25", + "type": "narrative", + "supertype": "Message", + "x_room_of": "019a7120-0000-7000-8000-000000000000", + "objects": [ + "019a7120-0000-7000-8000-000000000a01" + ] + }, + "talks": [] + }, + { + "name": "a-report-reads-its-ids-as-written", + "note": "Its objects hold White_Space alone, which names nothing, an id in upper case and an id with a space after it: each of the two is read as written, never folded to lowercase or trimmed.", + "report": { + "id": "019a7120-0000-7000-8000-000000000a26", + "type": "narrative", + "supertype": "Report", + "x_room_of": "019a7120-0000-7000-8000-000000000000", + "subtype": "completed", + "objects": [ + " ", + "019A7120-0000-7000-8000-000000000A02", + "019a7120-0000-7000-8000-000000000a03 " + ] + }, + "talks": [ + { + "type": "object", + "id": "019A7120-0000-7000-8000-000000000A02" + }, + { + "type": "object", + "id": "019a7120-0000-7000-8000-000000000a03 " + } + ] + } ] } diff --git a/codegen/schema-dist/profiles/report.md b/codegen/schema-dist/profiles/report.md index 46ea243..ac1db35 100644 --- a/codegen/schema-dist/profiles/report.md +++ b/codegen/schema-dist/profiles/report.md @@ -20,13 +20,13 @@ | `x_report_answers` | optional: a list of the ids of the work items this report answers, in the world the report sits in. A report answers a work item when what the report records meets what the item asked for. A report that answers no work item leaves the key out; an empty list reads as absent. Each id in it is also in `relations`, as a real link, so a tool that knows nothing of this page still follows it | step 1 | | `parent_narrative` | optional: the first report of the work this report continues, or the board entry a closed talk hangs on (both below) | step 1, step 2 | | `description` | the short human part: a brief summary and the links that matter | step 2 | -| the other typed links | every element the report touched or changed, where the Narrative type has a link field for that element's type (`characters`, `objects`, `locations`, `events` and the rest of its multi-links). The Narrative has none for a Map, a Pin or a Marker, and links another Narrative only as its `parent_narrative`: a Narrative, Map, Pin or Marker the report changed is named by its address in `consequences`, in that change's line (or by the kind and count of a line for a change made to many at once, below). The other elements of a change made to many at once are linked all the same, each in the multi-link field for its type: the line stands in for their addresses, never for their links; one it only touched is named by its address in `description` | step 2 | +| the other typed links | every element the report touched or changed, where the Narrative type has a link field for that element's type (`characters`, `objects`, `locations`, `events` and the rest of its multi-links). The Narrative has none for a Map, a Pin or a Marker, and links another Narrative only as its `parent_narrative`: a Narrative, Map, Pin or Marker the report changed is named by its address in `consequences`, in that change's line (or by the kind and count of a line for a change made to many at once, below). The other elements of a change made to many at once are linked all the same, each in the multi-link field for its type: the line stands in for their addresses, never for their links; one it only touched is named by its address in `description` | step 2; and at step 1, a closed talk's report may write the one that carries its anchor (`objects`, `constructs` or `events`, the table below) | | `consequences` | what was changed in the world because of it, one line per change. A line's own words name the element as it was, and its address follows (`Renamed the Consul's Steinway: ow://object/`, the address profile's text form), so the line still reads whole after the element is gone. The writer chooses: one line per element, or, for the same change made to many elements at once, one line, which names the kind of element, the count and the change without addresses, and may name the lens or the search that finds them (`Set the subtype of 3 Objects to surveyed (a search for every Object finds them)`); a reader accepts both. `nothing changed` when nothing was. Required at `completed` | step 2 | Files on a report are the element's own files, as on a message. When a report was written is its `created_at`, read as the message profile reads one; a `start_date` on it is a date in the world's own time, another thing. **The two steps.** -1. **Handing in.** The reporter's AI, when a stretch of work is worth telling, writes one Narrative: the pair, the mark, `subtype` `handed in`, a name, the whole text as `story`, its own Character as `narrator`, and the work items it answers in `x_report_answers` and in `relations`. A report answers a work item when what the report records meets what the item asked for, in one of two ways. When the reporter finished the work itself (the item asked for something done outside the world, or for an element the seat may write), the AI names the item and sets its state to `done` (the packet profile's subtype) where it may change it (it made it, or its seat may change any element); a seat that may change only its own elements leaves it, and the keeper sets it `done` in step 2. When the item asks for a change only the keeper makes, the AI names the item and leaves its state alone; the keeper sets it `done` in step 2, after making the change. A work item is never `done` before the work exists. It formats nothing for this page and changes nothing else in the world. A person may hand in a report the same way. +1. **Handing in.** The reporter's AI, when a stretch of work is worth telling, writes one Narrative: the pair, the mark, `subtype` `handed in`, a name, the whole text as `story`, its own Character as `narrator`, and the work items it answers in `x_report_answers` and in `relations`; a closed talk's report may also link the talk's anchor here, in the field the closed talk's table names for it (below). A report answers a work item when what the report records meets what the item asked for, in one of two ways. When the reporter finished the work itself (the item asked for something done outside the world, or for an element the seat may write), the AI names the item and, when it is still `open` or `taken`, sets its state to `done` (the packet profile's subtype) where it may change it (it made it, or its seat may change any element); a seat that may change only its own elements leaves it, and the keeper sets it `done` in step 2. When the item asks for a change only the keeper makes, the AI names the item and leaves its state alone; the keeper sets it `done` in step 2, after making the change. A work item is never `done` before the work exists. A `standing` work item is never done (the packet profile's rule 7): no report sets it `done`, at either step. It formats nothing for this page and changes nothing else in the world. A person may hand in a report the same way. 2. **Completing.** The world's keeper (the owner or a co-builder, as the charter profile names the role: a person or their AI) reads the reports that are `handed in`. For each, the keeper makes the changes the report calls for, directly; writes the `description`; links every element it touched or changed; writes `consequences`, a line per change (or, the keeper's choice, one line for the same change made to many elements at once); sets to `done`, once the work exists, exactly the work items `x_report_answers` names that are still `open` or `taken`, and never a work item the key does not name; and sets `subtype` to `completed`. The keeper never edits `story`. **The keeper's own session.** When the reporter is the keeper itself (the keeper's AI, or the keeper in person), there is no second hand, and the report is **one write**: it is born `completed`, with its `story`, `description`, links and `consequences` together, beside the pair, the mark, the name, `narrator` and `x_report_answers` that step 1 writes. The keeper also sets to `done`, once the work exists, exactly the work items `x_report_answers` names that are still `open` or `taken`, as step 2 does. A reader shows it as any completed report and never expects a `handed in` state to have existed. @@ -37,13 +37,16 @@ Files on a report are the element's own files, as on a message. When a report wa **A report that continues earlier work.** Work often runs over several reports: a second stretch the same day, the same subject a week later, a correction of what an earlier report said. Each is a new report, and none is an edit of an earlier one. A report that continues earlier work names the **first** report of that work in `parent_narrative`: always the first, never the one before it (a closed talk's report on a board entry is the one that does not: it keeps the entry, below), so every later report of a thread carries the same id, and one list by that id (on onlyworlds.com, `GET /narrative?supertype=Report&parent_narrative=`) is the thread's later reports, read in the order of `created_at`. What that list holds is read by rule 9: a Narrative in it that is no report by rule 1 (the pair and the mark, both) is no part of the thread. To find the first, a writer looks no further than the report it continues: it names that report's own parent when that parent is a report the writer can read, and otherwise the report it continues. The first report carries nothing for this and is not changed when a later one arrives. The first report may be another seat's: a thread is the work, not the person, and rule 4 still reads each report's own writer. The reporter writes the link at step 1; the keeper may set or correct it at step 2. -**A closed talk's report.** The same element, with the talk as its source: the AI of whoever closes the talk hands it in through that person's own seat, with the talk's own account as `story`. No element is a talk. A parlor's line hangs on one of three things, and a talk is the thread under it; the report links that anchor and says the window of time it covers: the reporter in `story`, the keeper in `description` when completing (in both, when the keeper reports its own session in one write). +**A closed talk's report.** The same element, with the talk as its source: the AI of whoever closes the talk hands it in through that person's own seat, with the talk's own account as `story`. No element is a talk. A parlor's line may hang on one of the four things below, on more than one, or on none (a line that names an Object may hang on a work item as well: the room profile's talk on an element), and a talk is the thread under one of them; the report links that anchor and says the window of time it covers: the reporter in `story`, the keeper in `description` when completing (in both, when the keeper reports its own session in one write). | The talk hangs on | The report links it in | |---|---| | a board entry (a Narrative) | `parent_narrative` | | a work item (a Relation) | `relations` | | the sitting it was said in (an Event, the room profile's pair `event` + `Sitting`), for free talk | `events` | +| an Object or a Construct, the talk on it being the lines that name it (the room profile) | `objects` or `constructs` | + +A talk on an Object or a Construct hangs on the element, in every sitting, and is there whether or not the world marks design parts (the charter profile's design state, `profiles/charter.md`): its report links the element in `objects` or `constructs` and needs no sitting in `events`. A report's `objects` and `constructs` hold every Object and Construct it touched or changed (the typed links, above), so a reader shows a report with the talk on each one it links (its entries read as the room profile reads a line's), whenever the report was written; from the report alone no reader can tell which of them, if any, was the talk the report closed, and this page names none. This row is the field a closed talk's report links its element by, and a report shown with the talk on an element is never, by that alone, the report that closed it. A talk that hangs on a work item links it in `relations`; the report answers that work item only when it also names it in `x_report_answers`. @@ -58,7 +61,7 @@ A report of a talk that hangs on a board entry keeps the entry in `parent_narrat 6. **Nobody is addressed by a report.** `characters` on a report means "these Characters were touched", never "to". A report that should reach someone is followed by a short message (the message profile). 7. A `subtype` other than the two words is shown as written and reported by a lint, never repaired. 8. **A line of `consequences` may have no address.** A change made to many at once may be one line with no address, naming the kind, the count and the change, and perhaps the lens or the search that finds them: a reader follows the line's address (rule 10) where a line has one, never expects one on every line, and never reads a line without one as a fault. It finds the address as the address profile's "An address in prose" reads one: in prose, the address continues only with what its reading takes, and what follows is prose, a full stop included (`Renamed the Consul's Steinway: ow://object/.` names the Object, and the full stop is the line's). The elements such a line counts are still linked, each in the Narrative's multi-link field for its type (`characters`, `objects`, `locations` and the rest the typed-links row names), never in `parent_narrative`, `narrator` or another single link; a Narrative, a Map, a Pin or a Marker among them is named by the line's kind and count alone and is never linked. -9. **Threads.** A reader that groups reports groups them by `parent_narrative`, read as written (a parent names the report whose `id` is written exactly as it is: the address profile's "The same id"). Where the parent is a report (the pair and the mark), the group is that report's thread: the parent first, then the reports that name it, ordered by `created_at` as the message profile orders messages (read in the one form the message profile gives, as an instant, a time with no offset as UTC; two at the same instant keep the order of the list the reader was given; one whose `created_at` cannot be read as a date and time comes after every one that can, in the list's order). Only that order is the message profile's: a message's thread is walked up through its parents, and a report's never is. Where the parent is a board entry (the room profile's pair `narrative` + `Board`, and the mark), the group is the reports of the talks under that entry, in the same order. Only reports are grouped: a Narrative that is no report (a message that answers one) may name a report as its parent, and is no part of its thread. A report that names itself is read as naming no parent, with a lint. A reader never walks further up: a report whose parent is a report that itself has a report for its parent (one the reader holds, the pair and the mark, its own parent read by this rule) is shown under the parent it names, and reported by a lint, never repaired. Reports that name each other in a ring have no first: each is in the group of the one it names, each is linted as such a chain, and none of them, nor any report under them, is reached by starting from first reports. A parent whose id the reader holds and whose element it does not (a folder or an export without it, an id that dangles), or one that is neither a report nor a board entry, groups nothing: the report is shown under no parent. A report shown under no parent still heads the thread of the reports that name it. A report has no parent when the field is absent, `null`, not a string (a number, a list, an object) or empty once trimmed (of White_Space, as the room profile trims); one that no report names is then a thread of one. The trim decides only that: a parent with anything left after it is read as written, so an id with a space at either end is not the id without them. A reader given one id twice keeps the first copy it is given and reads nothing from a later one; which copy comes first is the caller's business (for a folder, the folder spec's order). A reader reads the parent it is served: where a platform serves none for a parent the reader may not see, the report reads as one with no parent. A reader never guesses a thread from names, days or the words of a `description`. A thread takes nothing away from where a report hangs: a report whose parent is a report still hangs on what its `relations` and `events` name (the work item of its talk, the sitting), and a reader shows it there and in its thread, both. In `parent_narrative` only a board entry is a talk's anchor; a report there never is. +9. **Threads.** A reader that groups reports groups them by `parent_narrative`, read as written (a parent names the report whose `id` is written exactly as it is: the address profile's "The same id"). Where the parent is a report (the pair and the mark), the group is that report's thread: the parent first, then the reports that name it, ordered by `created_at` as the message profile orders messages (read in the one form the message profile gives, as an instant, a time with no offset as UTC; two at the same instant keep the order of the list the reader was given; one whose `created_at` cannot be read as a date and time comes after every one that can, in the list's order). Only that order is the message profile's: a message's thread is walked up through its parents, and a report's never is. Where the parent is a board entry (the room profile's pair `narrative` + `Board`, and the mark), the group is the reports of the talks under that entry, in the same order. Only reports are grouped: a Narrative that is no report (a message that answers one) may name a report as its parent, and is no part of its thread. A report that names itself is read as naming no parent, with a lint. A reader never walks further up: a report whose parent is a report that itself has a report for its parent (one the reader holds, the pair and the mark, its own parent read by this rule) is shown under the parent it names, and reported by a lint, never repaired. Reports that name each other in a ring have no first: each is in the group of the one it names, each is linted as such a chain, and none of them, nor any report under them, is reached by starting from first reports. A parent whose id the reader holds and whose element it does not (a folder or an export without it, an id that dangles), or one that is neither a report nor a board entry, groups nothing: the report is shown under no parent. A report shown under no parent still heads the thread of the reports that name it. A report has no parent when the field is absent, `null`, not a string (a number, a list, an object) or empty once trimmed (of White_Space, as the room profile trims); one that no report names is then a thread of one. The trim decides only that: a parent with anything left after it is read as written, so an id with a space at either end is not the id without them. A reader given one id twice keeps the first copy it is given and reads nothing from a later one; which copy comes first is the caller's business (for a folder, the folder spec's order). A reader reads the parent it is served: where a platform serves none for a parent the reader may not see, the report reads as one with no parent. A reader never guesses a thread from names, days or the words of a `description`. A thread takes nothing away from where a report hangs: a report whose parent is a report still hangs on what its `relations`, `events`, `objects` and `constructs` name (the work item of its talk, the sitting, each Object or Construct whose talk it is shown with), and a reader shows it there and in its thread, both. In `parent_narrative` only a board entry is a talk's anchor; a report there never is. 10. **Lines.** A reader that reads `consequences` line by line, to follow a line's address or to show a line with its address taken out, reads it in three parts, and every such reader finds the same lines, the same address and the same words in the same text. Each part reads the text alone, never the world; the fixture's second file (below) holds them. - **1. A line.** The text is split at every carriage return and every line feed, as the lens profile's `first_line` splits a description: a carriage return then a line feed leave an empty piece between them, which is no line, a carriage return alone is a break, and nothing else breaks a line (U+000B, U+000C, U+2028, U+2029 and U+0085 stay inside it). Each piece is trimmed of White_Space at both ends (the room profile's set), and a piece with nothing left is no line. U+0085 is White_Space and is trimmed at a line's ends; a byte order mark, U+FEFF, is not, and stays where it stands: a line of one alone is a line, one character long. - **2. The line's address.** The line's address is the last address in the line, found as rule 8 finds one, that names an element of this world: an `ow://` address or a site address, canonical or not, whose world is this world's id or is left out, with a type word and an id. Any other address is prose and stays in the words: one of another world, one whose world is a slug (its text alone cannot say it is this world), a world's own address, a lens's address with no element. A line whose only addresses are those has no address (rule 8: never a fault), and one of them after the line's address never takes its place. Whether an address names an element of this world is read from its text, never by a read of the world: a well-formed address of an element that no longer exists is still the line's address, and a reader that follows it shows what it finds, "private or missing" as the address profile's convention for a field says. @@ -72,7 +75,7 @@ A report of a talk that hangs on a board entry keeps the entry in `parent_narrat **What a writer must do.** - Write the pair and the mark together, as the room profile asks of every room element; never the mark on a lore Narrative. - When the keeper reports its own session, write the report once, born `completed`: `story`, `description`, the links and `consequences` in the same write, never a `handed in` state first; and set `done`, once the work exists, exactly the work items `x_report_answers` names that are still `open` or `taken`. -- At step 1, write `story` whole and never change it afterwards; `narrator` is the writing seat's own Character. A hand-in never fails because the writer could not change a work item it answers: the report is written, and the keeper sets the work item `done` in step 2. +- At step 1, write `story` whole and never change it afterwards; `narrator` is the writing seat's own Character. A hand-in never fails because the writer could not change a work item it answers: the report is written, and the keeper sets the work item `done` in step 2 when it is still `open` or `taken`. - A report that continues earlier work names the first report of that work in `parent_narrative`, found from the report it continues (that report's own parent when it is a report the writer can read, otherwise that report), never a later one, and leaves the first as it is; a closed talk's report on a board entry keeps the entry there and says what it continues in `story`, with that report's address; the keeper carries that into `description` at step 2 (in both, when the keeper reports its own session in one write). - At step 2, write `consequences` with or before `subtype` `completed`, one line per change, the element named in words before its address; or, the writer's choice, the same change made to many elements at once as one line naming the kind of element, the count and the change, with no address, which may name the lens or the search that finds them, every one of those elements still linked, each in the Narrative's multi-link field for its type (`characters`, `objects`, `locations` and the rest the typed-links row names), never in `parent_narrative`, `narrator` or another single link; a Narrative, a Map, a Pin or a Marker among them is named by the line's kind and count alone and is never linked; `nothing changed` when nothing was. - Keep the mark and `x_report_answers` byte for byte when they are not yours to change, like every extension field; never write `x_report_answers` as an empty list, and put each id in it in `relations` too. @@ -111,8 +114,8 @@ Step 2, completed: the keeper wrote the Steinway's description, set the work ite } ``` -**The fixture.** `report.fixture.json`, beside this page, holds the cases of rule 9 every reader of threads must agree on: each case is the Narratives as one reader is given them, in the order given, and a `want` of three parts, in which only reports appear (a message among the Narratives is in no part of it). `parents`: for each report, what its parent is (`none`, `report`, `board`, `missing`, `other` or `self`). `groups`: each `{parent, kind, reports}`, where `reports` holds the reports that name the parent, in rule 9's order, the parent itself left out (a reader shows it first); a report in no group and heading none is in no list. `lints`: each `{kind, report}`, and the only kinds are `chain` and `self`: a parent that is missing or of no kind is no lint. `groups` and `lints` each compare as a set. The cases cover: two later reports given out of `created_at` order, their times with an offset and a fraction of a second; two with the same `created_at`; a `created_at` that is absent, `null`, a word or a date with no time; two closed talks' reports under one board entry; a closed talk's report on a board entry whose `description` says it continues a report; a chain as written; a report that names a report that names itself, one that names a report whose parent is not held, and one that names a report whose parent is a Report without the mark; a first report that hangs on a board entry; a report that names itself; a parent whose element is not held; a parent with supertype `Report` and one with supertype `Board`, neither with the mark; a report with no parent, and ones whose parent is empty or only spaces; a message that names the first report beside a report that does; a second report on a work item, in its thread and still under its work item; a Narrative with supertype `Report` and no mark that names the first report beside a report that does, as a list by the first report's id may hold them; parents that are a number, a list and an object; a parent that is a held report's id with a space at each end; a `created_at` with no offset between two with one; one report given twice, naming a different parent each time; two reports that name each other in a ring, with a third that names one of them; a parent that is a held report's id in upper case; and one id held in two spellings, lowercase and upper case. `report-lines.fixture.json`, beside it, holds the cases of rule 10 every reader of lines must agree on, read in the world its `world` names: `cases`, each one line read by parts 2 and 3 exactly as it stands, with no trim: part 1 trims the lines of a text, never a case (the case that opens with two spaces tests that), with its `address` (the element the line's address names, written `ow:///` with the id in lowercase, or `null` for none) and its `words`, the words shown; and `texts`, each a whole value of `consequences` with the `lines` it splits into, each with its `line`, `address` and `words`. A reader agrees with it when every case gives the same address or none and the same words, and every text splits into the same lines, in order, with the same address and words, each compared exactly, character for character; `kind` names what a case is about and is never compared (its numbers are rule 10's parts), and the head's `status` and `about` are notes, never compared. The rest of the page has no cases. +**The fixture.** `report.fixture.json`, beside this page, holds the cases of rule 9 every reader of threads must agree on: each case is the Narratives as one reader is given them, in the order given, and a `want` of three parts, in which only reports appear (a message among the Narratives is in no part of it). `parents`: for each report, what its parent is (`none`, `report`, `board`, `missing`, `other` or `self`). `groups`: each `{parent, kind, reports}`, where `reports` holds the reports that name the parent, in rule 9's order, the parent itself left out (a reader shows it first); a report in no group and heading none is in no list. `lints`: each `{kind, report}`, and the only kinds are `chain` and `self`: a parent that is missing or of no kind is no lint. `groups` and `lints` each compare as a set. The cases cover: two later reports given out of `created_at` order, their times with an offset and a fraction of a second; two with the same `created_at`; a `created_at` that is absent, `null`, a word or a date with no time; two closed talks' reports under one board entry; a closed talk's report on a board entry whose `description` says it continues a report; a chain as written; a report that names a report that names itself, one that names a report whose parent is not held, and one that names a report whose parent is a Report without the mark; a first report that hangs on a board entry; a report that names itself; a parent whose element is not held; a parent with supertype `Report` and one with supertype `Board`, neither with the mark; a report with no parent, and ones whose parent is empty or only spaces; a message that names the first report beside a report that does; a second report on a work item, in its thread and still under its work item; a Narrative with supertype `Report` and no mark that names the first report beside a report that does, as a list by the first report's id may hold them; parents that are a number, a list and an object; a parent that is a held report's id with a space at each end; a `created_at` with no offset between two with one; one report given twice, naming a different parent each time; two reports that name each other in a ring, with a third that names one of them; a parent that is a held report's id in upper case; and one id held in two spellings, lowercase and upper case. `report-lines.fixture.json`, beside it, holds the cases of rule 10 every reader of lines must agree on, read in the world its `world` names: `cases`, each one line read by parts 2 and 3 exactly as it stands, with no trim: part 1 trims the lines of a text, never a case (the case that opens with two spaces tests that), with its `address` (the element the line's address names, written `ow:///` with the id in lowercase, or `null` for none) and its `words`, the words shown; and `texts`, each a whole value of `consequences` with the `lines` it splits into, each with its `line`, `address` and `words`. A reader agrees with it when every case gives the same address or none and the same words, and every text splits into the same lines, in order, with the same address and words, each compared exactly, character for character; `kind` names what a case is about and is never compared (its numbers are rule 10's parts), and the head's `status` and `about` are notes, never compared. `report.fixture.json` holds a second list, `talk_cases`, the talks on an element a reader shows a report with (none of them named as the one it closed): each case one Narrative and its `talks`, none when it is no report, every `{type, id}` its `objects` (`object`) and `constructs` (`construct`) name, compared as a set; the cases cover a report that links an Object and one that links a Construct, each with no `events`; a Narrative with supertype `Report` and no mark that links an Object, which is no report and is shown with no talk, a report whose `objects` hold a number and an empty string beside an id, shown with the one talk, a line in the room (the pair `narrative` + `Message`, with the mark) that links an Object, which is no report, so a reader of reports shows it with no talk, and a report whose `objects` hold White_Space alone, an id in upper case and an id with a space after it, shown with a talk on each of the two ids as written. The rest of the page has no cases. **Among the readers today**: `reportThreadsOf` in `@onlyworlds/sdk` (since 4.158.0) and `report_threads_of` in the `onlyworlds` Python package (since 0.120.0); the first is described at https://onlyworlds.github.io/docs/development/typescript-readers#report-threads; and the readers of lines (rule 10), `readReportLine` and `readReportLines` in `@onlyworlds/sdk` (since 4.169.0) and `read_report_line` and `read_report_lines` in the `onlyworlds` Python package (since 0.128.0), the first two described at https://onlyworlds.github.io/docs/development/typescript-readers#report-lines -**Ruled**: 2026-11-10, serial 112: the page, and the pair `narrative` + `Report` added to the room profile's table. 2026-11-10, serial 114: the same change made to many elements at once may be one line in `consequences`, the kind, the count and the change, without addresses, the writer's choice; the elements stay linked, and a reader never expects an address on every line. 2026-11-11, serial 115: the keeper's own report is one write, born `completed`; the reporter is the seat the platform says wrote the report, where it says so (`created_by` on onlyworlds.com), and the `narrator`'s Character where no `created_by` is served. 2026-11-12, serial 120: a report that continues earlier work names the first report of that work as its `parent_narrative`, and a reader tells a thread from a closed talk by the parent's kind (rule 9); the page's first fixture, its threads. 2026-11-13, serial 121, from what the readers of serial 120 found the page silent on: a parent that is no string is no parent, and one with anything left after the trim is read as written; a time with no offset is UTC; one id given twice keeps the first; reports that name each other in a ring are each grouped and linted, and are not reached from first reports; the list by a first report's id is read by rule 9; a report is written when a stretch of work is worth telling; a closed talk's report says what it continues in `story`; seven more cases in the fixture. 2026-11-13, serial 122: a parent names the report whose `id` is written exactly as it is; when a report was written is its `created_at`, and a `start_date` on it is a date in the world's own time; two readers of threads that have shipped are named; a keeper that reports its own session in one write says in `description` too what a closed talk's report continues and the window of time it covers; two more cases in the fixture. 2026-11-13, serial 123: the sitting a free talk's report links in `events` is an Event with the room profile's pair `event` + `Sitting`, and an address in a line of `consequences` is found as the address profile reads an address in prose, a full stop after it the line's. 2026-11-14, serial 129: a line of `consequences` reads the same in every reader (rule 10): where the text breaks into lines and how a line is trimmed, which address is the line's when several stand in it, and which words are shown with it taken out; the page's second fixture, its lines. +**Ruled**: 2026-11-10, serial 112: the page, and the pair `narrative` + `Report` added to the room profile's table. 2026-11-10, serial 114: the same change made to many elements at once may be one line in `consequences`, the kind, the count and the change, without addresses, the writer's choice; the elements stay linked, and a reader never expects an address on every line. 2026-11-11, serial 115: the keeper's own report is one write, born `completed`; the reporter is the seat the platform says wrote the report, where it says so (`created_by` on onlyworlds.com), and the `narrator`'s Character where no `created_by` is served. 2026-11-12, serial 120: a report that continues earlier work names the first report of that work as its `parent_narrative`, and a reader tells a thread from a closed talk by the parent's kind (rule 9); the page's first fixture, its threads. 2026-11-13, serial 121, from what the readers of serial 120 found the page silent on: a parent that is no string is no parent, and one with anything left after the trim is read as written; a time with no offset is UTC; one id given twice keeps the first; reports that name each other in a ring are each grouped and linted, and are not reached from first reports; the list by a first report's id is read by rule 9; a report is written when a stretch of work is worth telling; a closed talk's report says what it continues in `story`; seven more cases in the fixture. 2026-11-13, serial 122: a parent names the report whose `id` is written exactly as it is; when a report was written is its `created_at`, and a `start_date` on it is a date in the world's own time; two readers of threads that have shipped are named; a keeper that reports its own session in one write says in `description` too what a closed talk's report continues and the window of time it covers; two more cases in the fixture. 2026-11-13, serial 123: the sitting a free talk's report links in `events` is an Event with the room profile's pair `event` + `Sitting`, and an address in a line of `consequences` is found as the address profile reads an address in prose, a full stop after it the line's. 2026-11-14, serial 129: a line of `consequences` reads the same in every reader (rule 10): where the text breaks into lines and how a line is trimmed, which address is the line's when several stand in it, and which words are shown with it taken out; the page's second fixture, its lines. 2026-11-18, serial 135: a talk may hang on an Object or a Construct, the closed talk's table's fourth row, its report linking the element in `objects` or `constructs` with no sitting needed in `events`, whether or not the world marks design parts; a reader shows a report with the talk on each Object or Construct it links, old reports included, since those fields hold what a report touched or changed, and from the report alone no reader can tell which of them, if any, was the talk it closed, so the page names none; a line may hang on one of the four, on more than one, or on none, and a report in a thread still hangs on the elements it links; a report's `objects` and `constructs` are read entry by entry as the room profile reads a line's; six cases in the fixture's new list, `talk_cases`, the third a Report without the mark, shown with no talk, the fourth a report whose `objects` hold a number and an empty string beside an id, shown with the one talk, the fifth a marked Message, no report and shown with no talk, the sixth a report whose ids in upper case and with a space after them are read as written; the typed link that carries a closed talk's anchor (`objects`, `constructs` or `events`) may be written at step 1 as well as step 2, so a closed talk's report may link its anchor when it is handed in, as step 1 says. 2026-11-18, serial 136: the reporter sets `done` only on a work item that is still `open` or `taken`, as the keeper does, so a `standing` work item (the packet profile's fourth state) is never set `done` by a report, and the writer's line for step 1 says the same of the keeper; no fixture change. diff --git a/codegen/schema-dist/profiles/room.fixture.json b/codegen/schema-dist/profiles/room.fixture.json index 3348c70..ef6fc34 100644 --- a/codegen/schema-dist/profiles/room.fixture.json +++ b/codegen/schema-dist/profiles/room.fixture.json @@ -5,7 +5,8 @@ "pairs: the ten type-and-supertype pairs a reader matches, each trimmed and compared without regard to case. The order is the table's and carries no meaning: a reader matches a pair and may keep them as a set. A serial never reorders the pairs that exist; a new pair goes where the page's table puts it, and the release notes name its place; so a suite that pins the order turns red only when a pair is added.", "mark: x_room_of, the id of the world or the sitting the room belongs to; a room element carries it, a lore element never does.", "item: x_room_item, written only on a Take, the id of the work item the take is on; it makes nothing a room element, the pair and the mark do.", - "cases: element gives type, supertype and x_room_of as a body might carry them, or is a value that is not an object (null, a list, a string), which is no room element; in_room is what isRoomElement must answer: the pair AND the mark. A case's note, where one is given, is prose for the reader of the fixture, never an input." + "cases: element gives type, supertype and x_room_of as a body might carry them, or is a value that is not an object (null, a list, a string), which is no room element; in_room is what isRoomElement must answer: the pair AND the mark. A case's note, where one is given, is prose for the reader of the fixture, never an input.", + "talk_cases: each element is a Narrative as a body carries it, with its links; only a line in the room (the pair narrative + Message and the mark) is in a talk on an element, so any other element (a Message without the mark, a board entry) is in none; talks is every talk on an element the line is in, each {type, id}: an id in objects as object, an id in constructs as construct, read from the line alone, compared as a set; an entry that is not a string, or is empty once trimmed of White_Space (the room profile's set), names no element, a field that is not a list names none, and every other entry is an id read as written, a space left on it included, never folded to lowercase. No other field puts a line in a talk on an element: characters are its recipients, and a work item it hangs on (the report profile's anchor) is no talk on an element." ], "pairs": [ { @@ -476,5 +477,245 @@ "mark": { "field": "x_room_of", "value": "the world id (a world's parlor) or the sitting's id (a workshop); a sitting's own mark holds the world's id" - } + }, + "talk_cases": [ + { + "name": "a-line-naming-an-object-is-in-its-talk", + "element": { + "id": "019a8b00-0000-7000-8000-000000000101", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": [ + "019a8b00-0000-7000-8000-000000000201" + ] + }, + "talks": [ + { + "type": "object", + "id": "019a8b00-0000-7000-8000-000000000201" + } + ] + }, + { + "name": "a-line-naming-a-construct-is-in-its-talk", + "element": { + "id": "019a8b00-0000-7000-8000-000000000102", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "constructs": [ + "019a8b00-0000-7000-8000-000000000211" + ] + }, + "talks": [ + { + "type": "construct", + "id": "019a8b00-0000-7000-8000-000000000211" + } + ] + }, + { + "name": "a-line-naming-two-elements-is-in-both-talks", + "element": { + "id": "019a8b00-0000-7000-8000-000000000103", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": [ + "019a8b00-0000-7000-8000-000000000202" + ], + "constructs": [ + "019a8b00-0000-7000-8000-000000000211" + ] + }, + "talks": [ + { + "type": "object", + "id": "019a8b00-0000-7000-8000-000000000202" + }, + { + "type": "construct", + "id": "019a8b00-0000-7000-8000-000000000211" + } + ] + }, + { + "name": "a-line-beside-a-work-item-is-still-in-the-talk-on-the-object-it-names", + "note": "Its relations names a work item. Whatever field a tool reads as the work item a line hangs on, the line is in the talk on the Object as well, and the work item is no talk on an element.", + "element": { + "id": "019a8b00-0000-7000-8000-000000000104", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": [ + "019a8b00-0000-7000-8000-000000000201" + ], + "relations": [ + "019a8b00-0000-7000-8000-000000000221" + ] + }, + "talks": [ + { + "type": "object", + "id": "019a8b00-0000-7000-8000-000000000201" + } + ] + }, + { + "name": "a-line-whose-characters-name-a-character-is-in-no-talk-on-an-element", + "note": "A line's characters are its recipients (the message profile), never what it is about.", + "element": { + "id": "019a8b00-0000-7000-8000-000000000105", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "characters": [ + "019a8b00-0000-7000-8000-000000000231" + ] + }, + "talks": [] + }, + { + "name": "a-message-without-the-mark-naming-an-object-is-in-no-talk", + "note": "A Message without the room's mark is lore, not a line in the room.", + "element": { + "id": "019a8b00-0000-7000-8000-000000000106", + "type": "narrative", + "supertype": "Message", + "objects": [ + "019a8b00-0000-7000-8000-000000000201" + ] + }, + "talks": [] + }, + { + "name": "a-board-entry-naming-an-object-is-in-no-talk", + "note": "A board entry (the pair narrative + Board, with the mark) is a room element but no line.", + "element": { + "id": "019a8b00-0000-7000-8000-000000000107", + "type": "narrative", + "supertype": "Board", + "subtype": "green", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": [ + "019a8b00-0000-7000-8000-000000000201" + ] + }, + "talks": [] + }, + { + "name": "a-line-naming-a-location-and-an-event-only-is-in-no-talk-on-an-element", + "note": "Only objects and constructs put a line in a talk on an element; no other link of a line does.", + "element": { + "id": "019a8b00-0000-7000-8000-000000000108", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "locations": [ + "019a8b00-0000-7000-8000-000000000241" + ], + "events": [ + "019a8b00-0000-7000-8000-000000000251" + ] + }, + "talks": [] + }, + { + "name": "entries-that-are-no-string-or-empty-name-no-element", + "note": "objects holds the empty string, null and a number beside one id: only the id names an element.", + "element": { + "id": "019a8b00-0000-7000-8000-000000000109", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": [ + "", + null, + 7, + "019a8b00-0000-7000-8000-000000000201" + ] + }, + "talks": [ + { + "type": "object", + "id": "019a8b00-0000-7000-8000-000000000201" + } + ] + }, + { + "name": "a-field-that-is-no-list-names-no-element", + "note": "objects is a string holding an id, not a list, so it names none; constructs is an object.", + "element": { + "id": "019a8b00-0000-7000-8000-00000000010a", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": "019a8b00-0000-7000-8000-000000000201", + "constructs": { + "id": "019a8b00-0000-7000-8000-000000000211" + } + }, + "talks": [] + }, + { + "name": "ids-are-read-as-written-so-two-spellings-are-two-talks", + "note": "The same id in lowercase and in upper case: read as written, they are two values, and the line is in a talk on each as written.", + "element": { + "id": "019a8b00-0000-7000-8000-00000000010b", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": [ + "019a8b00-0000-7000-8000-00000000020a", + "019A8B00-0000-7000-8000-00000000020A" + ] + }, + "talks": [ + { + "type": "object", + "id": "019a8b00-0000-7000-8000-00000000020a" + }, + { + "type": "object", + "id": "019A8B00-0000-7000-8000-00000000020A" + } + ] + }, + { + "name": "white-space-alone-names-no-element-and-a-space-left-on-an-id-is-read-as-written", + "note": "objects holds three spaces and a tab, which are empty once trimmed and name nothing, and an id with a space after it, which is read as written: a different id from the same letters without the space.", + "element": { + "id": "019a8b00-0000-7000-8000-00000000010c", + "type": "narrative", + "supertype": "Message", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": [ + " \t", + "019a8b00-0000-7000-8000-000000000201 " + ] + }, + "talks": [ + { + "type": "object", + "id": "019a8b00-0000-7000-8000-000000000201 " + } + ] + }, + { + "name": "a-marked-report-naming-an-object-is-no-line-and-in-no-talk", + "note": "A report (the pair narrative + Report, with the mark) is a room element but no line: only the pair narrative + Message is.", + "element": { + "id": "019a8b00-0000-7000-8000-00000000010d", + "type": "narrative", + "supertype": "Report", + "subtype": "completed", + "x_room_of": "0199c3a1-7b2e-7c3d-8e4f-5a6b7c8d9e0f", + "objects": [ + "019a8b00-0000-7000-8000-000000000201" + ] + }, + "talks": [] + } + ] } diff --git a/codegen/schema-dist/profiles/room.md b/codegen/schema-dist/profiles/room.md index 1e8463d..9bfc26c 100644 --- a/codegen/schema-dist/profiles/room.md +++ b/codegen/schema-dist/profiles/room.md @@ -21,6 +21,8 @@ A sitting's winning spec is named on the sitting: its `x_star` holds the spec's id. The parlor writes it on the sitting when the host picks; any other writer of a sitting keeps it byte for byte like every extension field (§3.3), and a re-key that moves the spec's id moves it (A re-key, below). +**A talk on an Object or a Construct.** A line in the room (a room element with the pair `narrative` + `Message`) that names an Object in its `objects` or a Construct in its `constructs` is in the talk on that element, and the talk on an element is every such line, whichever sitting it was said in. A line is in the talk of each element it names there, read from the line alone: each id in `objects` is an Object's, each id in `constructs` a Construct's. An entry that is not a string, or is empty once trimmed (of White_Space, the set defined above), names no element, and a field that is not a list names none; every other entry is an id read as written, a space left on it included (the address profile's "The same id", as the report profile's rule 9 reads a parent), so a line that names `ABC` is not in the talk on `abc`, and one that names an id with a space after it is not in the talk on the id without it. A line in a talk on an element may also hang on a board entry or a work item (what a talk hangs on is the report profile's, `profiles/report.md`), and it is then in both. Only these two fields make a talk on an element, on purpose: a line's `characters` are its recipients (the message profile), never what it is about, so no talk is read from them, and no other link of a line puts it in a talk on an element; another type joins only by a later serial. Which lines are in a talk is this page's; how a tool orders, groups or labels them is the tool's own. + **Not in the room, on purpose.** The charter (`law`, supertype `Charter`), its guide (`construct`, supertype `Guide`) and its domains (`construct`, supertype `Domain`) are a reading aid, not a room element and not lore: a lore view leaves them out by default and every tool's front door shows them first; a lens keeps one only when its `types` names the pair (`law/charter`, `construct/guide`, `construct/domain`) or an anchor is one (the lens profile's rule 4). Each is matched by its pair, trimmed and folded as below, and its mark `x_charter_of`, the id of the world the aid belongs to, the way a room element carries `x_room_of`; the pair without the mark is lore and stays in every view (a kingdom's Charter in a novel's world is a Law like any other). An element whose supertype only resembles one of these (a Narrative with supertype `Messages`, a Relation with supertype `Work`) is not a room element; the match is the whole word. An element with the mark but none of the pairs is not a room element either (a reader reports it as a malformed mark, never hides it). **The rule for readers.** @@ -35,6 +37,6 @@ A sitting's winning spec is named on the sitting: its `x_star` holds the spec's **A re-key** (folder format §3.3: "When a tool deliberately replaces an element's id (§3.4, re-key), a foreign value that IS that old id (the whole string, or a whole item of a string list) MAY be rewritten to the new id, at any depth; nothing else in the value may change (no reorder, no re-indent, no other byte)."): the room's ids follow that rule. A re-key that moves a sitting's or a work item's id moves the `x_room_of` or `x_room_item` that holds it, a re-key that moves a spec's id moves the sitting's `x_star` that holds it, and a value holding an id the re-key did not move (a world's id among them) is unchanged. -**Where the list is read from.** The SDK exports the list and `isRoomElement(element)`; the Python package the same in snake case. A tool with its own copy of the ten pairs replaces it with the SDK's the release after the SDK carries them (Atlas `src/core/parlor-room.ts` and Lantern `src/room.ts` were the first two copies, 2026-10-22). The conformance fixture beside this page, `room.fixture.json`, holds the cases a reader's matcher must agree on. +**Where the list is read from.** The SDK exports the list and `isRoomElement(element)`; the Python package the same in snake case. A tool with its own copy of the ten pairs replaces it with the SDK's the release after the SDK carries them (Atlas `src/core/parlor-room.ts` and Lantern `src/room.ts` were the first two copies, 2026-10-22). The conformance fixture beside this page, `room.fixture.json`, holds the cases a reader's matcher must agree on, and in its `talk_cases`, of any element, the talks on an element it is in as a line (none when it is no line), each `{type, id}`, `object` for an id in `objects` and `construct` for one in `constructs`, compared as a set. -**Ruled**: Skeld, 2026-10-22, serial 44; the mark added the same hour in serial 45 after keel's sweep found the collision (a lore world's own Message, Vote, Sitting or Charter) (an ask from the parlor's sweep; the character/member pair the maintainer's ruling), relation/Take added 2026-10-25, serial 66 (the parlor's work items); the charter, its guide and its domains named a reading aid 2026-10-27, serial 82 (the charter was lore before); the mark's presence rule written down 2026-10-28, serial 83, the same for `x_charter_of`; the re-key line Skeld, 2026-10-28, serial 84; narrative/Report added 2026-11-10, serial 112 (the report profile); a sitting's own mark holds the world's id, and a sitting's winning spec is named in its `x_star`, written down 2026-11-11, serial 118; an empty list or an empty object is no mark, as the review profile reads one, so an element reads the same in its full and its compact form, written down 2026-11-14, serial 126, the same for `x_charter_of`; three cases more in this page's fixture, an empty list and an empty object that are no mark and `false`, which is a mark; 2026-11-14, serial 127: a re-key that moves a spec's id moves the sitting's `x_star` that holds it, as it moves `x_room_of` and `x_room_item`, and the parlor writes `x_star` when the host picks while any other writer of a sitting keeps it byte for byte, a re-key apart; 2026-11-15, serial 131: without regard to case is simple case folding by the C and S rows of CaseFolding.txt at Unicode 15.1, the table the schema distribution carries, never a language's lower-casing and never full folding, and the parenthesis that named two languages' functions as that fold goes (neither is simple folding: lower-casing parts from it on `MEſſAGE`, full folding on `Meßage`), and never a language's own folding; a value that is not an object is no room element, read as false without failing; ten cases more in this page's fixture: the long s that folds, the sharp s that does not, the Kelvin sign that folds to k, the dotless i and the dotted capital I that do not fold, a type whose `st` is the ligature U+FB06 (no pair: only full folding takes it to st), a pair's word padded at both ends with every White_Space code point, and three values that are no object (`null`, a list that holds a marked room element, and the string `Message`). +**Ruled**: Skeld, 2026-10-22, serial 44; the mark added the same hour in serial 45 after keel's sweep found the collision (a lore world's own Message, Vote, Sitting or Charter) (an ask from the parlor's sweep; the character/member pair the maintainer's ruling), relation/Take added 2026-10-25, serial 66 (the parlor's work items); the charter, its guide and its domains named a reading aid 2026-10-27, serial 82 (the charter was lore before); the mark's presence rule written down 2026-10-28, serial 83, the same for `x_charter_of`; the re-key line Skeld, 2026-10-28, serial 84; narrative/Report added 2026-11-10, serial 112 (the report profile); a sitting's own mark holds the world's id, and a sitting's winning spec is named in its `x_star`, written down 2026-11-11, serial 118; an empty list or an empty object is no mark, as the review profile reads one, so an element reads the same in its full and its compact form, written down 2026-11-14, serial 126, the same for `x_charter_of`; three cases more in this page's fixture, an empty list and an empty object that are no mark and `false`, which is a mark; 2026-11-14, serial 127: a re-key that moves a spec's id moves the sitting's `x_star` that holds it, as it moves `x_room_of` and `x_room_item`, and the parlor writes `x_star` when the host picks while any other writer of a sitting keeps it byte for byte, a re-key apart; 2026-11-15, serial 131: without regard to case is simple case folding by the C and S rows of CaseFolding.txt at Unicode 15.1, the table the schema distribution carries, never a language's lower-casing and never full folding, and the parenthesis that named two languages' functions as that fold goes (neither is simple folding: lower-casing parts from it on `MEſſAGE`, full folding on `Meßage`), and never a language's own folding; a value that is not an object is no room element, read as false without failing; ten cases more in this page's fixture: the long s that folds, the sharp s that does not, the Kelvin sign that folds to k, the dotless i and the dotted capital I that do not fold, a type whose `st` is the ligature U+FB06 (no pair: only full folding takes it to st), a pair's word padded at both ends with every White_Space code point, and three values that are no object (`null`, a list that holds a marked room element, and the string `Message`); 2026-11-18, serial 135: a line that names an Object in its `objects` or a Construct in its `constructs` is in the talk on that element, in every sitting, and in the talk of each one it names, beside any board entry or work item it hangs on; only those two fields make such a talk, since a line's `characters` are its recipients; an entry that is not a string, or is empty once trimmed of White_Space, names no element, a field that is not a list names none, and every other entry is an id read as written, a space left on it included, as the address profile's "The same id" has it and as the report profile's rule 9 reads a parent; thirteen cases in the fixture's new list, `talk_cases`: a line naming an Object, one naming a Construct, one naming both, one naming an Object beside a work item in its `relations`, one whose `characters` name a Character and nothing else, one naming a Location and an Event only, three elements that are no line, a Message without the mark, a board entry and a report, each naming an Object and in no talk, one whose `objects` hold the empty string, `null` and a number beside an id, one whose `objects` is a string and whose `constructs` is an object, one naming the same id in lowercase and in upper case, two talks as written, and one whose `objects` hold White_Space alone, which names nothing, beside an id with a space after it, read as written. diff --git a/codegen/schema-pin.json b/codegen/schema-pin.json index d568eba..bcc4b38 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.134", - "commit": "700f04b6a99d5631e5e2b01072359d110282ad67", - "manifest_sha256": "199b4c9af2fcccaeeaa6ed2a27e41e76cb7dd2e491cdbd367741011982fdf174", + "tag": "v0.34.1-dist.136", + "commit": "56f5c029f6f485a9c448a5c112cfbdee669d03e6", + "manifest_sha256": "9a1f31d1135a17ffa0facca587ba354a90821bdb28dc46a4a7335cbfe7acfa91", "canonical_version": "00.34.01", - "dist_serial": 134, - "published": "2026-11-17", - "pinned_at": "2026-11-17", - "pinned_by": "The maintainer: tree from `git archive` of the tag in a schema-dist checkout (213 files: the 212 the MANIFEST lists, and MANIFEST.json itself); files re-hashed against MANIFEST.json by verify_dist.py; MANIFEST self-hash matched against the raw file GitHub serves at the tag, whose ref resolves to the commit above.", + "dist_serial": 136, + "published": "2026-11-19", + "pinned_at": "2026-11-19", + "pinned_by": "The maintainer: tree from `git archive` of the tag in a schema-dist checkout (214 files: the 213 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.134", + "manifest_sha256": "199b4c9af2fcccaeeaa6ed2a27e41e76cb7dd2e491cdbd367741011982fdf174", + "note": "superseded by v0.34.1-dist.136 (serials 135 and 136: room, report and charter talk and design lists, the packet fixture)" + }, { "tag": "v0.34.1-dist.133", "manifest_sha256": "b0fe3a48684d2e90261f74b5c5b2382689e071a0af1709f359a174d45cc5324a", diff --git a/src/onlyworlds/__init__.py b/src/onlyworlds/__init__.py index ab97f07..ef38752 100644 --- a/src/onlyworlds/__init__.py +++ b/src/onlyworlds/__init__.py @@ -39,9 +39,12 @@ CharterHub, CharterPacket, CharterRead, + DesignPart, + DesignState, DomainRead, GuideRead, charter_of, + design_parts_of, domains_of, ) from .checks import CHECKS_FIELD, CheckRow, apply_checks @@ -136,10 +139,11 @@ ReportThreads, read_report_line, read_report_lines, + report_talks_of, report_threads_of, ) from .review import PROPOSED_MARK, ProposedMark, hands_on_as_proposed, proposed_mark_of -from .room import is_charter_element, is_room_element, reading_aid_of +from .room import Talk, is_charter_element, is_room_element, reading_aid_of, talks_of from .spine import SPINE_KINDS, SpineRead, read_spine_element from .strand import STRAND_FIELD, Strand, StrandSlot, strand_of from .worldfile import ( @@ -196,6 +200,8 @@ "CharterRead", "CheckRow", "Client", + "DesignPart", + "DesignState", "DomainRead", "Door", "EditRead", @@ -242,6 +248,7 @@ "StaleProposal", "Strand", "StrandSlot", + "Talk", "Tool", "ToolOpen", "TrailHanger", @@ -264,6 +271,7 @@ "check_kinds", "date_of", "degree_of", + "design_parts_of", "domains_of", "door_where", "doors_of", @@ -312,6 +320,7 @@ "recipients_of", "record_mark_of", "records_of", + "report_talks_of", "report_threads_of", "resolve_filenames", "resolve_lens", @@ -319,6 +328,7 @@ "sender_status", "slugify", "strand_of", + "talks_of", "thread_of", "trail_by_place", "type_word", diff --git a/src/onlyworlds/_schema.py b/src/onlyworlds/_schema.py index e7a4e85..1decf8a 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.134 (700f04b6a99d5631e5e2b01072359d110282ad67) +# Source: https://github.com/OnlyWorlds/schema-dist @ v0.34.1-dist.136 (56f5c029f6f485a9c448a5c112cfbdee669d03e6) """Schema provenance, the 22 element types and their fields, from the pinned schema distribution.""" -SCHEMA_DIST_TAG = "v0.34.1-dist.134" +SCHEMA_DIST_TAG = "v0.34.1-dist.136" SCHEMA_VERSION = "00.34.01" -SCHEMA_DIST_SERIAL = 134 -SCHEMA_MANIFEST_SHA256 = "199b4c9af2fcccaeeaa6ed2a27e41e76cb7dd2e491cdbd367741011982fdf174" +SCHEMA_DIST_SERIAL = 136 +SCHEMA_MANIFEST_SHA256 = "9a1f31d1135a17ffa0facca587ba354a90821bdb28dc46a4a7335cbfe7acfa91" # Canonical order, as the walk declares it. ELEMENT_TYPES: tuple[str, ...] = ( diff --git a/src/onlyworlds/_version.py b/src/onlyworlds/_version.py index 8b01d4f..8e1ae59 100644 --- a/src/onlyworlds/_version.py +++ b/src/onlyworlds/_version.py @@ -1 +1 @@ -__version__ = "0.134.1" +__version__ = "0.135.0" diff --git a/src/onlyworlds/charter.py b/src/onlyworlds/charter.py index befd09b..0c86617 100644 --- a/src/onlyworlds/charter.py +++ b/src/onlyworlds/charter.py @@ -12,7 +12,8 @@ the lens reader's (``resolve_lens``): the elements as the owner is served them, the ids the hidden mark keeps, and a reader by its rung; the view and each served body are that reader's, never a second copy. The fixture (``codegen/schema-dist/profiles/charter.fixture.json``) is replayed whole by ``tests/test_charter.py``; the npm -SDK's ``charterOf`` and ``domainsOf`` give the same answers on the same input. +SDK's ``charterOf`` and ``domainsOf`` give the same answers on the same input. ``design_parts_of`` (serial 135) +reads the design parts the same reader reads, gated on ``charter_of`` finding a Charter for that reader. """ from __future__ import annotations @@ -20,7 +21,7 @@ import copy import re from collections.abc import Mapping -from typing import Any, Literal, TypedDict +from typing import Any, Literal, TypedDict, cast from ._schema import LINK_TARGETS from .checks import CHECKS_FIELD @@ -33,9 +34,12 @@ "CharterHub", "CharterPacket", "CharterRead", + "DesignPart", + "DesignState", "DomainRead", "GuideRead", "charter_of", + "design_parts_of", "domains_of", ] @@ -181,10 +185,18 @@ def charter_of(world: Mapping[str, Any], reader: Mapping[str, Any]) -> CharterPa then the rest by folded name and then id. A Domain the reader knows only as a stub has its served name and sentence and no hubs; a hidden one is not there. Whether an element is an aid is read from the element as the owner is served it, since a stub serves no mark. The npm SDK's ``charterOf`` gives the same answer.""" + return _packet(world, _reading(world, reader, "charter_of")) + + +def _reading(world: Mapping[str, Any], reader: Mapping[str, Any], fn: str) -> _Reading: if not isinstance(world, Mapping) or not isinstance(world.get("elements"), list): - raise TypeError("charter_of: world is a mapping with an elements list.") - _check_reader(reader, "charter_of: reader") - r = _Reading(world, reader, None) + raise TypeError(f"{fn}: world is a mapping with an elements list.") + _check_reader(reader, f"{fn}: reader") + return _Reading(world, reader, None) + + +def _packet(world: Mapping[str, Any], r: _Reading) -> CharterPacket: + """``charter_of``'s answer from one reading of the world.""" if r.seen_rung == "public" and world.get("open") is not True: return {"charter": None, "guide": None, "domains": []} @@ -230,3 +242,53 @@ def marked(pair: str) -> list[str]: def domains_of(world: Mapping[str, Any], reader: Mapping[str, Any]) -> list[DomainRead]: """The Domains alone, as ``charter_of`` lists them for ``reader``.""" return charter_of(world, reader)["domains"] + + +#: The two design states, as the charter profile writes them (serial 135). +DesignState = Literal["in design", "locked"] + +_DESIGN_STATES: frozenset[str] = frozenset({"in design", "locked"}) +_DESIGN_TYPES: frozenset[str] = frozenset({"object", "construct"}) + + +class DesignPart(TypedDict): + """One design part: an Object or a Construct whose ``subtype`` is a design state. ``type`` is the kind's own word + (``object`` or ``construct``), whatever spelling the element's type is stored in.""" + + type: Literal["object", "construct"] + id: str + state: DesignState + + +def design_parts_of(world: Mapping[str, Any], reader: Mapping[str, Any]) -> list[DesignPart]: + """The design parts ``reader`` reads in ``world`` (schema-dist ``profiles/charter.md``, the design state, serial + 135): each ``{type, id, state}``, in the world's element order (the page orders no parts). + + ``world`` and ``reader`` are ``charter_of``'s. The gate is the Charter: when ``charter_of`` finds a Charter for + this reader (a marked Charter Law, settled, that the reader sees; one the hidden mark keeps from the reader is not + its), every Object or Construct the reader is served whole whose ``subtype``, trimmed and folded as the room + profile defines it, is ``in design`` or ``locked`` is a design part, its state that word whatever the spelling + stored (``In Design `` is ``in design``). No Charter for this reader: ``[]``, whatever the subtypes, even where + another reader of the same world reads parts. A known-of stub has no design state though it is served its + subtype; a hidden or proposed element is read exactly as ``charter_of``'s view reads it. The state alone makes a + part, whatever the supertype: a room element's Spec counts. No other subtype and no other type has a design + state. Pure: nothing is stored or written. The npm SDK's ``designPartsOf`` gives the same answer.""" + r = _reading(world, reader, "design_parts_of") + if _packet(world, r)["charter"] is None: + return [] + parts: list[DesignPart] = [] + for eid in r.order: + kind = r.type_of[eid] + if kind not in _DESIGN_TYPES or eid not in r.view or eid in r.stubs: + continue + subtype = r.body(eid).get("subtype") + state = _fold(subtype) if isinstance(subtype, str) else None + if state in _DESIGN_STATES: + parts.append( + { + "type": cast(Literal["object", "construct"], kind), + "id": eid, + "state": cast(DesignState, state), + } + ) + return parts diff --git a/src/onlyworlds/report.py b/src/onlyworlds/report.py index 0631707..3b499d2 100644 --- a/src/onlyworlds/report.py +++ b/src/onlyworlds/report.py @@ -1,4 +1,5 @@ -"""The report profile (schema-dist ``profiles/report.md``): rule 9, threads of reports (serial 120). +"""The report profile (schema-dist ``profiles/report.md``): rule 9, threads of reports (serial 120), and the talks a +report is shown with (``report_talks_of``, serial 135). A report is what a session, or a closed talk, leaves behind in a world: a Narrative whose type and supertype are the room profile's pair ``narrative`` + ``Report`` AND that carries the room's mark ``x_room_of``, read by presence @@ -30,7 +31,7 @@ from ._schema import ROOM_PAIRS from .address import AddressReading, find_ow_links from .message import _in_created_at_order, _matches -from .room import _WHITE_SPACE, is_room_element +from .room import _WHITE_SPACE, Talk, _named_talks, is_room_element __all__ = [ "ReportGroup", @@ -40,6 +41,7 @@ "ReportThreads", "read_report_line", "read_report_lines", + "report_talks_of", "report_threads_of", ] @@ -185,6 +187,23 @@ def parent_kind(report: Mapping[str, Any]) -> ReportParent: return {"parents": parents, "groups": groups, "lints": lints} +def report_talks_of(narrative: Mapping[str, Any]) -> list[Talk]: + """The talks on an element a reader shows a report with (the report profile, serial 135): every Object its + ``objects`` name and every Construct its ``constructs`` name, read entry by entry as ``talks_of`` reads a line's. + + A report is the pair ``narrative`` + ``Report`` and the room's mark, both, as ``report_threads_of`` reads one. + Each id in ``objects`` is ``{"type": "object", "id": id}``, each in ``constructs`` ``{"type": "construct", "id": + id}``; an entry that is not a string, or is empty once trimmed of White_Space, names nothing, a field that is not + a list names nothing, and every other entry is the id as written, untrimmed and with its case. Each ``{type, id}`` + once, in its first place, the objects before the constructs. A report links every Object and Construct it touched + or changed, so none of these is named as the talk it closed: from the report alone no reader can tell. A Narrative + that is no report (one without the mark, a line in the room, a board entry, anything that is not a mapping) + answers ``[]``. The npm SDK's ``reportTalksOf`` is the same reader.""" + if not isinstance(narrative, Mapping) or not _is_marked(narrative, _REPORT_PAIR): + return [] + return _named_talks(narrative) + + # ---- A line of ``consequences`` (the report profile's lines rulings: what a line is, its address, its shown words) #: The closing marks, character by character (the lines rulings: a ``?`` is no closing mark, since it starts a diff --git a/src/onlyworlds/room.py b/src/onlyworlds/room.py index 5089151..f4d8b8e 100644 --- a/src/onlyworlds/room.py +++ b/src/onlyworlds/room.py @@ -8,24 +8,33 @@ a graph, a link picker, a story's context, a survey) leaves room elements out unless the person asks; the room's own views show them whole. A writer writes them like any element, the mark kept byte for byte: the rule is the reader's. A convention on the 22 types, never a change to the standard. The npm -SDK's ``isRoomElement`` is the same matcher, with the same fold. +SDK's ``isRoomElement`` is the same matcher, with the same fold. ``talks_of`` (serial 135) reads the talks on an +Object or a Construct that a line in the room is in. """ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Literal, cast +from typing import Any, Literal, TypedDict, cast from ._schema import READING_AID_MARK, READING_AID_PAIRS, ROOM_MARK, ROOM_PAIRS from .folder import FolderElement from .worldfile import simple_case_fold -__all__ = ["ROOM_PAIRS", "is_charter_element", "is_room_element", "reading_aid_of"] +__all__ = ["ROOM_PAIRS", "Talk", "is_charter_element", "is_room_element", "reading_aid_of", "talks_of"] #: The three reading aids, as the charter profile names them (``profiles/charter.fixture.json``'s ``aid``). ReadingAid = Literal["charter", "guide", "domain"] +class Talk(TypedDict): + """A talk on an element (the room profile, serial 135): ``object`` for an id a line or a report names in its + ``objects``, ``construct`` for one in its ``constructs``; the id as written.""" + + type: Literal["object", "construct"] + id: str + + _WHITE_SPACE: str = "".join( map( chr, @@ -100,6 +109,76 @@ def is_room_element(element: Mapping[str, Any] | FolderElement) -> bool: return any((_fold(t), _fold(s)) == key for t, s in ROOM_PAIRS) +def _body_and_kind(element: Any) -> tuple[Mapping[str, Any], Any] | None: + if isinstance(element, FolderElement): + return element.body, element.type + if isinstance(element, Mapping): + return element, element.get("type") + return None + + +def _is_pair(element: Any, pair: tuple[str, str]) -> bool: + """The element's type and supertype, each trimmed and folded as ``is_room_element`` reads them, are ``pair``.""" + found = _body_and_kind(element) + if found is None: + return False + body, kind = found + supertype = body.get("supertype") + if not isinstance(kind, str) or not isinstance(supertype, str): + return False + return (_fold(kind), _fold(supertype)) == (_fold(pair[0]), _fold(pair[1])) + + +_TALK_FIELDS: tuple[tuple[str, Literal["object", "construct"]], ...] = ( + ("objects", "object"), + ("constructs", "construct"), +) +"""The only two fields that make a talk on an element, in the order their talks are answered.""" + + +def _named_talks(body: Mapping[str, Any]) -> list[Talk]: + """The talks a line or a report names (the room profile, serial 135): each id in ``objects`` an Object's, each + in ``constructs`` a Construct's. An entry that is not a string, or is empty once trimmed of White_Space, names + nothing, and a field that is not a list names nothing; every other entry is the id as written, untrimmed and + with its case. Each ``{type, id}`` once, in its first place, the objects before the constructs.""" + out: list[Talk] = [] + seen: set[tuple[str, str]] = set() + for field, kind in _TALK_FIELDS: + value = body.get(field) + if not isinstance(value, list): + continue + for entry in value: + if not isinstance(entry, str) or entry.strip(_WHITE_SPACE) == "": + continue + if (kind, entry) not in seen: + seen.add((kind, entry)) + out.append({"type": kind, "id": entry}) + return out + + +_LINE_PAIR: tuple[str, str] = next(p for p in ROOM_PAIRS if (_fold(p[0]), _fold(p[1])) == ("narrative", "message")) +"""A line in the room: the room profile's pair ``narrative`` + ``Message``, with the mark.""" + + +def talks_of(element: Mapping[str, Any] | FolderElement) -> list[Talk]: + """The talks on an element that ``element`` is in as a line (schema-dist ``profiles/room.md``, serial 135). + + Only a line in the room is in a talk: the pair ``narrative`` + ``Message`` and the mark ``x_room_of``, read as + ``is_room_element`` reads them. Each id in its ``objects`` is ``{"type": "object", "id": id}``, each in its + ``constructs`` ``{"type": "construct", "id": id}``. An entry that is not a string, or is empty once trimmed of + White_Space, names nothing, and a field that is not a list names nothing; every other entry is the id as written, + a space left on it and its case included (the address profile's "The same id"), so ``ABC`` and ``abc`` are two + talks. Each ``{type, id}`` comes once, in its first place, the objects before the constructs. A line's + ``characters`` are its recipients and make no talk, and no other field does. Any other element (a Message + without the mark, a board entry, a report, lore, anything that is no element) answers ``[]``. Takes a body or a + ``FolderElement``. The npm SDK's ``talksOf`` is the same reader.""" + if not is_room_element(element) or not _is_pair(element, _LINE_PAIR): + return [] + found = _body_and_kind(element) + assert found is not None + return _named_talks(found[0]) + + _READING_AID_KEYS: frozenset[str] = frozenset(f"{_fold(t)}/{_fold(s)}" for t, s in READING_AID_PAIRS) """The reading aids' pairs as ``types`` words, folded: ``law/charter``, ``construct/guide``, ``construct/domain``.""" diff --git a/tests/test_charter.py b/tests/test_charter.py index 3912c14..82ee394 100644 --- a/tests/test_charter.py +++ b/tests/test_charter.py @@ -1,8 +1,8 @@ """The charter profile (schema-dist ``profiles/charter.md``, serial 83): every conformance case in ``codegen/schema-dist/profiles/charter.fixture.json``, vendored with the distribution, each its own test, through ``charter_of`` and ``domains_of`` (the packet) and ``is_charter_element`` (the pair and the mark), and the -fixture's tables read back against the package's. The npm SDK's ``charterOf``, ``domainsOf`` and -``isCharterElement`` run the same cases.""" +fixture's tables read back against the package's, and every design case (serial 135) through ``design_parts_of``. +The npm SDK's ``charterOf``, ``domainsOf``, ``isCharterElement`` and ``designPartsOf`` run the same cases.""" from __future__ import annotations @@ -21,6 +21,7 @@ SKILL_MAX, FolderElement, charter_of, + design_parts_of, domains_of, is_charter_element, reading_aid_of, @@ -164,3 +165,122 @@ def test_reading_aid_of_reads_the_pair_alone() -> None: bad: list[Any] = [None, "law/charter", 7, ["law", "Charter"], {"type": "law"}, {"type": "law", "supertype": None}] for b in [*bad, {"supertype": "Charter"}]: assert reading_aid_of(b) is None, b + + +# ---- The design state (charter.md, serial 135): design_parts_of over the fixture's design_cases + +DESIGN_CASES: list[dict[str, Any]] = DOC["design_cases"] + + +def part_set(rows: list[Any]) -> set[tuple[str, str, str]]: + return {(row["type"], row["id"], row["state"]) for row in rows} + + +def test_the_fixture_holds_serial_135s_design_cases() -> None: + assert len(DESIGN_CASES) == 13, f"the fixture holds {len(DESIGN_CASES)} design cases, serial 135 has 13" + assert len({c["name"] for c in DESIGN_CASES}) == 13 + + +@pytest.mark.parametrize("case", DESIGN_CASES, ids=lambda c: c["name"]) +def test_design_parts_of(case: dict[str, Any]) -> None: + """Compared as a set, as the page says; each part once.""" + world = world_of(case) + before = json.dumps(world, sort_keys=True) + reader = reader_of(world, case["reader"]) + got = design_parts_of(world, reader) + assert part_set(got) == part_set(case["want"]), case.get("note") + assert len(got) == len(part_set(got)), f"a part twice: {got}" + assert json.dumps(world, sort_keys=True) == before, "design_parts_of moved the world" + # The owner reading as this reader reads this reader's parts. + assert part_set(design_parts_of(world, {"rung": "owner", "as": reader})) == part_set(case["want"]) + + +CHARTER = { + "id": "c0", + "type": "law", + "name": "Rules", + "supertype": "Charter", + "created_at": "2026-11-01T12:00:00Z", + "x_charter_of": "w", +} + + +def design_world(*parts: dict[str, Any], charter: dict[str, Any] | None = None, **more: Any) -> dict[str, Any]: + return {"id": "w", "hidden": [], "elements": [charter or CHARTER, *parts], **more} + + +def test_design_parts_come_in_the_worlds_order() -> None: + # The package's own case: the page orders no parts; design_parts_of keeps the world's element order. + world = design_world( + {"id": "b", "type": "construct", "name": "B", "subtype": "locked"}, + {"id": "a", "type": "object", "name": "A", "subtype": "in design"}, + ) + assert design_parts_of(world, {"rung": "owner"}) == [ + {"type": "construct", "id": "b", "state": "locked"}, + {"type": "object", "id": "a", "state": "in design"}, + ] + + +def test_the_subtype_is_trimmed_of_white_space_and_folded() -> None: + # The package's own case: White_Space at both ends goes, U+001C (str.strip's, no White_Space) stays, the fold is + # simple case folding, and a space inside is no match. + world = design_world( + {"id": "o1", "type": "object", "subtype": chr(0xA0) + "LOCKED" + chr(0x3000)}, + {"id": "o2", "type": "object", "subtype": "\tIn DESIGN\n"}, + {"id": "o3", "type": "object", "subtype": chr(0x1C) + "locked"}, + {"id": "o4", "type": "object", "subtype": "in design"}, + {"id": "o5", "type": "object", "subtype": "indesign"}, + {"id": "o6", "type": "object", "subtype": ["locked"]}, + {"id": "o7", "type": "object", "subtype": None}, + {"id": "o8", "type": "object", "supertype": "locked"}, + ) + assert design_parts_of(world, {"rung": "owner"}) == [ + {"type": "object", "id": "o1", "state": "locked"}, + {"type": "object", "id": "o2", "state": "in design"}, + ] + + +def test_a_proposed_charter_or_part_and_a_hidden_part_are_read_as_charter_of_reads_them() -> None: + # The package's own case: a proposed Charter opens no gate (charter.md: "or only a proposed one"); a proposed + # Object is in no reader's view; a hidden Object is a part for the owner and not there for a contributor. + part = {"id": "o1", "type": "object", "subtype": "locked"} + proposed_charter = {**CHARTER, "x_review_proposed": "is this ours?"} + assert design_parts_of(design_world(part, charter=proposed_charter), {"rung": "owner"}) == [] + proposed_part = {"id": "o2", "type": "object", "subtype": "locked", "x_review_proposed": "real?"} + assert design_parts_of(design_world(part, proposed_part), {"rung": "owner"}) == [ + {"type": "object", "id": "o1", "state": "locked"} + ] + hidden = design_world(part, {"id": "o3", "type": "construct", "subtype": "locked"}, hidden=["o3"]) + assert [p["id"] for p in design_parts_of(hidden, {"rung": "owner"})] == ["o1", "o3"] + assert [p["id"] for p in design_parts_of(hidden, {"rung": "contributor"})] == ["o1"] + + +def test_a_guest_reads_parts_only_on_what_it_holds_whole() -> None: + # The package's own case: the Charter as a stub still opens the gate (charter_of reads a stub's standing from the + # owner's element); an Object held whole is a part, one held as a stub is none, one not held is not there. + world = design_world( + {"id": "o1", "type": "object", "subtype": "locked"}, + {"id": "o2", "type": "object", "subtype": "locked"}, + {"id": "o3", "type": "object", "subtype": "locked"}, + ) + guest = {"rung": "guest", "whole": ["o1"], "known_of": ["c0", "o2"]} + assert charter_of(world, guest)["charter"] is not None + assert design_parts_of(world, guest) == [{"type": "object", "id": "o1", "state": "locked"}] + assert design_parts_of(world, {"rung": "guest", "whole": ["o1"], "known_of": []}) == [] + + +def test_a_public_reader_reads_parts_only_in_a_world_open_to_anyone() -> None: + # The package's own case. + part = {"id": "o1", "type": "object", "subtype": "locked"} + assert design_parts_of(design_world(part), {"rung": "public"}) == [] + assert design_parts_of(design_world(part, open=True), {"rung": "public"}) == [ + {"type": "object", "id": "o1", "state": "locked"} + ] + + +def test_design_parts_of_refuses_what_is_not_a_reading() -> None: + with pytest.raises(TypeError): + design_parts_of({}, {"rung": "owner"}) + with pytest.raises(TypeError): + design_parts_of({"elements": []}, {"rung": "admin"}) + assert design_parts_of({"elements": []}, {"rung": "owner"}) == [] diff --git a/tests/test_report.py b/tests/test_report.py index 6f95a43..e6bbefb 100644 --- a/tests/test_report.py +++ b/tests/test_report.py @@ -1,6 +1,7 @@ """The report profile's rule 9 (schema-dist ``profiles/report.md``, serial 120): every thread case in ``codegen/schema-dist/profiles/report.fixture.json``, vendored with the distribution, replayed through -``report_threads_of``; then the edges the fixture leaves out.""" +``report_threads_of``, and every talk case (serial 135) through ``report_talks_of``; then the edges the +fixture leaves out.""" from __future__ import annotations @@ -10,7 +11,7 @@ import pytest -from onlyworlds import ROOM_PAIRS, ReportThreads, report_threads_of +from onlyworlds import ROOM_PAIRS, ReportThreads, report_talks_of, report_threads_of from onlyworlds._schema import ROOM_MARK REPO = Path(__file__).resolve().parent.parent @@ -220,3 +221,60 @@ def test_a_group_is_ordered_by_instant_never_by_id_or_text() -> None: ] ) assert got["groups"] == [{"parent": "r1", "kind": "report", "reports": ["a", "c", "d", "b"]}] + + +# ---- The talks a report is shown with (report.md, serial 135): report_talks_of over the fixture's talk_cases + +TALK_CASES = 6 + + +def talk_cases() -> list[Any]: + return list(load_fixture()["talk_cases"]) if FIXTURE.is_file() else [] + + +def test_the_fixture_holds_serial_135s_talk_cases() -> None: + cases = load_fixture()["talk_cases"] + assert len(cases) == TALK_CASES, f"{len(cases)} talk cases; this test was written for {TALK_CASES}" + assert len({c["name"] for c in cases}) == TALK_CASES + + +@pytest.mark.parametrize("case", talk_cases(), ids=lambda c: str(c.get("name"))) +def test_talk_case(case: dict[str, Any]) -> None: + """Compared as a set, as the page says; each talk once.""" + before = json.dumps(case["report"], sort_keys=True) + got = report_talks_of(case["report"]) + assert {(t["type"], t["id"]) for t in got} == {(t["type"], t["id"]) for t in case["talks"]}, case.get("note") + assert len(got) == len({(t["type"], t["id"]) for t in got}), f"a talk twice: {got}" + assert json.dumps(case["report"], sort_keys=True) == before, "report_talks_of moved the report" + + +def test_a_reports_talks_come_once_in_first_place_objects_before_constructs() -> None: + # The package's own case: the order report_talks_of promises, a duplicate id, a space left on an id, upper case. + r = report("r1", constructs=["k", "o"], objects=["o", " o", "O", "o", "\t"]) + assert report_talks_of(r) == [ + {"type": "object", "id": "o"}, + {"type": "object", "id": " o"}, + {"type": "object", "id": "O"}, + {"type": "construct", "id": "k"}, + {"type": "construct", "id": "o"}, + ] + + +@pytest.mark.parametrize("value", ["o", {"id": "o"}, 7, None, ("o",)]) +def test_a_reports_field_that_is_no_list_names_nothing(value: Any) -> None: + # The package's own case. + assert report_talks_of(report("r1", objects=value, constructs=value)) == [] + + +def test_only_a_report_is_shown_with_talks() -> None: + # The package's own case: the pair read trimmed and folded with the mark by presence, as report_threads_of reads + # a report; a board entry, a line, an unmarked Report and anything that is no mapping are no report. + assert report_talks_of(report("r1", type="NARRATIVE ", supertype=" report", objects=["o"])) == [ + {"type": "object", "id": "o"} + ] + assert report_talks_of({**board("b1"), "objects": ["o"]}) == [] + assert report_talks_of({**report("r1", objects=["o"]), ROOM_MARK: " "}) == [] + assert report_talks_of({**report("r1", objects=["o"]), "supertype": "Message"}) == [] + no_report: tuple[Any, ...] = (None, [], "a report", 7) + for nothing in no_report: + assert report_talks_of(nothing) == [] diff --git a/tests/test_room.py b/tests/test_room.py index b1fcd40..1daaa5a 100644 --- a/tests/test_room.py +++ b/tests/test_room.py @@ -1,7 +1,7 @@ """The room profile (schema-dist ``profiles/room.md``, serial 45): ``ROOM_PAIRS`` against the fixture's pairs, and ``is_room_element`` (the pair AND the mark ``x_room_of``) on every conformance case in -``codegen/schema-dist/profiles/room.fixture.json``, vendored with the distribution. The npm SDK's -``isRoomElement`` runs the same cases.""" +``codegen/schema-dist/profiles/room.fixture.json``, vendored with the distribution, and ``talks_of`` on every +``talk_cases`` case (serial 135). The npm SDK's ``isRoomElement`` and ``talksOf`` run the same cases.""" from __future__ import annotations @@ -9,7 +9,9 @@ from pathlib import Path from typing import Any -from onlyworlds import ROOM_PAIRS, FolderElement, is_room_element +import pytest + +from onlyworlds import ROOM_PAIRS, FolderElement, is_room_element, talks_of REPO = Path(__file__).resolve().parent.parent FIXTURE = REPO / "codegen" / "schema-dist" / "profiles" / "room.fixture.json" @@ -119,3 +121,84 @@ def element(b: dict[str, Any]) -> FolderElement: assert is_room_element(element(marked)) is True assert is_room_element(marked) is False # the body alone has no type assert is_room_element(element(body)) is False # a letter without the mark is lore + + +# ---- The talk on an Object or a Construct (room.md, serial 135): talks_of over the fixture's talk_cases + +TALK_CASES: list[dict[str, Any]] = load_fixture()["talk_cases"] + + +def talk_set(rows: list[Any]) -> set[tuple[str, str]]: + return {(row["type"], row["id"]) for row in rows} + + +def test_the_fixture_holds_serial_135s_talk_cases() -> None: + assert len(TALK_CASES) == 13, f"the fixture holds {len(TALK_CASES)} talk cases, serial 135 has 13" + assert len({c["name"] for c in TALK_CASES}) == 13 + + +@pytest.mark.parametrize("case", TALK_CASES, ids=lambda c: c["name"]) +def test_talk_case(case: dict[str, Any]) -> None: + """Compared as a set, as the page says; each talk once.""" + before = json.dumps(case["element"], sort_keys=True) + got = talks_of(case["element"]) + assert talk_set(got) == talk_set(case["talks"]), case.get("note") + assert len(got) == len(talk_set(got)), f"a talk twice: {got}" + assert json.dumps(case["element"], sort_keys=True) == before, "talks_of moved the element" + + +LINE = {"id": "019a8b00-0000-7000-8000-0000000001ff", "type": "narrative", "supertype": "Message", "x_room_of": WORLD} +OBJ = "019a8b00-0000-7000-8000-000000000201" +CON = "019a8b00-0000-7000-8000-000000000211" + + +def test_talks_come_once_in_first_place_objects_before_constructs() -> None: + # The package's own case: the order talks_of promises (the page compares as a set) and a duplicate id. + line = {**LINE, "constructs": [CON, OBJ], "objects": [OBJ, "b", OBJ, "a"]} + assert talks_of(line) == [ + {"type": "object", "id": OBJ}, + {"type": "object", "id": "b"}, + {"type": "object", "id": "a"}, + {"type": "construct", "id": CON}, + {"type": "construct", "id": OBJ}, + ] + + +def test_an_entry_with_a_space_left_on_it_is_read_as_written() -> None: + # The package's own case: a space before, a no-break space after, and the id in upper case, each its own talk. + line = {**LINE, "objects": [f" {OBJ}", f"{OBJ}{chr(0xA0)}", OBJ.upper(), OBJ]} + assert [t["id"] for t in talks_of(line)] == [f" {OBJ}", f"{OBJ}{chr(0xA0)}", OBJ.upper(), OBJ] + + +def test_white_space_alone_names_nothing_and_other_marks_are_ids() -> None: + # The package's own case: the trim is White_Space exactly, so U+001F and a byte order mark are left and name an + # id as written, while a no-break space and an ideographic space alone name nothing. + blank = ["", " ", chr(0xA0), chr(0x3000) + "\t", chr(0x2028)] + line = {**LINE, "objects": [*blank, chr(0x1F), chr(0xFEFF)], "constructs": blank} + assert talks_of(line) == [{"type": "object", "id": chr(0x1F)}, {"type": "object", "id": chr(0xFEFF)}] + + +@pytest.mark.parametrize("value", [OBJ, {"id": OBJ}, 7, None, (OBJ,), True]) +def test_a_field_that_is_no_list_names_nothing(value: Any) -> None: + # The package's own case: a string, a mapping, a number, null, a tuple and a boolean are no list. + assert talks_of({**LINE, "objects": value, "constructs": value}) == [] + + +def test_a_line_is_read_as_is_room_element_reads_one() -> None: + # The package's own case: the pair trimmed and folded, the mark by presence; a folder element by its type. + assert talks_of({**LINE, "type": " NARRATIVE", "supertype": "message\t", "objects": [OBJ]}) == [ + {"type": "object", "id": OBJ} + ] + absent: tuple[Any, ...] = (None, "", " ", [], {}) + for mark in absent: + assert talks_of({**LINE, "x_room_of": mark, "objects": [OBJ]}) == [], repr(mark) + assert talks_of({**LINE, "x_room_of": 7, "objects": [OBJ]}) == [{"type": "object", "id": OBJ}] + assert talks_of({**LINE, "supertype": "Messages", "objects": [OBJ]}) == [] + assert talks_of({**LINE, "supertype": "Work item", "type": "relation", "objects": [OBJ]}) == [] + body = {"id": "l1", "supertype": "Message", "x_room_of": WORLD, "constructs": [CON]} + path = Path("elements/narrative/l1.json") + el = FolderElement(id="l1", type="narrative", type_inferred=True, body=body, path=path, layout="elements") + assert talks_of(el) == [{"type": "construct", "id": CON}] + no_element: tuple[Any, ...] = (None, [], "a line", 7) + for nothing in no_element: + assert talks_of(nothing) == []