diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5175e0..bcb5d34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: env: # The game commit whose runner, scripts and judges this checkout is # held to (parity/README.md, "Changing a rule"). - SERVER_COMMIT: cfe509a495eee41d1d8547b3fe66ba2b86256ebf + SERVER_COMMIT: ad6bce7c2c83af947c1d1fd398d53adb5f3eb3bc steps: # Side by side, not one inside the other: the game's extension is a # crate of its own, and inside this checkout cargo would read it as a diff --git a/parity/PASSING b/parity/PASSING index 0e5253b..be80f5e 100644 --- a/parity/PASSING +++ b/parity/PASSING @@ -48,6 +48,7 @@ a-room-furnished-as-it-is-written a-room-written-while-the-arc-waits a-scheduled-event-comes-due a-second-game-arrives-for-the-first-time +a-seeded-temple-keeps-its-rooms asking-one-person-about-another a-slash-in-front-of-the-line a-thing-can-be-thrown diff --git a/parity/goldens/a-seeded-temple-keeps-its-rooms.json b/parity/goldens/a-seeded-temple-keeps-its-rooms.json new file mode 100644 index 0000000..a52576f --- /dev/null +++ b/parity/goldens/a-seeded-temple-keeps-its-rooms.json @@ -0,0 +1,107 @@ +{ + "script": "a-seeded-temple-keeps-its-rooms", + "story": "The Shrine on the Square", + "steps": [ + { + "step": "step 1 into-the-shrine", + "player": "first", + "typed": "/move The Shrine", + "dump": { + "location": { + "id": 1000000003, + "name": "The Shrine room 1", + "detail": "realized" + }, + "storey": 0, + "exits": [ + { + "id": 1000000004, + "name": "The Shrine room 2", + "detail": "stub" + }, + { + "id": 1000000006, + "name": "The Shrine room 4", + "detail": "stub" + }, + { + "id": 1000000001, + "name": "The Square", + "detail": "realized" + } + ], + "here": [ + { + "id": 1000000009, + "name": "altar" + }, + { + "id": 1000000012, + "name": "bench" + }, + { + "id": 1000000016, + "name": "candle" + }, + { + "id": 1000000010, + "name": "candle stand" + }, + { + "id": 1000000013, + "name": "dried flowers" + }, + { + "id": 1000000015, + "name": "prayer card" + }, + { + "id": 1000000014, + "name": "small bell" + }, + { + "id": 1000000011, + "name": "statue" + } + ], + "carrying": [], + "present": [], + "foes": [], + "inscription": [ + { + "id": 1000000015, + "name": "prayer card", + "text": null + } + ], + "hp": 18, + "hp_of": {}, + "abilities": { + "strength": 12, + "dexterity": 12, + "will": 12 + }, + "dead": false, + "changed": true, + "change": "The browser turn completed.", + "refused": false, + "offers": null, + "understood": "move -> The Shrine", + "resolved_by": "grammar", + "note": "into-the-shrine: completed", + "drifts": 0, + "blows": 0, + "hazards": 0, + "quest": {}, + "volitions": 0, + "acts": 0, + "ending": "none", + "ending_words": null, + "scheduled": 0, + "fired": 0, + "elapsed_minutes": 1.0, + "shown": null + } + } + ] +} diff --git a/parity/records/a-seeded-temple-keeps-its-rooms.json b/parity/records/a-seeded-temple-keeps-its-rooms.json new file mode 100644 index 0000000..9b0b50f --- /dev/null +++ b/parity/records/a-seeded-temple-keeps-its-rooms.json @@ -0,0 +1,1239 @@ +{ + "script": "a-seeded-temple-keeps-its-rooms", + "steps": [ + { + "step": "step 1 into-the-shrine", + "requests": [ + { + "purpose": "location", + "system": "You build the rooms of a text adventure one at a time. You write places a\nplayer can stand in and walk out of: concrete, specific, and consistent\nwith the world they belong to. Every exit you name is somewhere the player\ncould actually go.\n\nDO NOT INCLUDE EMOJIS IN YOUR RESPONSE.\n", + "user": "## Universe Details\nphysics: Ordinary physics.\ntechnology: Lanterns, iron keys and hand tools.\ngeographies: A small town around one square.\nraces: Townsfolk\ncivilizations: Townsfolk who keep a shrine on their square.\n\n\n## Story Details\ntitle: The Shrine on the Square (engine sweep)\ngenre: town adventure\npreface: A shrine stands on one side of the town square.\nsummary: Wren goes into the shrine.\n\n\n## The Place\nname: The Shrine\nteaser: A stone shrine with its door standing open.\n\n## Instructions\nWrite this place out in full. It is a BUILDING -- somewhere with rooms\ninside it that a player walks into and moves around in.\n- The description is what the player reads as they come in. Address them as \"you\"\n- Describe what is here now, not the history -- the history is the lore\n- Stay consistent with the universe and with the teaser above\n- Do NOT describe the floor plan: how many rooms there are, where the stairs\n are and which door leads where are the game's to decide, out of the answers\n below, and it will tell you room by room as the player reaches them\n- Do not name anybody standing here and do not list anything lying here.\n People and things belong to the rooms, and each room is written as it is\n reached\n- Respect the stated length of each field\n\n## What Kind Of Building This Is\nThe game lays the inside out itself -- every room, every door, every stair\n-- from the answers to these, and then writes each room as the player\nreaches it. You are choosing what KIND of place this is, not drawing it.\n- Answer for the place you have just described and for the story it stands in\n- Every one of them can be left out, and the quietest answer is usually the\n right one: one floor, nothing underneath, nothing dangerous, nothing that\n hurts you\n- A HAZARD is not atmosphere. It takes hit points off everybody who walks\n through those rooms, every turn in some cases, so pick one only for a\n place that really is flooded, unlit, silent or airless\n- A GRADIENT is only worth saying when the place itself makes it true: a\n cellar that gets worse the further down you go, a tower that gets worse\n the higher you climb\n", + "schema": { + "name": "Location::PlaceSchema", + "description": null, + "schema": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "What the player sees, hears and smells standing in this place right now. Describe THIS place only -- not what neighbours it, not what is visible out of a window or across the way, because the world around it can move. Second person. One paragraph, 4 to 6 sentences.", + "maxLength": 1200 + }, + "lore": { + "type": "string", + "description": "What this place is, who made it and what happened here. Written for the game engine rather than the player. One paragraph, 3 to 5 sentences.", + "maxLength": 900 + }, + "place_kind": { + "type": "string", + "enum": [ + "house", + "farmhouse", + "mansion", + "apartment block", + "inn", + "shop", + "office building", + "guildhall", + "workshop", + "smithy", + "mill", + "factory", + "warehouse", + "barn", + "temple", + "library", + "school", + "hospital", + "theatre", + "bathhouse", + "barracks", + "fortress", + "jail", + "tower", + "lighthouse", + "warren", + "ruin", + "spaceship", + "space station" + ], + "description": "What sort of place with rooms this is -- a building, a ship, a station -- as the game will lay out and furnish its rooms: pick the closest. The game decides which rooms it has and what stands in each; you describe it from outside and at its way in." + }, + "parameters": { + "type": "object", + "properties": { + "storeys_above": { + "type": "string", + "enum": [ + "ground floor only", + "one storey up", + "two storeys up" + ], + "description": "How far up it goes, counting the ground floor. Most buildings are one floor." + }, + "storeys_below": { + "type": "string", + "enum": [ + "none", + "a cellar", + "two levels down", + "deep" + ], + "description": "How far down it goes below the ground floor. Most buildings have nothing under them." + }, + "danger": { + "type": "string", + "enum": [ + "safe", + "uneasy", + "dangerous" + ], + "description": "How likely a room of it is to hold something that means the player harm. Most buildings are safe." + }, + "gradient": { + "type": "string", + "enum": [ + "the same throughout", + "worse the deeper you go", + "worse the higher you climb" + ], + "description": "Whether that gets worse in one direction. Only say so when the place itself makes it true -- a cellar that gets worse the further down you go, a tower that gets worse the higher you climb." + }, + "hazard": { + "type": "string", + "enum": [ + "none", + "flooded", + "unlit", + "silent", + "airless" + ], + "description": "What standing in its rooms does to a person, if anything. NONE is the right answer for almost every building: this is not atmosphere, it is a place that takes hit points off whoever walks through it." + } + }, + "required": [], + "additionalProperties": false, + "description": "What kind of building this is. Every field is optional; leave one out and the game takes the quietest option. Answer for the place you have just described." + } + }, + "required": [ + "description", + "lore" + ], + "additionalProperties": false, + "strict": true + } + } + }, + { + "purpose": "location", + "system": "You build the rooms of a text adventure one at a time. You write places a\nplayer can stand in and walk out of: concrete, specific, and consistent\nwith the world they belong to. Every exit you name is somewhere the player\ncould actually go.\n\nDO NOT INCLUDE EMOJIS IN YOUR RESPONSE.\n", + "user": "## Universe Details\nphysics: Ordinary physics.\ntechnology: Lanterns, iron keys and hand tools.\ngeographies: A small town around one square.\nraces: Townsfolk\ncivilizations: Townsfolk who keep a shrine on their square.\n\n\n## Story Details\ntitle: The Shrine on the Square (engine sweep)\ngenre: town adventure\npreface: A shrine stands on one side of the town square.\nsummary: Wren goes into the shrine.\n\n\n## The Place\nname: The Shrine room 1\nteaser: A room inside The Shrine, 5 by 10 paces on storey 0.\n## Where This Room Is\nThe game's own records of this room, already decided and not yours to\nchange. Write the room around them: do not contradict a measurement, and\ndo not give it a way out this list does not have.\nThis room is 5 by 10 paces -- about 8 by 15 metres. It is on storey 0 of The Shrine, which is 12 by 10 paces across; storey 0 is the ground floor. Its ways out: a door in the east wall, to The Shrine room 2; a stair down to The Shrine room 4, on storey -1; a way out to The Square, which is outside The Shrine. Those are every way out of this room.\n## Already Here, Decided By The Game\nThe game's own records of what is in this room, already decided and not yours\nto change, and it will tell the player so. Write the room around them, and do\nnot add another piece of furniture or fixed thing a player could reach for.\nFixed in place: altar, candle stand, statue, bench.\nOn the altar: dried flowers, small bell, prayer card.\nOn the candle stand: candle.\nDo not list any of them again as a thing lying here.\n## Instructions\nWrite this place out in full.\n- The description is what the player reads on arrival. Address them as \"you\"\n- Describe what is here now, not the history -- the history is the lore\n- Stay consistent with the universe and with the teaser above\n- Respect the stated length of each field\n- NAME THIS ROOM. It is one room inside The Shrine. The player reads the room and\n the place together -- \"the of The Shrine\" -- so name the ROOM only,\n and never put the place's own name into it. A short noun phrase carrying the\n article English wants on it, 2 to 4 words: \"the counting room\", \"the cold\n store\", \"the harbourmaster's office\". Name it for what the floor plan above\n says this room is and for what you have just described standing in it. Never\n a comma in it\n\n## What Is Lying Here\nList AT MOST 3 portable things a player could pick up and carry away, besides the ones Already Here above: those are written already, and a thing named again is not a new one.\n- Nothing is the right answer for most rooms. An empty list is a complete answer\n- Only loose, portable things. Not the door, not the floor, not the machinery\n bolted to it -- something a person could put in a pocket or under an arm\n- Each one must be consistent with the description you just wrote, and worth\n the player noticing\n- Pick its use_kind from the supplied physical profiles. Ordinary is the\n default. Food and drink can be consumed without healing; healing is only\n a restorative dose this world permits. Firestarters burn combustible\n objects, levers pry jammed passages, lockpicks try locks, and a key only\n opens a passage explicitly matched to it. Mark combustible only when an\n ordinary firestarter can destroy the object. The engine owns the effects\n and their amounts; its description cannot grant extra powers\n- If a thing has WRITING on it -- a note, a letter, a handbill, a label, a\n docket, a page, a sign -- mark it readable and WRITE OUT WHAT IS WRITTEN\n ON IT, exactly as it appears on the thing. The words themselves, not a\n description of them, and short enough to finish -- a few words, a line,\n or a few short lines. The game keeps those words and a player reading it\n twice reads the same ones\n- Never name it after a person or after a place. Already spoken for in this story, so do not reuse: Wren\n\n## Who Is Here\nWrite NOBODY into this place. There is nobody here, and the description\nshould read like somewhere nobody is standing.\n", + "schema": { + "name": "Location::DetailSchema", + "description": null, + "schema": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "What the player sees, hears and smells standing in this place right now. Describe THIS place only -- not what neighbours it, not what is visible out of a window or across the way, because the world around it can move. Second person. One paragraph, 4 to 6 sentences.", + "maxLength": 1200 + }, + "lore": { + "type": "string", + "description": "What this place is, who made it and what happened here. Written for the game engine rather than the player. One paragraph, 3 to 5 sentences.", + "maxLength": 900 + }, + "name": { + "type": "string", + "description": "What this room is called -- ONLY when the instructions above ask you to name it. Leave this out entirely otherwise. A short noun phrase a player would type to walk into it, carrying the article English wants on it: \"the counting room\". Never the name of the building it is in, never a name this story has already given to a room, a person or a thing, and never a comma.", + "maxLength": 60 + }, + "items": { + "type": "array", + "description": "Portable things lying loose in this place that a player could pick up and carry away. Empty is the right answer for most rooms.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "What the thing is called, as a player would type it to pick it up. A short noun phrase, 1 to 4 words, lower case unless it is a proper name. Never the name of a person or of a place.", + "maxLength": 60 + }, + "description": { + "type": "string", + "description": "What it is and what state it is in, consistent with the description of the room you just wrote. One or two sentences.", + "maxLength": 400 + }, + "use_kind": { + "type": "string", + "enum": [ + "ordinary", + "food", + "drink", + "healing", + "firestarter", + "lever", + "lockpick", + "key" + ], + "description": "The engine's physical profile: ordinary unless it is food, a drink, a healing dose, a firestarter, a prying lever, lockpicks, or a key. Choose healing only for an actual restorative dose allowed by this world. Profiles supply behavior from code, never from the description." + }, + "combustible": { + "type": "boolean", + "description": "True only if this portable thing can be destroyed by an ordinary carried firestarter: dry paper, cloth or wood. False for stone, metal, liquids, or anything uncertain." + }, + "readable": { + "type": "boolean", + "description": "True only if this thing has WRITING on it that a player could read: a note, a letter, a label, a docket, a page, a sign, an inscription. False for everything else, which is most things." + }, + "inscription": { + "type": "string", + "description": "The words written on it, exactly as they appear, and only when `readable` is true. Write what is actually on the thing -- what a player would read off it -- not a description of it. A few words, a line, or a few short lines; well under the limit, and finished rather than trailing off. Leave this out entirely when nothing is written on it.", + "maxLength": 400 + } + }, + "required": [ + "name", + "description", + "use_kind", + "combustible", + "readable" + ], + "additionalProperties": false + }, + "maxItems": 3 + }, + "people": { + "type": "array", + "description": "People who are in this place right now.", + "items": { + "type": "object", + "properties": { + "fullname": { + "type": "string", + "description": "Their full name, as a player would type it to speak to them. 2 or 3 words.", + "maxLength": 60 + }, + "nickname": { + "type": "string", + "description": "What they are called to their face. 1 or 2 words.", + "maxLength": 30 + }, + "appearance": { + "type": "string", + "description": "What somebody walking in sees of them, consistent with the room you just wrote and with the race and age you were given for them. One or two sentences.", + "maxLength": 300 + }, + "personality": { + "type": "string", + "description": "How they behave and how they treat a stranger. One or two sentences.", + "maxLength": 300 + }, + "backstory": { + "type": "string", + "description": "The life history that brought them here, the repeated choices it taught them, and why today's presence presses on an enduring aim. Third person, by name. Two or three sentences.", + "maxLength": 450 + }, + "likes": { + "type": "string", + "description": "A comma separated list of 2 or 3 things they enjoy.", + "maxLength": 160 + }, + "dislikes": { + "type": "string", + "description": "A comma separated list of 2 or 3 things they cannot stand.", + "maxLength": 160 + }, + "fears": { + "type": "string", + "description": "A comma separated list of 1 or 2 things they are afraid of.", + "maxLength": 160 + }, + "conscious_desire": { + "type": "string", + "description": "The future, standing, relationship, legacy, place or way of life they knowingly organize their choices around and would name if asked what they want from their life. Make it specific to this person and world. Do not substitute the clue, deadline, delivery, payment or room they are dealing with today. One sentence, third person, by name.", + "maxLength": 180 + }, + "unconscious_desire": { + "type": "string", + "description": "The deeper reward their choices have pursued for years and they would deny: the recognition, absolution, dependence, belonging, power or intimacy beneath the conscious account. It explains a repeated pattern in the backstory and pulls at an angle to the conscious desire, not merely today's hidden motive. One sentence, third person, by name.", + "maxLength": 180 + }, + "recognized_need": { + "type": "string", + "description": "The duty, oath, debt, craft, family burden or bodily discipline they believe they must keep over years whether they want to or not. It predates today's assignment, survives it, and can repeatedly obstruct the conscious desire. One sentence, third person, by name.", + "maxLength": 180 + }, + "unrecognized_need": { + "type": "string", + "description": "The enduring change, truth or relationship their life requires and their repeated pattern prevents them from seeing. A reader can infer it from the backstory. It cannot be completed by one confession, realization or errand: it demands a new way of choosing across the story. If they never move toward it, pursuit of the conscious desire ruins them. It must not be the conscious desire said twice. One sentence, third person, by name.", + "maxLength": 180 + }, + "desire_pursuit": { + "type": "string", + "enum": [ + "keep", + "obtain", + "reach", + "attend", + "avoid", + "withhold", + "offer" + ], + "description": "Which listed ENGINE ACT could repeatedly advance or protect the CONSCIOUS DESIRE in ordinary rooms. The label is the next-step expression of the larger desire, not its timescale." + }, + "need_pursuit": { + "type": "string", + "enum": [ + "keep", + "obtain", + "reach", + "attend", + "avoid", + "withhold", + "offer" + ], + "description": "Which listed ENGINE ACT could repeatedly move them toward the UNRECOGNIZED NEED in ordinary rooms. It may match desire_pursuit, but a different label should reflect a real conflict rather than manufactured variety." + } + }, + "required": [ + "fullname", + "nickname", + "appearance", + "personality", + "backstory", + "likes", + "dislikes", + "fears", + "conscious_desire", + "unconscious_desire", + "recognized_need", + "unrecognized_need", + "desire_pursuit", + "need_pursuit" + ], + "additionalProperties": false + }, + "maxItems": 3 + } + }, + "required": [ + "description", + "lore" + ], + "additionalProperties": false, + "strict": true + } + } + }, + { + "purpose": "arrival", + "system": "You narrate a text adventure. You write the moment a player walks into a\nplace: what reaches them first, in the second person and the present\ntense. You never break character, never offer a numbered menu, and never\nmention that you are a narrator.\n\nDO NOT INCLUDE EMOJIS IN YOUR RESPONSE.\n", + "user": "## Universe Details\nphysics: Ordinary physics.\ntechnology: Lanterns, iron keys and hand tools.\n\n## Story Details\ntitle: The Shrine on the Square (engine sweep)\ngenre: town adventure\nsummary: Wren goes into the shrine.\n\n## The Place\nname: The Shrine room 1\ndescription: A plain stone room with a shelf of candles under a carved panel.\nlore: Everyone who comes in stops here first.\nways out: The Shrine room 2, The Shrine room 4, The Square\n\n## Who Is Here\nWren (Wren), Townsfolk -- the player, the one arriving\n\n## Just Before This\nThe player has come from The Square. Wren arrives on the square.\n\n## Instructions\n- The player has never been here. This is the first time they have set\n foot in it\n- Narrate discovery: what catches them on the way in, before they\n have made sense of the rest\n- Address the player as \"you\", in the present tense\n- One paragraph. Do not re-describe the place item by item -- the\n description above is already what is here, and your job is the moment\n of coming into it\n- Anyone listed above is here; write them as already present, not as\n arriving. Do not add a person who is not on that list\n- Do not name a way out that is not on the list above\n- Respect the stated length of each field\n\n## Current State On Arrival\nThe place description is the world's original account. These current records\ntake precedence over its claims about people, items and wounds. Narrate the\nrecorded crossing result as part of this arrival.\nYou are unhurt.\nNobody else is alive here.\nFixed here, and not takeable: altar, candle stand, statue, bench.\nLying here: dried flowers, small bell, prayer card, candle.\nYou are carrying: nothing.\n", + "schema": { + "name": "Scene::Schema", + "description": null, + "schema": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "What the player experiences as they arrive here, right now. Second person, present tense. One paragraph, 3 to 5 sentences.", + "maxLength": 900 + }, + "summary": { + "type": "string", + "description": "What happened in this moment, for the game engine rather than the player. Third person. One sentence.", + "maxLength": 200 + } + }, + "required": [ + "description", + "summary" + ], + "additionalProperties": false, + "strict": true + } + } + } + ], + "written": { + "locations": { + "rows": [ + { + "id": 1000000002, + "story_id": 1000000001, + "name": "The Shrine", + "description": "A stone hall under a low dome, candles guttering in niches.", + "lore": "The townsfolk built the shrine before they paved the square.", + "last_protagonist_visit": null, + "parent_location_id": null, + "detail_level": "realized", + "teaser": "A stone shrine with its door standing open.", + "mobile": 0, + "danger": "safe", + "hazard": null, + "hazard_die": null, + "x": null, + "y": null, + "z": null, + "width": 12, + "depth": 10, + "population": "nobody", + "generation_checkpoint": null, + "surface": null, + "kind": "temple", + "density": null, + "sanctuary": 0 + }, + { + "id": 1000000003, + "story_id": 1000000001, + "name": "The Shrine room 1", + "description": "A plain stone room with a shelf of candles under a carved panel.", + "lore": "Everyone who comes in stops here first.", + "last_protagonist_visit": "2026-12-03 08:01:00", + "parent_location_id": 1000000002, + "detail_level": "realized", + "teaser": "A room inside The Shrine, 5 by 10 paces on storey 0.", + "mobile": 0, + "danger": "safe", + "hazard": null, + "hazard_die": null, + "x": 0, + "y": 0, + "z": 0, + "width": 5, + "depth": 10, + "population": null, + "generation_checkpoint": null, + "surface": null, + "kind": "shrine", + "density": null, + "sanctuary": 0 + }, + { + "id": 1000000004, + "story_id": 1000000001, + "name": "The Shrine room 2", + "description": null, + "lore": null, + "last_protagonist_visit": null, + "parent_location_id": 1000000002, + "detail_level": "stub", + "teaser": "A room inside The Shrine, 3 by 10 paces on storey 0.", + "mobile": 0, + "danger": "safe", + "hazard": null, + "hazard_die": null, + "x": 5, + "y": 0, + "z": 0, + "width": 3, + "depth": 10, + "population": null, + "generation_checkpoint": null, + "surface": null, + "kind": "shrine", + "density": null, + "sanctuary": 0 + }, + { + "id": 1000000005, + "story_id": 1000000001, + "name": "The Shrine room 3", + "description": null, + "lore": null, + "last_protagonist_visit": null, + "parent_location_id": 1000000002, + "detail_level": "stub", + "teaser": "A room inside The Shrine, 4 by 10 paces on storey 0.", + "mobile": 0, + "danger": "uneasy", + "hazard": null, + "hazard_die": null, + "x": 8, + "y": 0, + "z": 0, + "width": 4, + "depth": 10, + "population": null, + "generation_checkpoint": null, + "surface": null, + "kind": "study", + "density": null, + "sanctuary": 0 + }, + { + "id": 1000000006, + "story_id": 1000000001, + "name": "The Shrine room 4", + "description": null, + "lore": null, + "last_protagonist_visit": null, + "parent_location_id": 1000000002, + "detail_level": "stub", + "teaser": "A room inside The Shrine, 6 by 10 paces on storey -1.", + "mobile": 0, + "danger": "uneasy", + "hazard": null, + "hazard_die": null, + "x": 0, + "y": 0, + "z": -1, + "width": 6, + "depth": 10, + "population": null, + "generation_checkpoint": null, + "surface": null, + "kind": "storeroom", + "density": null, + "sanctuary": 0 + }, + { + "id": 1000000007, + "story_id": 1000000001, + "name": "The Shrine room 5", + "description": null, + "lore": null, + "last_protagonist_visit": null, + "parent_location_id": 1000000002, + "detail_level": "stub", + "teaser": "A room inside The Shrine, 6 by 10 paces on storey -1.", + "mobile": 0, + "danger": "safe", + "hazard": null, + "hazard_die": null, + "x": 6, + "y": 0, + "z": -1, + "width": 6, + "depth": 10, + "population": null, + "generation_checkpoint": null, + "surface": null, + "kind": "storeroom", + "density": null, + "sanctuary": 0 + } + ], + "removed": [] + }, + "location_connections": { + "rows": [ + { + "id": 1000000003, + "location_id": 1000000003, + "connected_location_id": 1000000004, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "walking", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000004, + "location_id": 1000000004, + "connected_location_id": 1000000003, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "walking", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000005, + "location_id": 1000000004, + "connected_location_id": 1000000005, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "walking", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000006, + "location_id": 1000000005, + "connected_location_id": 1000000004, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "walking", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000007, + "location_id": 1000000006, + "connected_location_id": 1000000007, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "walking", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000008, + "location_id": 1000000007, + "connected_location_id": 1000000006, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "walking", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000009, + "location_id": 1000000007, + "connected_location_id": 1000000004, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "taking stairs", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000010, + "location_id": 1000000004, + "connected_location_id": 1000000007, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "taking stairs", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000011, + "location_id": 1000000006, + "connected_location_id": 1000000003, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "taking stairs", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000012, + "location_id": 1000000003, + "connected_location_id": 1000000006, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "taking stairs", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000013, + "location_id": 1000000003, + "connected_location_id": 1000000001, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "walking", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + }, + { + "id": 1000000014, + "location_id": 1000000001, + "connected_location_id": 1000000003, + "distance": "adjacent", + "time_to_travel": "about a minute", + "travel_method": "walking", + "hazard": null, + "hazard_die": null, + "barrier": "open", + "key_template_id": null + } + ], + "removed": [ + 1000000001, + 1000000002 + ] + }, + "characters": { + "rows": [], + "removed": [] + }, + "items": { + "rows": [ + { + "id": 1000000001, + "character_id": null, + "name": "altar", + "description": "The altar, fixed in place.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": null, + "readable": 0, + "inscription": null, + "template_id": null, + "bulk": "immovable", + "x": 2, + "y": 4, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "fixture", + "holds": "top", + "within_id": null, + "how": null, + "kit_key": "shrine/altar", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000002, + "character_id": null, + "name": "candle stand", + "description": "The candle stand, fixed in place.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": null, + "readable": 0, + "inscription": null, + "template_id": null, + "bulk": "immovable", + "x": 4, + "y": 7, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "fixture", + "holds": "top", + "within_id": null, + "how": null, + "kit_key": "shrine/candle stand", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000003, + "character_id": null, + "name": "statue", + "description": "The statue, fixed in place.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": null, + "readable": 0, + "inscription": null, + "template_id": null, + "bulk": "immovable", + "x": 1, + "y": 3, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "fixture", + "holds": "nothing", + "within_id": null, + "how": null, + "kit_key": "shrine/statue", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000004, + "character_id": null, + "name": "bench", + "description": "The bench, fixed in place.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": null, + "readable": 0, + "inscription": null, + "template_id": null, + "bulk": "immovable", + "x": 0, + "y": 4, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "fixture", + "holds": "nothing", + "within_id": null, + "how": null, + "kit_key": "shrine/bench", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": "wood", + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000005, + "character_id": null, + "name": "dried flowers", + "description": "The dried flowers, on the altar.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": null, + "readable": 0, + "inscription": null, + "template_id": null, + "bulk": "handy", + "x": null, + "y": null, + "use_kind": "ordinary", + "combustible": 1, + "disposition": "intact", + "fragility": "sturdy", + "tier": "portable", + "holds": null, + "within_id": 1000000001, + "how": "on", + "kit_key": "shrine/altar/dried flowers", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000006, + "character_id": null, + "name": "small bell", + "description": "The small bell, on the altar.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": null, + "readable": 0, + "inscription": null, + "template_id": null, + "bulk": "handy", + "x": null, + "y": null, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "portable", + "holds": null, + "within_id": 1000000001, + "how": "on", + "kit_key": "shrine/altar/small bell", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": "metal", + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000007, + "character_id": null, + "name": "prayer card", + "description": "The prayer card, on the altar.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": null, + "readable": 1, + "inscription": null, + "template_id": null, + "bulk": "handy", + "x": null, + "y": null, + "use_kind": "ordinary", + "combustible": 1, + "disposition": "intact", + "fragility": "sturdy", + "tier": "portable", + "holds": null, + "within_id": 1000000001, + "how": "on", + "kit_key": "shrine/altar/prayer card", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": "paper", + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000008, + "character_id": null, + "name": "candle", + "description": "The candle, on the candle stand.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": null, + "readable": 0, + "inscription": null, + "template_id": null, + "bulk": "handy", + "x": null, + "y": null, + "use_kind": "ordinary", + "combustible": 1, + "disposition": "intact", + "fragility": "sturdy", + "tier": "portable", + "holds": null, + "within_id": 1000000002, + "how": "on", + "kit_key": "shrine/candle stand/candle", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000009, + "character_id": null, + "name": "altar", + "description": "The altar, fixed in place.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": 1000000001, + "readable": 0, + "inscription": null, + "template_id": 1000000001, + "bulk": "immovable", + "x": 2, + "y": 4, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "fixture", + "holds": "top", + "within_id": null, + "how": null, + "kit_key": "shrine/altar", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000010, + "character_id": null, + "name": "candle stand", + "description": "The candle stand, fixed in place.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": 1000000001, + "readable": 0, + "inscription": null, + "template_id": 1000000002, + "bulk": "immovable", + "x": 4, + "y": 7, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "fixture", + "holds": "top", + "within_id": null, + "how": null, + "kit_key": "shrine/candle stand", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000011, + "character_id": null, + "name": "statue", + "description": "The statue, fixed in place.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": 1000000001, + "readable": 0, + "inscription": null, + "template_id": 1000000003, + "bulk": "immovable", + "x": 1, + "y": 3, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "fixture", + "holds": "nothing", + "within_id": null, + "how": null, + "kit_key": "shrine/statue", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000012, + "character_id": null, + "name": "bench", + "description": "The bench, fixed in place.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": 1000000001, + "readable": 0, + "inscription": null, + "template_id": 1000000004, + "bulk": "immovable", + "x": 0, + "y": 4, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "fixture", + "holds": "nothing", + "within_id": null, + "how": null, + "kit_key": "shrine/bench", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": "wood", + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000013, + "character_id": null, + "name": "dried flowers", + "description": "The dried flowers, on the altar.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": 1000000001, + "readable": 0, + "inscription": null, + "template_id": 1000000005, + "bulk": "handy", + "x": null, + "y": null, + "use_kind": "ordinary", + "combustible": 1, + "disposition": "intact", + "fragility": "sturdy", + "tier": "portable", + "holds": null, + "within_id": 1000000009, + "how": "on", + "kit_key": "shrine/altar/dried flowers", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000014, + "character_id": null, + "name": "small bell", + "description": "The small bell, on the altar.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": 1000000001, + "readable": 0, + "inscription": null, + "template_id": 1000000006, + "bulk": "handy", + "x": null, + "y": null, + "use_kind": "ordinary", + "combustible": 0, + "disposition": "intact", + "fragility": "sturdy", + "tier": "portable", + "holds": null, + "within_id": 1000000009, + "how": "on", + "kit_key": "shrine/altar/small bell", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": "metal", + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000015, + "character_id": null, + "name": "prayer card", + "description": "The prayer card, on the altar.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": 1000000001, + "readable": 1, + "inscription": null, + "template_id": 1000000007, + "bulk": "handy", + "x": null, + "y": null, + "use_kind": "ordinary", + "combustible": 1, + "disposition": "intact", + "fragility": "sturdy", + "tier": "portable", + "holds": null, + "within_id": 1000000009, + "how": "on", + "kit_key": "shrine/altar/prayer card", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": "paper", + "wear": null, + "worn": 0, + "supply": null + }, + { + "id": 1000000016, + "character_id": null, + "name": "candle", + "description": "The candle, on the candle stand.", + "properties": null, + "location_id": 1000000003, + "playthrough_id": 1000000001, + "readable": 0, + "inscription": null, + "template_id": 1000000008, + "bulk": "handy", + "x": null, + "y": null, + "use_kind": "ordinary", + "combustible": 1, + "disposition": "intact", + "fragility": "sturdy", + "tier": "portable", + "holds": null, + "within_id": 1000000010, + "how": "on", + "kit_key": "shrine/candle stand/candle", + "noticed_at": null, + "searched_at": null, + "hold": null, + "material": null, + "wear": null, + "worn": 0, + "supply": null + } + ], + "removed": [] + }, + "quest_steps": { + "rows": [], + "removed": [] + }, + "scenes": { + "rows": [ + { + "id": 1000000002, + "story_id": 1000000001, + "location_id": 1000000003, + "previous_scene_id": 1000000001, + "description": "You arrive at The Shrine room 1. You are unhurt. Nobody else is alive here. Fixed here, and not takeable: altar, candle stand, statue, bench. Lying here: dried flowers, small bell, prayer card, candle. You are carrying: nothing.", + "story_timestamp": "2026-12-03 08:01:00", + "summary": "You arrive at The Shrine room 1. You are unhurt. Nobody else is alive here. Fixed here, and not takeable: altar, candle stand, statue, bench. Lying here: dried flowers, small bell, prayer card, candle. You are carrying: nothing.", + "is_opening": 0, + "typed": "move The Shrine", + "resolved_action": "move", + "acted_on_type": "Location", + "acted_on_id": 1000000002, + "resolved_by": "grammar", + "engine_fallback": 1, + "engine_fact": "You are unhurt.\nNobody else is alive here.\nFixed here, and not takeable: altar, candle stand, statue, bench.\nLying here: dried flowers, small bell, prayer card, candle.\nYou are carrying: nothing." + } + ], + "removed": [] + }, + "characters_scenes": { + "rows": [ + { + "character_id": 1000000001, + "scene_id": 1000000002 + } + ], + "removed": [] + }, + "interactions": { + "rows": [], + "removed": [] + }, + "playthrough_endings": { + "rows": [], + "removed": [] + }, + "playthrough_beats": { + "rows": [], + "removed": [] + }, + "playthrough_npc_states": { + "rows": [], + "removed": [] + }, + "world_events": { + "rows": [], + "removed": [] + } + } + } + ] +} diff --git a/parity/scripts/a-seeded-temple-keeps-its-rooms.yml b/parity/scripts/a-seeded-temple-keeps-its-rooms.yml new file mode 100644 index 0000000..e2b683b --- /dev/null +++ b/parity/scripts/a-seeded-temple-keeps-its-rooms.yml @@ -0,0 +1,46 @@ +--- +story: The Shrine on the Square +steps: +- id: into-the-shrine + type: "/move The Shrine" + browser: + token: into-the-shrine + realizes: The Shrine + replies: + - purpose: location + content: + description: A stone hall under a low dome, candles guttering in niches. + lore: The townsfolk built the shrine before they paved the square. + place_kind: warehouse + parameters: + inside: a few rooms + storeys_above: ground floor only + storeys_below: a cellar + danger: safe + gradient: the same throughout + hazard: none + - purpose: location + content: + description: A plain stone room with a shelf of candles under a carved panel. + lore: Everyone who comes in stops here first. + items: [] + people: [] + - purpose: arrival + unavailable: true + expect: + location: The Shrine room 1 (realized) + exits: + - The Shrine room 2 (stub) + - The Shrine room 4 (stub) + - The Square (realized) + here: + - altar + - bench + - candle + - candle stand + - dried flowers + - prayer card + - small bell + - statue + changed: true + refused: false diff --git a/parity/worlds/the-shrine-on-the-square.sql b/parity/worlds/the-shrine-on-the-square.sql new file mode 100644 index 0000000..7437a1d --- /dev/null +++ b/parity/worlds/the-shrine-on-the-square.sql @@ -0,0 +1,679 @@ +PRAGMA foreign_keys=OFF; +BEGIN TRANSACTION; +CREATE TABLE IF NOT EXISTS "characters_scenes" ("character_id" integer NOT NULL, "scene_id" integer NOT NULL); +INSERT INTO characters_scenes VALUES(1000000001,1000000001); +CREATE TABLE IF NOT EXISTS "lab_exits_vantages" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "world" varchar NOT NULL, "name" varchar NOT NULL, "teaser" text NOT NULL, "reached_from" varchar, "danger" varchar, "absent" text, "expects_inside_quantifier" varchar, "expects_population" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); +CREATE TABLE IF NOT EXISTS "lab_realization_kinds" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "world" varchar NOT NULL, "name" varchar NOT NULL, "teaser" text NOT NULL, "reached_from" varchar, "inside" varchar, "danger" varchar, "population" varchar, "expects_inside" text, "expects_population" text, "expects_storeys_above" text, "expects_storeys_below" text, "expects_danger" text, "expects_gradient" text, "expects_hazard" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); +CREATE TABLE IF NOT EXISTS "players" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "token_digest" varchar NOT NULL, "monthly_limit_usd" decimal(10,4) DEFAULT 1.0 NOT NULL, "revoked_at" datetime(6), "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); +CREATE TABLE IF NOT EXISTS "playthrough_visits" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "location_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); +CREATE TABLE IF NOT EXISTS "refused_lines" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "typed" text NOT NULL, "state" json NOT NULL, "answers" json, "reading" json NOT NULL, "act_confidence" float, "thing_confidence" float, "refusal" json NOT NULL, "place" varchar, "weights" varchar, "playthrough_id" integer, "location_id" integer, "status" varchar DEFAULT 'new' NOT NULL, "label" json, "labelled_at" datetime(6), "note" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); +CREATE TABLE IF NOT EXISTS "ruby_llm_batches" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "provider_batch_id" varchar NOT NULL, "provider" varchar NOT NULL, "status" varchar NOT NULL, "raw_status" varchar, "completed" boolean DEFAULT FALSE NOT NULL, "chat_type" varchar, "batch_protocol" varchar, "chat_ids" json DEFAULT '[]', "request_counts" json, "reported_cost" json, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); +CREATE TABLE IF NOT EXISTS "ruby_llm_models" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "model_id" varchar NOT NULL, "name" varchar NOT NULL, "provider" varchar NOT NULL, "family" varchar, "model_created_at" datetime(6), "context_window" integer, "max_output_tokens" integer, "knowledge_cutoff" date, "modalities" json DEFAULT '{}', "capabilities" json DEFAULT '[]', "pricing" json DEFAULT '{}', "metadata" json DEFAULT '{}', "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "unlisted_at" datetime(6)); +CREATE TABLE IF NOT EXISTS "ruby_llm_tool_calls" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "message_id" integer NOT NULL, "tool_call_id" varchar NOT NULL, "name" varchar NOT NULL, "arguments" json DEFAULT '{}', "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "message_type" varchar NOT NULL, "result_type" varchar, "result_id" integer, "thought_signature" text, "approval" varchar, "remote" boolean DEFAULT FALSE NOT NULL); +CREATE TABLE IF NOT EXISTS "ruby_llm_usages" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "chat_type" varchar NOT NULL, "chat_id" integer NOT NULL, "message_type" varchar, "message_id" integer, "operation" varchar NOT NULL, "provider" varchar NOT NULL, "model" varchar NOT NULL, "status" varchar NOT NULL, "input_tokens" integer, "output_tokens" integer, "cache_read_tokens" integer, "cache_write_tokens" integer, "thinking_tokens" integer, "input_cost" decimal(16,10), "output_cost" decimal(16,10), "cache_read_cost" decimal(16,10), "cache_write_cost" decimal(16,10), "thinking_cost" decimal(16,10), "total_cost" decimal(16,10), "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "latency_ms" integer, CONSTRAINT chk_rails_71abd85d6e CHECK (operation IN ('chat', 'embedding', 'moderation', 'image', 'speech', 'transcription', 'ocr', 'rerank')), CONSTRAINT chk_rails_f50895962a CHECK (status IN ('pending', 'succeeded', 'failed', 'cancelled'))); +CREATE TABLE IF NOT EXISTS "ruby_llm_v2_backfills" ("task" varchar NOT NULL, "last_id" integer, "completed" boolean DEFAULT FALSE NOT NULL); +CREATE TABLE IF NOT EXISTS "universes" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "physics" text, "technology" text, "weapons" text, "civilizations" text, "geographies" text, "history" text, "economics" text, "politics" text, "religion" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "gravity" varchar, "carrying" varchar); +INSERT INTO universes VALUES(1000000001,'Ordinary physics.','Lanterns, iron keys and hand tools.','Short blades and cudgels.','Townsfolk who keep a shrine on their square.','A small town around one square.','The shrine is older than the square around it.','Coin and barter.','A town council keeps the peace.','The town leaves candles at the shrine.','2026-12-03 14:12:47.916162','2026-12-03 14:12:47.916162',NULL,NULL); +CREATE TABLE IF NOT EXISTS "characters" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "story_id" integer NOT NULL, "fullname" varchar, "nickname" varchar, "age" integer, "sex" varchar, "personality" text, "appearance" text, "likes" text, "dislikes" text, "fears" text, "backstory" text, "is_companion" boolean, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "race_id" integer NOT NULL, "is_protagonist" boolean DEFAULT FALSE NOT NULL, "location_id" integer, "deliberately_absent" boolean DEFAULT FALSE NOT NULL, "level" integer, "hit_die" integer, "strength" integer, "dexterity" integer, "will" integer, "hostile" boolean DEFAULT FALSE NOT NULL, "x" integer, "y" integer, "conscious_desire" text, "unconscious_desire" text, "recognized_need" text, "unrecognized_need" text, "desire_pursuit" varchar, "need_pursuit" varchar, "posted_to_id" integer, CONSTRAINT "fk_rails_56a213cbe2" +FOREIGN KEY ("race_id") + REFERENCES "races" ("id") +, CONSTRAINT "fk_rails_0b4b445641" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_4c54fc506e" +FOREIGN KEY ("posted_to_id") + REFERENCES "locations" ("id") + ON DELETE SET NULL, CONSTRAINT "fk_rails_6608c248e8" +FOREIGN KEY ("story_id") + REFERENCES "stories" ("id") +); +INSERT INTO characters VALUES(1000000001,1000000001,'Wren','Wren',31,'female','Curious and careful.','A grey coat and a lantern.','Quiet mornings.','Locked doors.','The dark under the shrine.','She grew up on the square and has never been inside the shrine.',0,'2026-12-03 14:12:48.053678','2026-12-03 14:12:48.053678',1000000001,1,NULL,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +CREATE TABLE IF NOT EXISTS "chats" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "model_id_string" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "ruby_llm_model_id" integer, "purpose" varchar, "playthrough_id" integer, "character_id" integer, "cancelled" boolean DEFAULT FALSE NOT NULL, "player_id" integer, CONSTRAINT "fk_rails_415520c982" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_5c87bd0780" +FOREIGN KEY ("character_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_ea73c47d5b" +FOREIGN KEY ("player_id") + REFERENCES "players" ("id") +, CONSTRAINT "fk_rails_d8a12df187" +FOREIGN KEY ("ruby_llm_model_id") + REFERENCES "ruby_llm_models" ("id") +); +CREATE TABLE IF NOT EXISTS "floors" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "location_id" integer NOT NULL, "rooms" integer NOT NULL, "danger" varchar, "hazard" varchar, "down_location_id" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "monster_level" integer, "levels_up" boolean DEFAULT FALSE NOT NULL, "minutes" integer, "safe_rooms" integer DEFAULT 0 NOT NULL, "healing_count" integer DEFAULT 0 NOT NULL, "healing_name" varchar, "healing_description" text, CONSTRAINT "fk_rails_8a0268155a" +FOREIGN KEY ("down_location_id") + REFERENCES "locations" ("id") + ON DELETE SET NULL, CONSTRAINT "fk_rails_ce8b005cb2" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") + ON DELETE CASCADE); +CREATE TABLE IF NOT EXISTS "interactions" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "character_id" integer NOT NULL, "scene_id" integer, "location_id" integer, "pre_thought" text, "pre_feeling" text, "action" text, "post_feeling" text, "post_thought" text, "inner_resolution" text, "summary" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "user_input" text, "engine_action" varchar, "action_status" varchar, "action_fact" text, CONSTRAINT "fk_rails_294d4ae9f8" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_6b73a2cd17" +FOREIGN KEY ("character_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_b73583a008" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "items" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "character_id" integer, "name" varchar, "description" text, "properties" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "location_id" integer, "playthrough_id" integer, "readable" boolean DEFAULT FALSE NOT NULL, "inscription" text, "template_id" integer, "bulk" varchar DEFAULT 'handy' NOT NULL, "x" integer, "y" integer, "use_kind" varchar DEFAULT 'ordinary' NOT NULL, "combustible" boolean DEFAULT FALSE NOT NULL, "disposition" varchar DEFAULT 'intact' NOT NULL, "fragility" varchar DEFAULT 'sturdy' NOT NULL, "tier" varchar DEFAULT 'portable' NOT NULL, "holds" varchar, "within_id" integer, "how" varchar, "kit_key" varchar, "noticed_at" datetime(6), "searched_at" datetime(6), "hold" varchar, "material" varchar, "wear" varchar, "worn" boolean DEFAULT FALSE NOT NULL, "supply" varchar, CONSTRAINT "fk_rails_e8ed83a2e6" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_35423c7ef8" +FOREIGN KEY ("character_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_5248e92099" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +); +CREATE TABLE IF NOT EXISTS "lab_exits_judgements" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "vantage_id" integer NOT NULL, "name" varchar NOT NULL, "name_key" varchar NOT NULL, "expects_inside" text, "expects_population" text, "verdict" varchar, "aspects" text, "note" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_cbf2b734ae" +FOREIGN KEY ("vantage_id") + REFERENCES "lab_exits_vantages" ("id") +); +CREATE TABLE IF NOT EXISTS "lab_exits_samples" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "vantage_id" integer NOT NULL, "row" json DEFAULT '{}' NOT NULL, "verdict" varchar, "aspects" text, "note" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_3cc36a20a9" +FOREIGN KEY ("vantage_id") + REFERENCES "lab_exits_vantages" ("id") +); +CREATE TABLE IF NOT EXISTS "lab_realization_samples" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "kind_id" integer NOT NULL, "row" json DEFAULT '{}' NOT NULL, "verdict" varchar, "aspects" text, "note" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_7bb6f06ff4" +FOREIGN KEY ("kind_id") + REFERENCES "lab_realization_kinds" ("id") +); +CREATE TABLE IF NOT EXISTS "location_connections" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "location_id" integer NOT NULL, "connected_location_id" integer NOT NULL, "distance" text, "time_to_travel" text, "travel_method" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "hazard" varchar, "hazard_die" integer, "barrier" varchar DEFAULT 'open' NOT NULL, "key_template_id" integer, CONSTRAINT "fk_rails_99792c7943" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_34dc49debe" +FOREIGN KEY ("key_template_id") + REFERENCES "items" ("id") + ON DELETE SET NULL, CONSTRAINT "fk_rails_37a61eef17" +FOREIGN KEY ("connected_location_id") + REFERENCES "locations" ("id") +); +INSERT INTO location_connections VALUES(1000000001,1000000001,1000000002,'adjacent','about a minute','walking','2026-12-03 14:12:48.140051','2026-12-03 14:12:48.140051',NULL,NULL,'open',NULL); +INSERT INTO location_connections VALUES(1000000002,1000000002,1000000001,'adjacent','about a minute','walking','2026-12-03 14:12:48.148926','2026-12-03 14:12:48.148926',NULL,NULL,'open',NULL); +CREATE TABLE IF NOT EXISTS "locations" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "story_id" integer NOT NULL, "name" varchar, "description" text, "lore" text, "last_protagonist_visit" datetime(6), "parent_location_id" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "detail_level" varchar DEFAULT 'stub' NOT NULL, "teaser" text, "mobile" boolean DEFAULT FALSE NOT NULL, "danger" varchar DEFAULT 'safe' NOT NULL, "hazard" varchar, "hazard_die" integer, "x" integer, "y" integer, "z" integer, "width" integer, "depth" integer, "population" varchar, "generation_checkpoint" json, "surface" varchar, "kind" varchar, "density" varchar, "sanctuary" boolean DEFAULT FALSE NOT NULL, CONSTRAINT "fk_rails_5bc98acf09" +FOREIGN KEY ("parent_location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_fedd9b21a0" +FOREIGN KEY ("story_id") + REFERENCES "stories" ("id") +); +INSERT INTO locations VALUES(1000000001,1000000001,'The Square','A cobbled square with a well in the middle and the shrine''s door on its north side.','Market days are held here.',NULL,NULL,'2026-12-03 14:12:47.973166','2026-12-03 14:12:47.973166','realized','The town square.',0,'safe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'nobody',NULL,NULL,NULL,NULL,0); +INSERT INTO locations VALUES(1000000002,1000000001,'The Shrine',NULL,NULL,NULL,NULL,'2026-12-03 14:12:47.985151','2026-12-03 14:12:47.985151','stub','A stone shrine with its door standing open.',0,'safe',NULL,NULL,NULL,NULL,NULL,12,10,'nobody',NULL,NULL,'temple',NULL,0); +CREATE TABLE IF NOT EXISTS "locations_world_events" ("location_id" integer NOT NULL, "world_event_id" integer NOT NULL, CONSTRAINT "fk_rails_861146f35c" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_16317bfdf9" +FOREIGN KEY ("world_event_id") + REFERENCES "world_events" ("id") +); +CREATE TABLE IF NOT EXISTS "messages" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "chat_id" integer NOT NULL, "role" varchar, "content" text, "model_id_string" varchar, "input_tokens" integer, "output_tokens" integer, "tool_call_id" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "model_id" integer, "scene_id" integer, "content_raw" json, "cache_until_here" boolean DEFAULT FALSE NOT NULL, "finish_reason" varchar, "citations" json, "server_tool_calls" json, "raw_content" json, "raw_reasoning" json, CONSTRAINT "fk_rails_c02b47ad97" +FOREIGN KEY ("model_id") + REFERENCES "ruby_llm_models" ("id") +, CONSTRAINT "fk_rails_0f670de7ba" +FOREIGN KEY ("chat_id") + REFERENCES "chats" ("id") +, CONSTRAINT "fk_rails_5c4d747b35" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_beats" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "quest_step_id" integer NOT NULL, "reached_at" datetime(6) NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_d479d5ffac" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_c536cc5a9f" +FOREIGN KEY ("quest_step_id") + REFERENCES "quest_steps" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_blows" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "attacker_id" integer NOT NULL, "target_id" integer NOT NULL, "location_id" integer NOT NULL, "damage" integer NOT NULL, "hp_after" integer NOT NULL, "round" integer NOT NULL, "sequence" integer NOT NULL, "story_timestamp" datetime(6) NOT NULL, "scene_id" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_f0e8a189c5" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_9a2b0679db" +FOREIGN KEY ("target_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_d02f38aa6d" +FOREIGN KEY ("attacker_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_104e085e3d" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_83e55c02a1" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_commands" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "request_token" varchar NOT NULL, "command" text NOT NULL, "status" varchar DEFAULT 'pending' NOT NULL, "result_scene_id" integer, "refusal" json DEFAULT '{}' NOT NULL, "error_kind" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "journal" json DEFAULT '{}' NOT NULL, CONSTRAINT "fk_rails_53f23eb49f" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_69c7d16a1a" +FOREIGN KEY ("result_scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_drifts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "scene_id" integer, "location_id" integer, "action" varchar NOT NULL, "command" text NOT NULL, "offered" text, "story_timestamp" datetime(6), "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_018f29e0ac" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_094a605342" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_45044856a9" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_due_endings" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "quest_outcome_id" integer NOT NULL, "due_at" datetime(6) NOT NULL, "declined_at" datetime(6), "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_c471335e2f" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_b8e95530cf" +FOREIGN KEY ("quest_outcome_id") + REFERENCES "quest_outcomes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_endings" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "quest_outcome_id" integer NOT NULL, "reached_at" datetime(6) NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_762b78023d" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_2220d324b0" +FOREIGN KEY ("quest_outcome_id") + REFERENCES "quest_outcomes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_feedbacks" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "scene_id" integer NOT NULL, "verdict" varchar NOT NULL, "note" text, "prose_model" varchar, "prose_purpose" varchar, "prose_models" text, "answering_models" text, "input_tokens" integer, "output_tokens" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "prose_prompt_digest" varchar, CONSTRAINT "fk_rails_99ee3b49ea" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_247709935a" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_floors" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "location_id" integer NOT NULL, "arrived_at" datetime(6) NOT NULL, "level" integer, "scene_id" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "fell_at" datetime(6), CONSTRAINT "fk_rails_340e8cdc38" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_f82b72b677" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_b4a8914069" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_npc_states" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "character_id" integer NOT NULL, "location_id" integer, "following" boolean DEFAULT FALSE NOT NULL, "ceasefire" boolean DEFAULT FALSE NOT NULL, "peace_after_blow_id" integer DEFAULT 0 NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "noticed_at" datetime(6), CONSTRAINT "fk_rails_ef100d7841" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_71a135780d" +FOREIGN KEY ("character_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_984efad0e9" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_overreaches" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "scene_id" integer, "location_id" integer, "action" varchar NOT NULL, "command" text NOT NULL, "acted" text NOT NULL, "unacted" text NOT NULL, "story_timestamp" datetime(6), "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_b903d1bc16" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_9aac75595a" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_879cc0f78c" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_paragraphs" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "scene_id" integer NOT NULL, "author" varchar DEFAULT 'player' NOT NULL, "text" text NOT NULL, "audit" json, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "consent" varchar DEFAULT 'none' NOT NULL, "requests" json, "prompt_digest" varchar, CONSTRAINT "fk_rails_db3983d32c" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_52ef8100a0" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_passages" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "location_connection_id" integer NOT NULL, "opened_by_item_id" integer, "means" varchar NOT NULL, "opened_at" datetime(6) NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_7bdf6a743a" +FOREIGN KEY ("location_connection_id") + REFERENCES "location_connections" ("id") + ON DELETE CASCADE, CONSTRAINT "fk_rails_75c2355411" +FOREIGN KEY ("opened_by_item_id") + REFERENCES "items" ("id") + ON DELETE SET NULL, CONSTRAINT "fk_rails_995c25e2fd" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") + ON DELETE CASCADE); +CREATE TABLE IF NOT EXISTS "playthrough_rests" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "location_id" integer NOT NULL, "recovered" integer NOT NULL, "hp_after" integer NOT NULL, "story_timestamp" datetime(6) NOT NULL, "scene_id" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_d40226d075" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_52d7e18410" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_68b103131a" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_tolls" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "character_id" integer NOT NULL, "location_id" integer NOT NULL, "location_connection_id" integer, "hazard" varchar NOT NULL, "saved" boolean DEFAULT FALSE NOT NULL, "damage" integer NOT NULL, "hp_after" integer NOT NULL, "sequence" integer NOT NULL, "story_timestamp" datetime(6) NOT NULL, "scene_id" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_83dfd307ab" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_443984de3a" +FOREIGN KEY ("location_connection_id") + REFERENCES "location_connections" ("id") +, CONSTRAINT "fk_rails_8a2212da5c" +FOREIGN KEY ("character_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_6ec4904a86" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_af4dd03665" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_turn_events" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_command_id" integer NOT NULL, "sequence" integer NOT NULL, "kind" varchar NOT NULL, "data" json DEFAULT '{}' NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_c7a6770f24" +FOREIGN KEY ("playthrough_command_id") + REFERENCES "playthrough_commands" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_vitals" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "character_id" integer NOT NULL, "hp_current" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "provoked_at" datetime(6), CONSTRAINT "fk_rails_03cf4b1b8e" +FOREIGN KEY ("character_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_9956f79aa5" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +); +CREATE TABLE IF NOT EXISTS "playthrough_volitions" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "playthrough_id" integer NOT NULL, "character_id" integer NOT NULL, "location_id" integer NOT NULL, "scene_id" integer, "chosen" varchar NOT NULL, "status" varchar NOT NULL, "fact" text NOT NULL, "serves" varchar NOT NULL, "round" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "decided_by" varchar, "system_one_error" varchar, CONSTRAINT "fk_rails_55e6f9e865" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +, CONSTRAINT "fk_rails_0c408b6253" +FOREIGN KEY ("character_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_1824dea9f6" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_a054701564" +FOREIGN KEY ("scene_id") + REFERENCES "scenes" ("id") +); +CREATE TABLE IF NOT EXISTS "playthroughs" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "story_id" integer NOT NULL, "character_id" integer, "current_location_id" integer, "current_scene_id" integer, "token" varchar NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "ended_at" datetime(6), "player_id" integer, "mode" varchar DEFAULT 'narrated' NOT NULL, CONSTRAINT "fk_rails_9b48509224" +FOREIGN KEY ("current_scene_id") + REFERENCES "scenes" ("id") +, CONSTRAINT "fk_rails_3a7e48fa36" +FOREIGN KEY ("current_location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_5b54078c4b" +FOREIGN KEY ("character_id") + REFERENCES "characters" ("id") +, CONSTRAINT "fk_rails_ab75586f4b" +FOREIGN KEY ("player_id") + REFERENCES "players" ("id") +, CONSTRAINT "fk_rails_3d6d3a9c5a" +FOREIGN KEY ("story_id") + REFERENCES "stories" ("id") +); +CREATE TABLE IF NOT EXISTS "quest_outcomes" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "quest_id" integer NOT NULL, "name" varchar NOT NULL, "summary" text NOT NULL, "is_default" boolean DEFAULT FALSE NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "condition" varchar, "minutes" integer, "ramification_summary" text, "ramification_minutes" integer, "step_position" integer, "character_id" integer, CONSTRAINT "fk_rails_acf8ece7c5" +FOREIGN KEY ("quest_id") + REFERENCES "quests" ("id") +); +CREATE TABLE IF NOT EXISTS "quest_steps" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "quest_id" integer NOT NULL, "position" integer NOT NULL, "summary" text NOT NULL, "trigger_kind" varchar NOT NULL, "target_name" varchar, "teaser" text, "target_type" varchar, "target_id" integer, "minutes" integer, "bound_at" datetime(6), "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "companion_id" integer, CONSTRAINT "fk_rails_ba1603d17b" +FOREIGN KEY ("quest_id") + REFERENCES "quests" ("id") +); +CREATE TABLE IF NOT EXISTS "quests" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "story_id" integer NOT NULL, "parent_quest_id" integer, "title" varchar NOT NULL, "premise" text NOT NULL, "status" varchar DEFAULT 'open' NOT NULL, "contributes" boolean DEFAULT TRUE NOT NULL, "origin" varchar DEFAULT 'seeded' NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_a64954ae79" +FOREIGN KEY ("parent_quest_id") + REFERENCES "quests" ("id") +, CONSTRAINT "fk_rails_fa77fc496b" +FOREIGN KEY ("story_id") + REFERENCES "stories" ("id") +); +CREATE TABLE IF NOT EXISTS "races" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "universe_id" integer NOT NULL, "name" varchar NOT NULL, "description" text NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "monstrous" boolean DEFAULT FALSE NOT NULL, CONSTRAINT "fk_rails_c25ac61605" +FOREIGN KEY ("universe_id") + REFERENCES "universes" ("id") +); +INSERT INTO races VALUES(1000000001,1000000001,'Townsfolk','Ordinary people of the town.','2026-12-03 14:12:47.919905','2026-12-03 14:12:47.919905',0); +CREATE TABLE IF NOT EXISTS "relay_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "player_id" integer NOT NULL, "route" varchar NOT NULL, "model" varchar NOT NULL, "stream" boolean DEFAULT FALSE NOT NULL, "status" varchar DEFAULT 'open' NOT NULL, "reserved_usd" decimal(12,6) NOT NULL, "cost_usd" decimal(12,6), "cost_source" varchar, "input_tokens" integer, "output_tokens" integer, "upstream_status" integer, "finished_at" datetime(6), "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_deae27bd71" +FOREIGN KEY ("player_id") + REFERENCES "players" ("id") +); +CREATE TABLE IF NOT EXISTS "scenes" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "story_id" integer NOT NULL, "location_id" integer NOT NULL, "previous_scene_id" integer, "description" text, "story_timestamp" datetime(6), "summary" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "is_opening" boolean DEFAULT FALSE NOT NULL, "typed" text, "resolved_action" varchar, "acted_on_type" varchar, "acted_on_id" integer, "resolved_by" varchar, "engine_fallback" boolean DEFAULT FALSE NOT NULL, "engine_fact" text, CONSTRAINT "fk_rails_5cc24f985a" +FOREIGN KEY ("previous_scene_id") + REFERENCES "scenes" ("id") +, CONSTRAINT "fk_rails_abfe1c0369" +FOREIGN KEY ("location_id") + REFERENCES "locations" ("id") +, CONSTRAINT "fk_rails_38ea512481" +FOREIGN KEY ("story_id") + REFERENCES "stories" ("id") +); +INSERT INTO scenes VALUES(1000000001,1000000001,1000000001,NULL,'You stand on the square facing the shrine''s door.','2026-12-03 08:00:00','Wren arrives on the square.','2026-12-03 14:12:48.250241','2026-12-03 14:12:48.250241',1,NULL,NULL,NULL,NULL,NULL,0,NULL); +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "genre" varchar, "preface" text, "summary" text, "start_time" datetime(6), "universe_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "generation_snapshot" text, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" +FOREIGN KEY ("universe_id") + REFERENCES "universes" ("id") +); +INSERT INTO stories VALUES(1000000001,'The Shrine on the Square (engine sweep)','town adventure','A shrine stands on one side of the town square.','Wren goes into the shrine.','2026-12-03 08:00:00',1000000001,'2026-12-03 14:12:47.939522','2026-12-03 14:12:47.939522',NULL,NULL,NULL); +CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "cost_source" varchar DEFAULT 'estimated' NOT NULL, "latency_ms" integer, CONSTRAINT "fk_rails_4ae941c854" +FOREIGN KEY ("player_id") + REFERENCES "players" ("id") +, CONSTRAINT "fk_rails_75847e1556" +FOREIGN KEY ("playthrough_id") + REFERENCES "playthroughs" ("id") +); +CREATE TABLE IF NOT EXISTS "world_events" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "world_mechanic_id" integer, "story_id" integer NOT NULL, "occurred_at" datetime(6) NOT NULL, "summary" text NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "source" varchar NOT NULL, "playthrough_id" integer, "scheduled_for" datetime(6), "fired_at" datetime(6), CONSTRAINT "fk_rails_cafc0959e8" +FOREIGN KEY ("story_id") + REFERENCES "stories" ("id") +, CONSTRAINT "fk_rails_efc6cdec27" +FOREIGN KEY ("world_mechanic_id") + REFERENCES "world_mechanics" ("id") +); +CREATE TABLE IF NOT EXISTS "world_mechanics" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "story_id" integer NOT NULL, "name" varchar NOT NULL, "kind" varchar NOT NULL, "cadence" varchar NOT NULL, "description" text, "last_run_at" datetime(6), "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_d7328bbbe5" +FOREIGN KEY ("story_id") + REFERENCES "stories" ("id") +); +CREATE TABLE IF NOT EXISTS "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY); +INSERT INTO schema_migrations VALUES('20261031180000'); +INSERT INTO schema_migrations VALUES('20261031150000'); +INSERT INTO schema_migrations VALUES('20261031120000'); +INSERT INTO schema_migrations VALUES('20261031090000'); +INSERT INTO schema_migrations VALUES('20261030230000'); +INSERT INTO schema_migrations VALUES('20261030200000'); +INSERT INTO schema_migrations VALUES('20261030120000'); +INSERT INTO schema_migrations VALUES('20261029154235'); +INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261025230000'); +INSERT INTO schema_migrations VALUES('20261025200000'); +INSERT INTO schema_migrations VALUES('20261025120000'); +INSERT INTO schema_migrations VALUES('20261024120000'); +INSERT INTO schema_migrations VALUES('20261015213000'); +INSERT INTO schema_migrations VALUES('20261015200000'); +INSERT INTO schema_migrations VALUES('20261015180000'); +INSERT INTO schema_migrations VALUES('20261015120000'); +INSERT INTO schema_migrations VALUES('20261010220000'); +INSERT INTO schema_migrations VALUES('20261010180000'); +INSERT INTO schema_migrations VALUES('20261010120000'); +INSERT INTO schema_migrations VALUES('20260929023507'); +INSERT INTO schema_migrations VALUES('20260928124453'); +INSERT INTO schema_migrations VALUES('20260928102823'); +INSERT INTO schema_migrations VALUES('20260928035434'); +INSERT INTO schema_migrations VALUES('20260928035429'); +INSERT INTO schema_migrations VALUES('20260928031026'); +INSERT INTO schema_migrations VALUES('20260928025950'); +INSERT INTO schema_migrations VALUES('20260928020741'); +INSERT INTO schema_migrations VALUES('20260927152056'); +INSERT INTO schema_migrations VALUES('20260927031841'); +INSERT INTO schema_migrations VALUES('20260927031839'); +INSERT INTO schema_migrations VALUES('20260927031837'); +INSERT INTO schema_migrations VALUES('20260927031835'); +INSERT INTO schema_migrations VALUES('20260927031834'); +INSERT INTO schema_migrations VALUES('20260926195041'); +INSERT INTO schema_migrations VALUES('20260922141619'); +INSERT INTO schema_migrations VALUES('20260922141618'); +INSERT INTO schema_migrations VALUES('20260922141617'); +INSERT INTO schema_migrations VALUES('20260919202606'); +INSERT INTO schema_migrations VALUES('20260919202605'); +INSERT INTO schema_migrations VALUES('20260917133823'); +INSERT INTO schema_migrations VALUES('20260910041334'); +INSERT INTO schema_migrations VALUES('20260910025040'); +INSERT INTO schema_migrations VALUES('20260909030346'); +INSERT INTO schema_migrations VALUES('20260909023028'); +INSERT INTO schema_migrations VALUES('20260909023014'); +INSERT INTO schema_migrations VALUES('20260908203558'); +INSERT INTO schema_migrations VALUES('20260908155546'); +INSERT INTO schema_migrations VALUES('20260908120000'); +INSERT INTO schema_migrations VALUES('20260907150000'); +INSERT INTO schema_migrations VALUES('20260907140000'); +INSERT INTO schema_migrations VALUES('20260907120000'); +INSERT INTO schema_migrations VALUES('20260906130000'); +INSERT INTO schema_migrations VALUES('20260906120000'); +INSERT INTO schema_migrations VALUES('20260905150000'); +INSERT INTO schema_migrations VALUES('20260905140000'); +INSERT INTO schema_migrations VALUES('20260905130000'); +INSERT INTO schema_migrations VALUES('20260905120000'); +INSERT INTO schema_migrations VALUES('20260905110000'); +INSERT INTO schema_migrations VALUES('20260905100001'); +INSERT INTO schema_migrations VALUES('20260905100000'); +INSERT INTO schema_migrations VALUES('20260905090100'); +INSERT INTO schema_migrations VALUES('20260905090000'); +INSERT INTO schema_migrations VALUES('20260904190000'); +INSERT INTO schema_migrations VALUES('20260904180000'); +INSERT INTO schema_migrations VALUES('20260904170000'); +INSERT INTO schema_migrations VALUES('20260904160000'); +INSERT INTO schema_migrations VALUES('20260904120000'); +INSERT INTO schema_migrations VALUES('20260903170000'); +INSERT INTO schema_migrations VALUES('20260903120000'); +INSERT INTO schema_migrations VALUES('20260902120000'); +INSERT INTO schema_migrations VALUES('20260901170000'); +INSERT INTO schema_migrations VALUES('20260901160000'); +INSERT INTO schema_migrations VALUES('20260901120000'); +INSERT INTO schema_migrations VALUES('20260831140000'); +INSERT INTO schema_migrations VALUES('20260831130000'); +INSERT INTO schema_migrations VALUES('20260831120000'); +INSERT INTO schema_migrations VALUES('20260831000000'); +INSERT INTO schema_migrations VALUES('20260830220946'); +INSERT INTO schema_migrations VALUES('20260830220945'); +INSERT INTO schema_migrations VALUES('20260830210000'); +INSERT INTO schema_migrations VALUES('20260830200001'); +INSERT INTO schema_migrations VALUES('20260830200000'); +INSERT INTO schema_migrations VALUES('20260830192215'); +INSERT INTO schema_migrations VALUES('20260830192214'); +INSERT INTO schema_migrations VALUES('20250824193519'); +INSERT INTO schema_migrations VALUES('20250823024100'); +INSERT INTO schema_migrations VALUES('20250823024050'); +INSERT INTO schema_migrations VALUES('20250823024037'); +INSERT INTO schema_migrations VALUES('20250823024029'); +INSERT INTO schema_migrations VALUES('20250823024021'); +INSERT INTO schema_migrations VALUES('20250823024013'); +INSERT INTO schema_migrations VALUES('20250823023950'); +INSERT INTO schema_migrations VALUES('20250823023942'); +INSERT INTO schema_migrations VALUES('20250823023925'); +INSERT INTO schema_migrations VALUES('20250822184651'); +INSERT INTO schema_migrations VALUES('20250822184650'); +INSERT INTO schema_migrations VALUES('20250822184649'); +CREATE TABLE IF NOT EXISTS "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); +INSERT INTO ar_internal_metadata VALUES('environment','test','2026-12-03 14:12:46.582387','2026-12-03 14:12:46.582390'); +INSERT INTO ar_internal_metadata VALUES('schema_sha1','329070adbe704f45d3baf76252364b118fcf372d','2026-12-03 14:12:46.586255','2026-12-03 14:12:46.586257'); +PRAGMA writable_schema=ON; +CREATE TABLE IF NOT EXISTS sqlite_sequence(name,seq); +DELETE FROM sqlite_sequence; +INSERT INTO sqlite_sequence VALUES('lab_exits_vantages',1000000000); +INSERT INTO sqlite_sequence VALUES('lab_realization_kinds',1000000000); +INSERT INTO sqlite_sequence VALUES('players',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_visits',1000000000); +INSERT INTO sqlite_sequence VALUES('refused_lines',1000000000); +INSERT INTO sqlite_sequence VALUES('ruby_llm_batches',1000000000); +INSERT INTO sqlite_sequence VALUES('ruby_llm_models',1000000000); +INSERT INTO sqlite_sequence VALUES('ruby_llm_tool_calls',1000000000); +INSERT INTO sqlite_sequence VALUES('ruby_llm_usages',1000000000); +INSERT INTO sqlite_sequence VALUES('universes',1000000001); +INSERT INTO sqlite_sequence VALUES('characters',1000000001); +INSERT INTO sqlite_sequence VALUES('chats',1000000000); +INSERT INTO sqlite_sequence VALUES('floors',1000000000); +INSERT INTO sqlite_sequence VALUES('interactions',1000000000); +INSERT INTO sqlite_sequence VALUES('items',1000000000); +INSERT INTO sqlite_sequence VALUES('lab_exits_judgements',1000000000); +INSERT INTO sqlite_sequence VALUES('lab_exits_samples',1000000000); +INSERT INTO sqlite_sequence VALUES('lab_realization_samples',1000000000); +INSERT INTO sqlite_sequence VALUES('location_connections',1000000002); +INSERT INTO sqlite_sequence VALUES('locations',1000000002); +INSERT INTO sqlite_sequence VALUES('messages',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_beats',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_blows',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_commands',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_drifts',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_due_endings',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_endings',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_feedbacks',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_floors',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_npc_states',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_overreaches',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_paragraphs',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_passages',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_rests',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_tolls',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_turn_events',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_vitals',1000000000); +INSERT INTO sqlite_sequence VALUES('playthrough_volitions',1000000000); +INSERT INTO sqlite_sequence VALUES('playthroughs',1000000000); +INSERT INTO sqlite_sequence VALUES('quest_outcomes',1000000000); +INSERT INTO sqlite_sequence VALUES('quest_steps',1000000000); +INSERT INTO sqlite_sequence VALUES('quests',1000000000); +INSERT INTO sqlite_sequence VALUES('races',1000000001); +INSERT INTO sqlite_sequence VALUES('relay_receipts',1000000000); +INSERT INTO sqlite_sequence VALUES('scenes',1000000001); +INSERT INTO sqlite_sequence VALUES('stories',1000000001); +INSERT INTO sqlite_sequence VALUES('system_one_receipts',1000000000); +INSERT INTO sqlite_sequence VALUES('world_events',1000000000); +INSERT INTO sqlite_sequence VALUES('world_mechanics',1000000000); +CREATE INDEX "index_characters_scenes_on_character_id_and_scene_id" ON "characters_scenes" ("character_id", "scene_id"); +CREATE INDEX "index_characters_scenes_on_scene_id_and_character_id" ON "characters_scenes" ("scene_id", "character_id"); +CREATE UNIQUE INDEX "index_players_on_name" ON "players" ("name"); +CREATE UNIQUE INDEX "index_players_on_token_digest" ON "players" ("token_digest"); +CREATE INDEX "index_playthrough_visits_on_location_id" ON "playthrough_visits" ("location_id"); +CREATE UNIQUE INDEX "index_playthrough_visits_on_playthrough_and_location" ON "playthrough_visits" ("playthrough_id", "location_id"); +CREATE INDEX "index_playthrough_visits_on_playthrough_id" ON "playthrough_visits" ("playthrough_id"); +CREATE INDEX "index_refused_lines_on_status" ON "refused_lines" ("status"); +CREATE UNIQUE INDEX "index_ruby_llm_batches_on_provider_and_provider_batch_id" ON "ruby_llm_batches" ("provider", "provider_batch_id"); +CREATE INDEX "index_ruby_llm_batches_on_status" ON "ruby_llm_batches" ("status"); +CREATE INDEX "index_ruby_llm_models_on_family" ON "ruby_llm_models" ("family"); +CREATE UNIQUE INDEX "index_ruby_llm_models_on_provider_and_model_id" ON "ruby_llm_models" ("provider", "model_id"); +CREATE INDEX "index_ruby_llm_models_on_provider" ON "ruby_llm_models" ("provider"); +CREATE INDEX "index_ruby_llm_tool_calls_on_message_type_and_message_id" ON "ruby_llm_tool_calls" ("message_type", "message_id"); +CREATE INDEX "index_ruby_llm_tool_calls_on_name" ON "ruby_llm_tool_calls" ("name"); +CREATE INDEX "index_ruby_llm_tool_calls_on_result_type_and_result_id" ON "ruby_llm_tool_calls" ("result_type", "result_id"); +CREATE UNIQUE INDEX "index_ruby_llm_tool_calls_on_tool_call_id" ON "ruby_llm_tool_calls" ("tool_call_id"); +CREATE INDEX "index_ruby_llm_usages_on_chat_type_and_chat_id" ON "ruby_llm_usages" ("chat_type", "chat_id"); +CREATE INDEX "index_ruby_llm_usages_on_message_type_and_message_id" ON "ruby_llm_usages" ("message_type", "message_id"); +CREATE INDEX "index_ruby_llm_usages_on_status" ON "ruby_llm_usages" ("status"); +CREATE UNIQUE INDEX "index_ruby_llm_v2_backfills_on_task" ON "ruby_llm_v2_backfills" ("task"); +CREATE UNIQUE INDEX "index_characters_on_story_id_and_lower_fullname" ON "characters" (story_id, LOWER(fullname)); +CREATE INDEX "index_characters_on_location_id_and_hostile" ON "characters" ("location_id", "hostile"); +CREATE INDEX "index_characters_on_location_id_and_id" ON "characters" ("location_id", "id"); +CREATE INDEX "index_characters_on_location_id" ON "characters" ("location_id"); +CREATE INDEX "index_characters_on_posted_to_id" ON "characters" ("posted_to_id"); +CREATE INDEX "index_characters_on_race_id" ON "characters" ("race_id"); +CREATE INDEX "index_characters_on_story_id_and_is_protagonist" ON "characters" ("story_id", "is_protagonist"); +CREATE INDEX "index_characters_on_story_id" ON "characters" ("story_id"); +CREATE INDEX "index_chats_on_character_id" ON "chats" ("character_id"); +CREATE INDEX "index_chats_on_player_id" ON "chats" ("player_id"); +CREATE INDEX "index_chats_on_conversation_key" ON "chats" ("playthrough_id", "character_id", "purpose"); +CREATE INDEX "index_chats_on_playthrough_id" ON "chats" ("playthrough_id"); +CREATE INDEX "index_chats_on_ruby_llm_model_id" ON "chats" ("ruby_llm_model_id"); +CREATE INDEX "index_floors_on_down_location_id" ON "floors" ("down_location_id"); +CREATE UNIQUE INDEX "index_floors_on_location_id" ON "floors" ("location_id"); +CREATE INDEX "index_interactions_on_character_id" ON "interactions" ("character_id"); +CREATE INDEX "index_interactions_on_location_id" ON "interactions" ("location_id"); +CREATE INDEX "index_interactions_on_scene_id" ON "interactions" ("scene_id"); +CREATE INDEX "index_items_on_character_id" ON "items" ("character_id"); +CREATE INDEX "index_items_on_location_id_and_character_id" ON "items" ("location_id", "character_id"); +CREATE INDEX "index_items_on_location_id" ON "items" ("location_id"); +CREATE INDEX "index_items_on_playthrough_id_and_id" ON "items" ("playthrough_id", "id"); +CREATE INDEX "index_items_on_playthrough_id_and_template_id" ON "items" ("playthrough_id", "template_id"); +CREATE INDEX "index_items_on_playthrough_id" ON "items" ("playthrough_id"); +CREATE INDEX "index_items_on_template_id" ON "items" ("template_id"); +CREATE INDEX "index_items_on_within_id" ON "items" ("within_id"); +CREATE UNIQUE INDEX "index_lab_exits_judgements_on_place" ON "lab_exits_judgements" ("vantage_id", "name_key"); +CREATE INDEX "index_lab_exits_judgements_on_vantage_id" ON "lab_exits_judgements" ("vantage_id"); +CREATE INDEX "index_lab_exits_samples_on_vantage_id" ON "lab_exits_samples" ("vantage_id"); +CREATE INDEX "index_lab_realization_samples_on_kind_id" ON "lab_realization_samples" ("kind_id"); +CREATE INDEX "index_location_connections_on_connected_location_id" ON "location_connections" ("connected_location_id"); +CREATE INDEX "index_location_connections_on_key_template_id" ON "location_connections" ("key_template_id"); +CREATE UNIQUE INDEX "idx_on_location_id_connected_location_id_a0efda2bf6" ON "location_connections" ("location_id", "connected_location_id"); +CREATE INDEX "index_location_connections_on_location_id" ON "location_connections" ("location_id"); +CREATE UNIQUE INDEX "index_locations_on_story_id_and_lower_name" ON "locations" (story_id, lower(name)); +CREATE INDEX "index_locations_on_parent_location_id" ON "locations" ("parent_location_id"); +CREATE INDEX "index_locations_on_story_id_and_detail_level" ON "locations" ("story_id", "detail_level"); +CREATE INDEX "index_locations_on_story_id" ON "locations" ("story_id"); +CREATE INDEX "index_locations_world_events_on_location_id" ON "locations_world_events" ("location_id"); +CREATE UNIQUE INDEX "index_locations_world_events_on_world_event_id_and_location_id" ON "locations_world_events" ("world_event_id", "location_id"); +CREATE INDEX "index_locations_world_events_on_world_event_id" ON "locations_world_events" ("world_event_id"); +CREATE INDEX "index_messages_on_chat_id" ON "messages" ("chat_id"); +CREATE INDEX "index_messages_on_model_id" ON "messages" ("model_id"); +CREATE INDEX "index_messages_on_scene_id" ON "messages" ("scene_id"); +CREATE INDEX "index_messages_on_tool_call_id" ON "messages" ("tool_call_id"); +CREATE UNIQUE INDEX "index_playthrough_beats_on_playthrough_id_and_quest_step_id" ON "playthrough_beats" ("playthrough_id", "quest_step_id"); +CREATE INDEX "index_playthrough_beats_on_playthrough_id" ON "playthrough_beats" ("playthrough_id"); +CREATE INDEX "index_playthrough_beats_on_quest_step_id" ON "playthrough_beats" ("quest_step_id"); +CREATE INDEX "index_playthrough_blows_on_attacker_id" ON "playthrough_blows" ("attacker_id"); +CREATE INDEX "index_playthrough_blows_on_location_id" ON "playthrough_blows" ("location_id"); +CREATE INDEX "index_playthrough_blows_on_playthrough_and_scene" ON "playthrough_blows" ("playthrough_id", "scene_id", "id"); +CREATE INDEX "index_playthrough_blows_on_playthrough_id" ON "playthrough_blows" ("playthrough_id"); +CREATE INDEX "index_playthrough_blows_on_scene_id" ON "playthrough_blows" ("scene_id"); +CREATE INDEX "index_playthrough_blows_on_target_id" ON "playthrough_blows" ("target_id"); +CREATE UNIQUE INDEX "index_playthrough_commands_on_submission" ON "playthrough_commands" ("playthrough_id", "request_token", "command"); +CREATE INDEX "index_playthrough_commands_on_playthrough_id" ON "playthrough_commands" ("playthrough_id"); +CREATE INDEX "index_playthrough_commands_on_result_scene_id" ON "playthrough_commands" ("result_scene_id"); +CREATE INDEX "index_playthrough_drifts_on_action" ON "playthrough_drifts" ("action"); +CREATE INDEX "index_playthrough_drifts_on_location_id" ON "playthrough_drifts" ("location_id"); +CREATE INDEX "index_playthrough_drifts_on_playthrough_id_and_story_timestamp" ON "playthrough_drifts" ("playthrough_id", "story_timestamp"); +CREATE INDEX "index_playthrough_drifts_on_playthrough_id" ON "playthrough_drifts" ("playthrough_id"); +CREATE INDEX "index_playthrough_drifts_on_scene_id" ON "playthrough_drifts" ("scene_id"); +CREATE UNIQUE INDEX "index_playthrough_due_endings_on_playthrough_id" ON "playthrough_due_endings" ("playthrough_id"); +CREATE INDEX "index_playthrough_due_endings_on_quest_outcome_id" ON "playthrough_due_endings" ("quest_outcome_id"); +CREATE UNIQUE INDEX "idx_on_playthrough_id_quest_outcome_id_7ea31b4171" ON "playthrough_endings" ("playthrough_id", "quest_outcome_id"); +CREATE INDEX "index_playthrough_endings_on_playthrough_id" ON "playthrough_endings" ("playthrough_id"); +CREATE INDEX "index_playthrough_endings_on_quest_outcome_id" ON "playthrough_endings" ("quest_outcome_id"); +CREATE UNIQUE INDEX "index_playthrough_feedbacks_on_playthrough_id_and_scene_id" ON "playthrough_feedbacks" ("playthrough_id", "scene_id"); +CREATE INDEX "index_playthrough_feedbacks_on_playthrough_id" ON "playthrough_feedbacks" ("playthrough_id"); +CREATE INDEX "index_playthrough_feedbacks_on_prose_model" ON "playthrough_feedbacks" ("prose_model"); +CREATE INDEX "index_playthrough_feedbacks_on_prose_prompt_digest" ON "playthrough_feedbacks" ("prose_prompt_digest"); +CREATE INDEX "index_playthrough_feedbacks_on_scene_id" ON "playthrough_feedbacks" ("scene_id"); +CREATE INDEX "index_playthrough_feedbacks_on_verdict" ON "playthrough_feedbacks" ("verdict"); +CREATE INDEX "index_playthrough_floors_on_location_id" ON "playthrough_floors" ("location_id"); +CREATE UNIQUE INDEX "index_playthrough_floors_on_playthrough_and_location" ON "playthrough_floors" ("playthrough_id", "location_id"); +CREATE INDEX "index_playthrough_floors_on_playthrough_id" ON "playthrough_floors" ("playthrough_id"); +CREATE INDEX "index_playthrough_floors_on_scene_id" ON "playthrough_floors" ("scene_id"); +CREATE INDEX "index_playthrough_npc_states_on_character_id" ON "playthrough_npc_states" ("character_id"); +CREATE INDEX "index_playthrough_npc_states_on_location_id" ON "playthrough_npc_states" ("location_id"); +CREATE UNIQUE INDEX "idx_on_playthrough_id_character_id_008ae03862" ON "playthrough_npc_states" ("playthrough_id", "character_id"); +CREATE INDEX "index_playthrough_npc_states_on_playthrough_id" ON "playthrough_npc_states" ("playthrough_id"); +CREATE INDEX "index_playthrough_overreaches_on_action" ON "playthrough_overreaches" ("action"); +CREATE INDEX "index_playthrough_overreaches_on_location_id" ON "playthrough_overreaches" ("location_id"); +CREATE INDEX "idx_on_playthrough_id_story_timestamp_b54cd36315" ON "playthrough_overreaches" ("playthrough_id", "story_timestamp"); +CREATE INDEX "index_playthrough_overreaches_on_playthrough_id" ON "playthrough_overreaches" ("playthrough_id"); +CREATE INDEX "index_playthrough_overreaches_on_scene_id" ON "playthrough_overreaches" ("scene_id"); +CREATE INDEX "index_playthrough_paragraphs_on_playthrough_id" ON "playthrough_paragraphs" ("playthrough_id"); +CREATE UNIQUE INDEX "index_playthrough_paragraphs_on_scene_id_and_author" ON "playthrough_paragraphs" ("scene_id", "author"); +CREATE INDEX "index_playthrough_passages_on_location_connection_id" ON "playthrough_passages" ("location_connection_id"); +CREATE INDEX "index_playthrough_passages_on_opened_by_item_id" ON "playthrough_passages" ("opened_by_item_id"); +CREATE UNIQUE INDEX "idx_on_playthrough_id_location_connection_id_6d3a29d910" ON "playthrough_passages" ("playthrough_id", "location_connection_id"); +CREATE INDEX "index_playthrough_passages_on_playthrough_id" ON "playthrough_passages" ("playthrough_id"); +CREATE INDEX "index_playthrough_rests_on_location_id" ON "playthrough_rests" ("location_id"); +CREATE INDEX "index_playthrough_rests_on_playthrough_id" ON "playthrough_rests" ("playthrough_id"); +CREATE INDEX "index_playthrough_rests_on_scene_id" ON "playthrough_rests" ("scene_id"); +CREATE INDEX "index_playthrough_tolls_on_character_id" ON "playthrough_tolls" ("character_id"); +CREATE INDEX "index_playthrough_tolls_on_location_connection_id" ON "playthrough_tolls" ("location_connection_id"); +CREATE INDEX "index_playthrough_tolls_on_location_id" ON "playthrough_tolls" ("location_id"); +CREATE INDEX "index_playthrough_tolls_on_playthrough_and_scene" ON "playthrough_tolls" ("playthrough_id", "scene_id", "id"); +CREATE INDEX "index_playthrough_tolls_on_playthrough_id" ON "playthrough_tolls" ("playthrough_id"); +CREATE INDEX "index_playthrough_tolls_on_scene_id" ON "playthrough_tolls" ("scene_id"); +CREATE UNIQUE INDEX "index_playthrough_turn_events_on_command_and_sequence" ON "playthrough_turn_events" ("playthrough_command_id", "sequence"); +CREATE INDEX "index_playthrough_turn_events_on_playthrough_command_id" ON "playthrough_turn_events" ("playthrough_command_id"); +CREATE INDEX "index_playthrough_vitals_on_character_id" ON "playthrough_vitals" ("character_id"); +CREATE UNIQUE INDEX "index_playthrough_vitals_on_playthrough_and_character" ON "playthrough_vitals" ("playthrough_id", "character_id"); +CREATE INDEX "index_playthrough_vitals_on_playthrough_id" ON "playthrough_vitals" ("playthrough_id"); +CREATE INDEX "index_playthrough_volitions_on_character_id" ON "playthrough_volitions" ("character_id"); +CREATE INDEX "index_playthrough_volitions_on_location_id" ON "playthrough_volitions" ("location_id"); +CREATE INDEX "index_playthrough_volitions_on_playthrough_and_scene" ON "playthrough_volitions" ("playthrough_id", "scene_id", "id"); +CREATE INDEX "index_playthrough_volitions_on_playthrough_id" ON "playthrough_volitions" ("playthrough_id"); +CREATE INDEX "index_playthrough_volitions_on_scene_id" ON "playthrough_volitions" ("scene_id"); +CREATE INDEX "index_playthroughs_on_character_id" ON "playthroughs" ("character_id"); +CREATE INDEX "index_playthroughs_on_current_location_id" ON "playthroughs" ("current_location_id"); +CREATE INDEX "index_playthroughs_on_current_scene_id" ON "playthroughs" ("current_scene_id"); +CREATE INDEX "index_playthroughs_on_player_id" ON "playthroughs" ("player_id"); +CREATE INDEX "index_playthroughs_on_story_id" ON "playthroughs" ("story_id"); +CREATE UNIQUE INDEX "index_playthroughs_on_token" ON "playthroughs" ("token"); +CREATE INDEX "index_quest_outcomes_on_character_id" ON "quest_outcomes" ("character_id"); +CREATE UNIQUE INDEX "index_quest_outcomes_on_quest_id_and_name" ON "quest_outcomes" ("quest_id", "name"); +CREATE INDEX "index_quest_outcomes_on_quest_id" ON "quest_outcomes" ("quest_id"); +CREATE INDEX "index_quest_steps_on_companion_id" ON "quest_steps" ("companion_id"); +CREATE UNIQUE INDEX "index_quest_steps_on_quest_id_and_position" ON "quest_steps" ("quest_id", "position"); +CREATE INDEX "index_quest_steps_on_quest_id" ON "quest_steps" ("quest_id"); +CREATE INDEX "index_quest_steps_on_target" ON "quest_steps" ("target_type", "target_id"); +CREATE INDEX "index_quests_on_parent_quest_id" ON "quests" ("parent_quest_id"); +CREATE UNIQUE INDEX "index_quests_on_story_id_and_title" ON "quests" ("story_id", "title"); +CREATE INDEX "index_quests_on_story_id" ON "quests" ("story_id"); +CREATE UNIQUE INDEX "index_races_on_universe_id_and_name" ON "races" ("universe_id", "name"); +CREATE INDEX "index_races_on_universe_id" ON "races" ("universe_id"); +CREATE INDEX "index_relay_receipts_on_player_id_and_created_at" ON "relay_receipts" ("player_id", "created_at"); +CREATE INDEX "index_relay_receipts_on_player_id_and_status" ON "relay_receipts" ("player_id", "status"); +CREATE INDEX "index_relay_receipts_on_player_id" ON "relay_receipts" ("player_id"); +CREATE INDEX "index_scenes_on_acted_on" ON "scenes" ("acted_on_type", "acted_on_id"); +CREATE INDEX "index_scenes_on_location_id" ON "scenes" ("location_id"); +CREATE INDEX "index_scenes_on_previous_scene_id" ON "scenes" ("previous_scene_id"); +CREATE INDEX "index_scenes_on_story_id_and_is_opening" ON "scenes" ("story_id", "is_opening"); +CREATE INDEX "index_scenes_on_story_id_and_resolved_action" ON "scenes" ("story_id", "resolved_action"); +CREATE INDEX "index_scenes_on_story_id_and_story_timestamp" ON "scenes" ("story_id", "story_timestamp"); +CREATE INDEX "index_scenes_on_story_id" ON "scenes" ("story_id"); +CREATE INDEX "index_stories_on_universe_id" ON "stories" ("universe_id"); +CREATE INDEX "index_system_one_receipts_on_player_id_and_created_at" ON "system_one_receipts" ("player_id", "created_at"); +CREATE INDEX "index_system_one_receipts_on_player_id" ON "system_one_receipts" ("player_id"); +CREATE INDEX "index_system_one_receipts_on_playthrough_id" ON "system_one_receipts" ("playthrough_id"); +CREATE INDEX "index_world_events_on_playthrough_id" ON "world_events" ("playthrough_id"); +CREATE INDEX "index_world_events_on_story_id_and_occurred_at" ON "world_events" ("story_id", "occurred_at"); +CREATE INDEX "index_world_events_on_story_id_and_scheduled_for" ON "world_events" ("story_id", "scheduled_for"); +CREATE INDEX "index_world_events_on_story_id" ON "world_events" ("story_id"); +CREATE INDEX "index_world_events_on_world_mechanic_id" ON "world_events" ("world_mechanic_id"); +CREATE UNIQUE INDEX "index_world_mechanics_on_story_id_and_name" ON "world_mechanics" ("story_id", "name"); +CREATE INDEX "index_world_mechanics_on_story_id" ON "world_mechanics" ("story_id"); +PRAGMA writable_schema=OFF; +COMMIT; diff --git a/src/turn/told/realize.rs b/src/turn/told/realize.rs index c98eaf9..531f752 100644 --- a/src/turn/told/realize.rs +++ b/src/turn/told/realize.rs @@ -1296,11 +1296,12 @@ impl Turn<'_, '_> { /// `Location::Interior.lay_out!` and `#open_the_way_in!`: a place's /// rooms and doorways, its footprint rolled first when it has none, and - /// each room dealt its sort from `building`'s. + /// each room dealt its sort from its own kind when that is a building's + /// (a world can seed one), whatever the model picked, and otherwise from + /// `building`'s. /// /// A floor (a place with a `floors` row) is laid out by `floor` instead: - /// its own room count, danger and hazard, and its own kind when that is - /// a building's, whatever the model picked; and its way down, the + /// its own room count, danger and hazard; and its way down, the /// doorway to the floor its row names, is opened onto the room rolled /// for it. fn lay_out( @@ -1332,10 +1333,7 @@ impl Turn<'_, '_> { clock: self.m.clock(), existing_locations: existing, footprint: int(&row, "width").zip(int(&row, "depth")), - kind: match floor_row { - Some(_) => own_kind.or(building), - None => building, - }, + kind: own_kind.or(building), density: text(&row, "density"), }; let guards = match floor_row { diff --git a/tests/seeded_kind.rs b/tests/seeded_kind.rs new file mode 100644 index 0000000..94ebe5c --- /dev/null +++ b/tests/seeded_kind.rs @@ -0,0 +1,195 @@ +//! A building its world seeds with its own kind, laid out as that building +//! whatever the place call answers: The Shrine on the Square walked into on +//! the live path with a scripted model, and the rows read back. +//! +//! The Shrine is a stub with a footprint and `kind: temple`. The place call +//! answers `warehouse` every time here, so a room dealt a temple's word was +//! dealt it from the stub's own kind, and a room dealt a warehouse's from the +//! answer. + +use renderedstep_engine::engine::Engine; +use renderedstep_engine::model::{Live, Route, Secret}; +use renderedstep_engine::parity::{open_world, TITLE_SUFFIX}; +use serde_json::{json, Value}; +use std::path::Path; + +fn world() -> String { + let path = + Path::new(env!("CARGO_MANIFEST_DIR")).join("parity/worlds/the-shrine-on-the-square.sql"); + std::fs::read_to_string(path).expect("a world fixture") +} + +struct Scripted { + answers: Vec<(u16, Value)>, + sent: Vec, +} + +impl renderedstep_engine::model::http::Transport for Scripted { + fn post( + &mut self, + _endpoint: &renderedstep_engine::model::route::Endpoint, + body: &Value, + _options: &renderedstep_engine::model::http::Options, + _on_line: Option<&mut (dyn FnMut(&str) + '_)>, + ) -> Result + { + self.sent.push(body.clone()); + let (status, answer) = self.answers.remove(0); + Ok(renderedstep_engine::model::http::Posted { + status, + body: answer.to_string(), + }) + } +} + +fn answered(content: Value) -> (u16, Value) { + ( + 200, + json!({"choices": [{"message": {"content": content.to_string()}, "finish_reason": "stop"}]}), + ) +} + +/// The place call's answer: a warehouse, which the file's temple is not. +fn place() -> Value { + json!({ + "description": "A stone hall under a low dome.", + "lore": "Older than the square.", + "place_kind": "warehouse", + "parameters": { + "inside": "a few rooms", + "storeys_above": "ground floor only", + "storeys_below": "a cellar", + "danger": "safe", + "gradient": "the same throughout", + "hazard": "none", + }, + }) +} + +fn room() -> Value { + json!({ + "description": "A plain stone room.", + "lore": "Everyone stops here first.", + "items": [], + "people": [], + }) +} + +fn arrival() -> Value { + json!({"description": "You arrive.", "summary": "Arrived."}) +} + +/// The shrine's world opened and a game started, with the shrine's own kind +/// set to `kind` first (`None` clears it). +fn started(kind: Option<&str>) -> (Engine, i64) { + let mut engine = open_world(&world()).unwrap(); + let story = engine + .story_titled(&format!("The Shrine on the Square{TITLE_SUFFIX}")) + .unwrap(); + engine + .store() + .connection() + .execute( + "UPDATE locations SET kind = ?1 WHERE name = 'The Shrine'", + [kind], + ) + .unwrap(); + let game = engine.start(story).unwrap(); + (engine, game) +} + +/// Walks into the shrine with the model answering in turn; every request +/// it was sent. +fn walked_in(engine: &mut Engine, game: i64) -> Vec { + let transport = Scripted { + answers: [place(), room(), arrival()] + .into_iter() + .map(answered) + .collect(), + sent: Vec::new(), + }; + let route = Route::Direct { + key: Secret::new("own"), + }; + let mut live = Live::with_transport(route, transport); + let line = "/move The Shrine"; + engine + .submit(game, line, line, &mut live, &mut |_| {}) + .unwrap(); + live.transport().sent.clone() +} + +/// Each room of the shrine, in the order it was written: its storey and +/// the word it was dealt. +fn rooms(engine: &Engine) -> Vec<(i64, String)> { + let connection = engine.store().connection(); + let mut statement = connection + .prepare( + "SELECT z, kind FROM locations WHERE parent_location_id = \ + (SELECT id FROM locations WHERE name = 'The Shrine') ORDER BY id", + ) + .unwrap(); + statement + .query_map([], |row| Ok((row.get(0)?, row.get(1)?))) + .unwrap() + .collect::>() + .unwrap() +} + +#[test] +fn a_seeded_temple_is_laid_out_as_a_temple_whatever_the_place_call_answers() { + let (mut engine, game) = started(Some("temple")); + let sent = walked_in(&mut engine, game); + assert_eq!(sent.len(), 3, "the place, its entry room and the arrival"); + + let rooms = rooms(&engine); + assert!(rooms.len() > 1, "{rooms:?}"); + assert_eq!( + rooms[0].1, "shrine", + "a temple's entry, not a warehouse's office" + ); + for (storey, kind) in &rooms[1..] { + let band: &[&str] = match storey { + 0 => &["shrine", "study"], + _ => &["storeroom"], + }; + assert!(band.contains(&kind.as_str()), "{storey}: {kind}"); + } + assert!( + rooms.iter().any(|(_, kind)| kind == "study"), + "a word only a temple deals: {rooms:?}" + ); +} + +#[test] +fn a_stub_with_no_kind_of_its_own_follows_the_place_call() { + let (mut engine, game) = started(None); + walked_in(&mut engine, game); + + let rooms = rooms(&engine); + assert!(rooms.len() > 1, "{rooms:?}"); + assert_eq!(rooms[0].1, "office", "a warehouse's entry"); + for (_, kind) in &rooms[1..] { + assert_eq!(kind, "storeroom", "a warehouse's every other room"); + } +} + +#[test] +fn a_stub_whose_own_kind_is_not_a_buildings_follows_the_place_call() { + let (mut engine, game) = started(Some("square")); + walked_in(&mut engine, game); + + assert_eq!(rooms(&engine)[0].1, "office", "a warehouse's entry"); +} + +/// The stub's own kind decides only the rooms: nothing the model is sent +/// for the place moves with it. +#[test] +fn the_place_call_is_sent_the_same_request_whatever_the_stubs_own_kind() { + let (mut seeded, seeded_game) = started(Some("temple")); + let (mut plain, plain_game) = started(None); + let seeded_sent = walked_in(&mut seeded, seeded_game); + let plain_sent = walked_in(&mut plain, plain_game); + + assert_eq!(seeded_sent[0], plain_sent[0], "the place call"); +}