diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e4d2ef..1aa47b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: env: # The game commit whose runner, scripts and judges this checkout is # held to (parity/README.md, "Changing a rule"). - SERVER_COMMIT: f6458b915b2e48df3470dd043b491a458ffb984a + SERVER_COMMIT: ccc92ed7ded3f0a95e1d0be24893cd74c2ac19fd 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 8b7af5b..bf0e13f 100644 --- a/parity/PASSING +++ b/parity/PASSING @@ -45,6 +45,7 @@ a-slash-in-front-of-the-line a-thing-can-be-thrown a-thing-put-down-can-break a-thing-thrown-can-break-where-it-lands +a-thirteenth-person-is-born a-throw-can-fall-short a-throw-on-a-green-laid-out-alone a-throw-on-open-ground-is-only-told diff --git a/parity/goldens/a-thirteenth-person-is-born.json b/parity/goldens/a-thirteenth-person-is-born.json new file mode 100644 index 0000000..1d42da9 --- /dev/null +++ b/parity/goldens/a-thirteenth-person-is-born.json @@ -0,0 +1,75 @@ +{ + "script": "a-thirteenth-person-is-born", + "story": "A Crowded Cellar", + "steps": [ + { + "step": "step 1 down-into-the-cellar", + "player": "first", + "typed": "/move Cellar", + "dump": { + "location": { + "id": 1000000005, + "name": "Cellar", + "detail": "realized" + }, + "storey": null, + "exits": [ + { + "id": 1000000001, + "name": "Taproom", + "detail": "realized" + } + ], + "here": [], + "carrying": [], + "present": [ + { + "id": 1000000015, + "name": "Kit Lowan" + }, + { + "id": 1000000013, + "name": "Orrin Vale" + }, + { + "id": 1000000014, + "name": "Sabine Roe" + } + ], + "foes": [], + "inscription": [], + "hp": 53, + "hp_of": { + "Kit Lowan": 10, + "Orrin Vale": 6, + "Sabine Roe": 10 + }, + "abilities": { + "strength": 12, + "dexterity": 12, + "will": 12 + }, + "dead": false, + "changed": true, + "change": "The browser turn completed.", + "refused": false, + "offers": null, + "understood": "move -> Cellar", + "resolved_by": "grammar", + "note": "into-the-cellar: 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-thirteenth-person-is-born.json b/parity/records/a-thirteenth-person-is-born.json new file mode 100644 index 0000000..b306516 --- /dev/null +++ b/parity/records/a-thirteenth-person-is-born.json @@ -0,0 +1,602 @@ +{ + "script": "a-thirteenth-person-is-born", + "steps": [ + { + "step": "step 1 down-into-the-cellar", + "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, barrels and cart wheels.\ngeographies: A coaching inn on a wet road.\nraces: Countryfolk\ncivilizations: A market county.\n\n\n## Story Details\ntitle: A Crowded Cellar (engine sweep)\ngenre: country adventure\npreface: The Lantern Inn is full to the rafters on a wet night.\nsummary: Nell looks for room in a full inn.\n\n\n## The Place\nname: Cellar\nteaser: Steps down to the barrels.\n\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\n## What Is Lying Here\nList AT MOST 3 portable things a player could pick up and carry away.\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: Nell, Hob Allard, Ida Fenn, Moss Tarrow, Pell Quill, Rue Ambry, Tam Brisk, Vey Corran, Wick Dunmore, Yara Holt, Zeb Marrow, Ash Penrose\n\n## Who Is Here\nWrite EXACTLY 3 people who are in this place right now.\n- Anyone you write is somebody the player can walk up to and talk to, so they\n have to have a reason to be standing here and an enduring aim that today's\n reason serves, threatens or exposes\n- Do not write the player, and do not write somebody passing through\n- Never give them the name of a place, of a thing, or any name already\n spoken for above\n\nWho they are is already decided. Write these people and do not change them:\n the 1st is Countryfolk, about 50, female\n the 2nd is Countryfolk, about 64, female\n the 3rd is Countryfolk, about 36, male\n\n## Their Four Objects of Desire\n\nWrite four STORY-SCALE things this person is after, then pick two TURN-SCALE labels.\nWork from everything above -- especially the years in their backstory, their repeated\nchoices, what they fear losing, the future they imagine, and where today's situation\npresses on that life.\n\nAn object of desire must satisfy both tests:\n1. It was shaping this person before the opening scene.\n2. Finishing today's errand would not finish it; it can drive choices across the\n whole story.\n\nThe two labels are picked from this list and nothing else:\n\n keep They are holding on to something they already have.\n obtain They are trying to get hold of something they do not have.\n reach They are trying to get to a particular place.\n attend They are trying to stay near a particular person.\n avoid They are trying to get away from a person or a place.\n withhold They are trying to stop somebody else getting something.\n offer They are trying to put something into somebody else's hands.\n\nconscious_desire\n The future, standing, relationship, legacy, place or way of life they knowingly\n organize their choices around and would name if asked what they want from their\n life. Make it specific to this person and world. Do not substitute the clue,\n deadline, delivery, payment or room they are dealing with today. One sentence.\n\nunconscious_desire\n The deeper reward their choices have pursued for years and they would deny: the\n recognition, absolution, dependence, belonging, power or intimacy beneath the\n conscious account. It must explain a repeated pattern in the backstory and pull at\n an angle to the conscious desire, not merely restate today's hidden motive. One\n sentence.\n\nrecognized_need\n The duty, oath, debt, craft, family burden or bodily discipline they believe they\n must keep over years whether they want to or not. It predates today's assignment,\n survives it, and can repeatedly obstruct the conscious desire. One sentence.\n\nunrecognized_need\n The enduring change, truth or relationship their life requires and their repeated\n pattern prevents them from seeing. A reader can infer it from the backstory. It\n cannot be completed by one confession, realization or errand: it demands a new way\n of choosing across the story. If they never move toward it, pursuit of the\n conscious desire ruins them. One sentence.\n\ndesire_pursuit\n Pick the listed ENGINE ACT that could repeatedly advance or protect the conscious\n desire in ordinary rooms. The label is the next-step expression of the larger\n desire, not its timescale.\n\nneed_pursuit\n Pick the listed ENGINE ACT that could repeatedly move them toward the unrecognized\n need in ordinary rooms. It may match desire_pursuit, but a different label should\n reflect a real conflict rather than manufactured variety.\n\nRules:\n- Every field names something to move TOWARD. State what lies beyond a fear, refusal\n or escape.\n- The object is larger than any single room act. Picking something up, handing it\n over, walking, waiting or staying near somebody may advance, protect, rehearse or\n betray it; that act must not become the whole desire.\n- Use today's room as pressure or evidence, not as the horizon of the person's life.\n- Keep the four consistent with the backstory, fears and dislikes. A fear is often\n the shadow of an object, but is not the object itself.\n- The conscious desire and unrecognized need must not be the same thing said twice.\n- Write in the third person, by name.\n- Do not resolve any object or say how the story ends.\n- Respect the stated length of each field.\n- Each person in this room gets their own four. Two people in one room must not\n want the same thing in the same words.\n- At least one person's enduring object should be visibly pressed by something in\n this room or one step away. The nearby thing is today's tactic or test, not the\n whole object.\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": "The 3 people who are in this place right now. Write all 3 the instructions describe, in the order they are given there.", + "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 + }, + "minItems": 3, + "maxItems": 3 + } + }, + "required": [ + "description", + "lore", + "people" + ], + "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": "Now list the ways out of Cellar.\n\n## Where This Room Already Leads\n- Taproom\nThose exist already and do not need naming again. Do not contradict them.\n\n## Places That Already Exist In This Story\nReuse a name from this list when an exit leads somewhere already known.\nOnly invent a name when the exit leads somewhere genuinely new.\nA place marked (already written) has had its own ways out written down\nalready, so naming it here would open a door it does not have: leave it\nout and name somewhere new instead.\nTaproom\nKitchen (already written -- do not open a new way into it)\nStable (already written -- do not open a new way into it)\nLoft (already written -- do not open a new way into it)\n\n## Instructions\n- Name AT MOST 3 ways out. That is what is left of this\n room's 4, not a target: fewer is a better answer than a door\n nobody needed\n- Each exit is somewhere the player can reach directly from Cellar\n- One way out is a complete answer. A dead end, a cell, the bottom of a\n shaft: if the only way out is back the place the player came from, list\n that place and nothing else. Never invent a passage to reach a second\n- When there is more than one, give the player a reason to prefer one\n over another\n- Do not list Cellar itself\n- Say which of them have an INSIDE, and say NO INSIDE for almost all of\n them. Saying anything else makes the game build a whole floor plan of\n rooms in that place and send the player walking through them, so it is\n only ever right for a BUILDING somebody goes in at a door -- an inn, a\n keep, a counting house, a warren. A road, a shore, a clearing, a bridge,\n a square, a cave mouth, a stair, a courtyard: no inside. A room, an\n office, a hall, a chamber: no inside either, because those are already\n somewhere the player stands. Where it really is a building, pick the size\n it would really be rather than the most interesting one\n- Distance and travel method must be consistent with the description you\n just wrote, and must be true in both directions -- the way back is the\n same edge\n- Say how populated each place is, in one of the words offered. A place is\n peopled by what it is FOR: a market, a taproom, a guardhouse, a\n workshop, a shrine somebody keeps -- somewhere with a reason for\n somebody to be standing in it. A place is empty when nothing is asked of\n anybody there: a cellar, a back stair, a stretch of road, a room that is\n locked, a place the story has already emptied. Neither answer is the\n safe one\n- Respect the stated length of each field\n", + "schema": { + "name": "Location::ExitsSchema", + "description": null, + "schema": { + "type": "object", + "properties": { + "exits": { + "type": "array", + "description": "The places a player can reach directly from here.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the place this exit leads to, as a player would refer to it. 1 to 4 words, no article.", + "maxLength": 60 + }, + "teaser": { + "type": "string", + "description": "A one-line glimpse of what lies that way, enough to make the player choose it. Exactly one sentence.", + "maxLength": 160 + }, + "distance": { + "type": "string", + "enum": [ + "adjacent", + "a short walk", + "across the district", + "a long journey", + "days away" + ], + "description": "How far it is. Pick the closest of these; the exact wording does not matter." + }, + "travel_method": { + "type": "string", + "enum": [ + "walking", + "taking stairs", + "climbing", + "crawling", + "swimming", + "rowing", + "riding" + ], + "description": "How the player covers that ground. Pick the closest of these. It must read correctly in both directions, because the way back is the same edge." + }, + "inside": { + "type": "string", + "enum": [ + "no inside", + "one room", + "a few rooms", + "a warren of rooms" + ], + "description": "NO INSIDE for almost everything you name. Anything else here makes the game build a whole floor plan of rooms there and send the player walking through them, so answer otherwise ONLY for a place that is a BUILDING somebody goes in at a door: an inn, a keep, a counting house, a warren. NO INSIDE for a road, a shore, a clearing, a bridge, a square, a cave mouth, a stair, a courtyard -- and for a room, an office or a hall, which are already somewhere you stand. When it really is a building, pick the size it would really be." + }, + "population": { + "type": "string", + "enum": [ + "nobody", + "a person or two", + "a crowd" + ], + "description": "How many people are in that place. Pick the closest of these words. It is a word and never a number: the engine decides how many people that is." + }, + "kind": { + "type": "string", + "enum": [ + "corridor", + "common room", + "assembly hall", + "kitchen", + "sleeping quarters", + "washroom", + "study", + "library", + "office", + "classroom", + "laboratory", + "infirmary", + "workshop", + "machine room", + "control room", + "storeroom", + "shop", + "shrine", + "auditorium", + "cell", + "stable", + "hangar", + "airlock", + "garden", + "courtyard", + "rooftop", + "street", + "road", + "square", + "market", + "crossing", + "field", + "forest", + "shore", + "mountainside", + "desert", + "cave", + "ruin" + ], + "description": "What sort of place that is, as the game will furnish it. Pick the closest of these words; the game decides what stands in a place of that kind and tells you room by room. It is a word and never a list of furniture." + }, + "density": { + "type": "string", + "enum": [ + "sparse", + "lived-in", + "cluttered" + ], + "description": "How much small stuff is lying about in it: 'sparse' for somewhere kept or empty, 'lived-in' for most places, 'cluttered' for somewhere nobody tidies. A word; the game rolls the count." + } + }, + "required": [ + "name", + "teaser", + "distance", + "travel_method", + "population", + "kind", + "density" + ], + "additionalProperties": false + }, + "minItems": 1, + "maxItems": 4 + } + }, + "required": [ + "exits" + ], + "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, barrels and cart wheels.\n\n## Story Details\ntitle: A Crowded Cellar (engine sweep)\ngenre: country adventure\nsummary: Nell looks for room in a full inn.\n\n## The Place\nname: Cellar\ndescription: Barrels in rows and three latecomers on upturned crates.\nlore: The cellar takes the overflow on a full night.\nways out: Taproom\n\n## Who Is Here\nNell (Nell), Countryfolk -- the player, the one arriving\nOrrin Vale (Orrin), Countryfolk\nSabine Roe (Sabine), Countryfolk\nKit Lowan (Kit), Countryfolk\n\n## Just Before This\nThe player has come from Taproom. Nell comes in out of the rain.\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.\nAlso here: Orrin Vale, Sabine Roe, Kit Lowan. Nobody else is alive here.\nLying here: nothing.\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": 1000000005, + "story_id": 1000000001, + "name": "Cellar", + "description": "Barrels in rows and three latecomers on upturned crates.", + "lore": "The cellar takes the overflow on a full night.", + "last_protagonist_visit": "2026-09-21 19:01:00", + "parent_location_id": null, + "detail_level": "realized", + "teaser": "Steps down to the barrels.", + "mobile": 0, + "danger": "safe", + "hazard": null, + "hazard_die": null, + "x": 0, + "y": 0, + "z": 0, + "width": 11, + "depth": 9, + "population": "a crowd", + "generation_checkpoint": null, + "surface": null, + "kind": null, + "density": null + } + ], + "removed": [] + }, + "location_connections": { + "rows": [], + "removed": [] + }, + "characters": { + "rows": [ + { + "id": 1000000013, + "story_id": 1000000001, + "fullname": "Orrin Vale", + "nickname": "Orrin", + "age": 50, + "sex": "female", + "personality": "Grumbling but kind.", + "appearance": "A wet hat.", + "likes": "Dry socks.", + "dislikes": "Damp.", + "fears": "Rats.", + "backstory": "A drover who came too late for a bed.", + "is_companion": 0, + "race_id": 1000000001, + "is_protagonist": 0, + "location_id": 1000000005, + "deliberately_absent": 0, + "level": 1, + "hit_die": 6, + "strength": 8, + "dexterity": 8, + "will": 14, + "hostile": 0, + "x": 1, + "y": 0, + "conscious_desire": "", + "unconscious_desire": "", + "recognized_need": "", + "unrecognized_need": "", + "desire_pursuit": null, + "need_pursuit": null + }, + { + "id": 1000000014, + "story_id": 1000000001, + "fullname": "Sabine Roe", + "nickname": "Sabine", + "age": 64, + "sex": "female", + "personality": "Calm.", + "appearance": "A mended shawl.", + "likes": "Quiet.", + "dislikes": "Noise.", + "fears": "Thieves.", + "backstory": "A weaver walking to the fair.", + "is_companion": 0, + "race_id": 1000000001, + "is_protagonist": 0, + "location_id": 1000000005, + "deliberately_absent": 0, + "level": 1, + "hit_die": 10, + "strength": 10, + "dexterity": 9, + "will": 11, + "hostile": 0, + "x": 2, + "y": 0, + "conscious_desire": "", + "unconscious_desire": "", + "recognized_need": "", + "unrecognized_need": "", + "desire_pursuit": null, + "need_pursuit": null + }, + { + "id": 1000000015, + "story_id": 1000000001, + "fullname": "Kit Lowan", + "nickname": "Kit", + "age": 36, + "sex": "male", + "personality": "Restless.", + "appearance": "A torn sleeve.", + "likes": "Freedom.", + "dislikes": "Masters.", + "fears": "Being found.", + "backstory": "A runaway apprentice.", + "is_companion": 0, + "race_id": 1000000001, + "is_protagonist": 0, + "location_id": 1000000005, + "deliberately_absent": 0, + "level": 1, + "hit_die": 10, + "strength": 8, + "dexterity": 7, + "will": 9, + "hostile": 0, + "x": 0, + "y": 0, + "conscious_desire": "", + "unconscious_desire": "", + "recognized_need": "", + "unrecognized_need": "", + "desire_pursuit": null, + "need_pursuit": null + } + ], + "removed": [] + }, + "items": { + "rows": [], + "removed": [] + }, + "quest_steps": { + "rows": [], + "removed": [] + }, + "scenes": { + "rows": [ + { + "id": 1000000002, + "story_id": 1000000001, + "location_id": 1000000005, + "previous_scene_id": 1000000001, + "description": "You arrive at Cellar. You are unhurt. Also here: Orrin Vale, Sabine Roe, Kit Lowan. Nobody else is alive here. Lying here: nothing. You are carrying: nothing.", + "story_timestamp": "2026-09-21 19:01:00", + "summary": "You arrive at Cellar. You are unhurt. Also here: Orrin Vale, Sabine Roe, Kit Lowan. Nobody else is alive here. Lying here: nothing. You are carrying: nothing.", + "is_opening": 0, + "typed": "move Cellar", + "resolved_action": "move", + "acted_on_type": "Location", + "acted_on_id": 1000000005, + "resolved_by": "grammar", + "engine_fallback": 1, + "engine_fact": "You are unhurt.\nAlso here: Orrin Vale, Sabine Roe, Kit Lowan. Nobody else is alive here.\nLying here: nothing.\nYou are carrying: nothing." + } + ], + "removed": [] + }, + "characters_scenes": { + "rows": [ + { + "character_id": 1000000001, + "scene_id": 1000000002 + }, + { + "character_id": 1000000013, + "scene_id": 1000000002 + }, + { + "character_id": 1000000014, + "scene_id": 1000000002 + }, + { + "character_id": 1000000015, + "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-thirteenth-person-is-born.yml b/parity/scripts/a-thirteenth-person-is-born.yml new file mode 100644 index 0000000..4b920c5 --- /dev/null +++ b/parity/scripts/a-thirteenth-person-is-born.yml @@ -0,0 +1,57 @@ +--- +story: A Crowded Cellar +steps: +- id: down-into-the-cellar + type: "/move Cellar" + browser: + token: into-the-cellar + realizes: Cellar + replies: + - purpose: location + prompt_includes: + - Write EXACTLY 3 people who are in this place right now. + content: + description: Barrels in rows and three latecomers on upturned crates. + lore: The cellar takes the overflow on a full night. + items: [] + people: + - fullname: Orrin Vale + nickname: Orrin + appearance: A wet hat. + personality: Grumbling but kind. + backstory: A drover who came too late for a bed. + likes: Dry socks. + dislikes: Damp. + fears: Rats. + - fullname: Sabine Roe + nickname: Sabine + appearance: A mended shawl. + personality: Calm. + backstory: A weaver walking to the fair. + likes: Quiet. + dislikes: Noise. + fears: Thieves. + - fullname: Kit Lowan + nickname: Kit + appearance: A torn sleeve. + personality: Restless. + backstory: A runaway apprentice. + likes: Freedom. + dislikes: Masters. + fears: Being found. + - purpose: location + content: + exits: + - name: Taproom + teaser: Steps back up. + distance: adjacent + travel_method: walking + - purpose: arrival + unavailable: true + expect: + location: Cellar (realized) + present: + - Kit Lowan + - Orrin Vale + - Sabine Roe + changed: true diff --git a/parity/worlds/a-bell-nobody-has-rung.sql b/parity/worlds/a-bell-nobody-has-rung.sql index c3662bc..8e53598 100644 --- a/parity/worlds/a-bell-nobody-has-rung.sql +++ b/parity/worlds/a-bell-nobody-has-rung.sql @@ -301,11 +301,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:58.380372','You stand in the chapter hall with Oda, the sexton.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-10 08:00:00','Ilse arrives at the abbey''s chapter hall.',NULL,'2026-10-02 13:25:58.380372'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:57.899077',NULL,'quiet mystery','The abbey bell has been silent since before you were born.','2026-09-10 08:00:00','Ilse climbs to the abbey to find out why its bell no longer rings.','A Bell Nobody Has Rung (engine sweep)',1000000001,'2026-10-02 13:25:57.899077'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:57.899077',NULL,'quiet mystery','The abbey bell has been silent since before you were born.','2026-09-10 08:00:00','Ilse climbs to the abbey to find out why its bell no longer rings.','A Bell Nobody Has Rung (engine sweep)',1000000001,'2026-10-02 13:25:57.899077',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -415,6 +415,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-chamber-of-one-room.sql b/parity/worlds/a-chamber-of-one-room.sql index 582b3e0..7bdc79e 100644 --- a/parity/worlds/a-chamber-of-one-room.sql +++ b/parity/worlds/a-chamber-of-one-room.sql @@ -289,11 +289,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:38.277584','You stand at the foot of the maintenance shaft.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-20 06:00:00','Kael arrives on the cargo deck.',NULL,'2026-10-02 13:25:38.277584'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:38.010407',NULL,'science fiction','A shaft runs from the cargo deck up toward the gravity core.','2026-09-20 06:00:00','Kael climbs toward the core.','A Chamber of One Room (engine sweep)',1000000001,'2026-10-02 13:25:38.010407'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:38.010407',NULL,'science fiction','A shaft runs from the cargo deck up toward the gravity core.','2026-09-20 06:00:00','Kael climbs toward the core.','A Chamber of One Room (engine sweep)',1000000001,'2026-10-02 13:25:38.010407',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -403,6 +403,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-clerk-with-somewhere-to-be.sql b/parity/worlds/a-clerk-with-somewhere-to-be.sql index 6ca7ed1..f273ff5 100644 --- a/parity/worlds/a-clerk-with-somewhere-to-be.sql +++ b/parity/worlds/a-clerk-with-somewhere-to-be.sql @@ -292,11 +292,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:43.558877','You are standing at the counter of the records office. Bell is behind it, already half turned toward the landing.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-19 09:00:00','Wick comes to the records office counter and finds Bell on her way out.',NULL,'2026-10-02 13:25:43.558877'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:43.229783',NULL,'town adventure','The office is warm and somebody else is already looking at the door.','2026-09-19 09:00:00','Wick came for a receipt; Bell is due upstairs and the day is going.','A Clerk With Somewhere To Be (engine sweep)',1000000001,'2026-10-02 13:25:43.229783'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:43.229783',NULL,'town adventure','The office is warm and somebody else is already looking at the door.','2026-09-19 09:00:00','Wick came for a receipt; Bell is due upstairs and the day is going.','A Clerk With Somewhere To Be (engine sweep)',1000000001,'2026-10-02 13:25:43.229783',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -406,6 +406,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-conversation-at-the-gate.sql b/parity/worlds/a-conversation-at-the-gate.sql index 406c5c4..6084bff 100644 --- a/parity/worlds/a-conversation-at-the-gate.sql +++ b/parity/worlds/a-conversation-at-the-gate.sql @@ -292,11 +292,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:11.645183','You face Maren beside the gate to the courtyard.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-08 12:00:00','Cal meets Maren at the market gate.',NULL,'2026-10-02 13:26:11.645183'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:11.316607',NULL,'town adventure','A misunderstanding has closed the courtyard gate.','2026-09-08 12:00:00','Cal and Maren can settle their disagreement and travel together.','A Conversation at the Gate (engine sweep)',1000000001,'2026-10-02 13:26:11.316607'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:11.316607',NULL,'town adventure','A misunderstanding has closed the courtyard gate.','2026-09-08 12:00:00','Cal and Maren can settle their disagreement and travel together.','A Conversation at the Gate (engine sweep)',1000000001,'2026-10-02 13:26:11.316607',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -406,6 +406,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-crowded-cellar.sql b/parity/worlds/a-crowded-cellar.sql new file mode 100644 index 0000000..e4c6bea --- /dev/null +++ b/parity/worlds/a-crowded-cellar.sql @@ -0,0 +1,652 @@ +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); +INSERT INTO characters_scenes VALUES(1000000002,1000000001); +INSERT INTO characters_scenes VALUES(1000000003,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, barrels and cart wheels.','Cudgels.','A market county.','A coaching inn on a wet road.','The inn has stood at the crossroads for a century.','Coin for beds, ale and stabling.','The county reeve keeps the road.','Harvest festivals.','2026-10-30 10:43:43.628832','2026-10-30 10:43:43.628832',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, 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_6608c248e8" +FOREIGN KEY ("story_id") + REFERENCES "stories" ("id") +); +INSERT INTO characters VALUES(1000000001,1000000001,'Nell','Nell',33,'female','Plain-spoken.','A soaked cloak.','A dry corner.','Crowds.','Sleeping in the road.','A tinker caught out by the rain.',0,'2026-10-30 10:43:43.797067','2026-10-30 10:43:43.797067',1000000001,1,NULL,0,10,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000002,1000000001,'Hob Allard','Hob',44,'male','Gruff and fair.','A stained apron.','A full house.','Unpaid tabs.','A cold hearth.','The innkeeper, who has run the Lantern for twenty years.',0,'2026-10-30 10:43:43.829152','2026-10-30 10:43:43.829152',1000000001,0,1000000001,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000003,1000000001,'Ida Fenn','Ida',27,'female','Quick and wry.','Rolled sleeves.','Tips.','Spilled ale.','Deep water.','A barmaid saving for a boat of her own.',0,'2026-10-30 10:43:43.834649','2026-10-30 10:43:43.834649',1000000001,0,1000000001,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000004,1000000001,'Moss Tarrow','Moss',51,'male','Slow and certain.','A floury shirt.','Fresh bread.','Haste.','Fire in the flue.','The cook, who came with the inn.',0,'2026-10-30 10:43:43.839521','2026-10-30 10:43:43.839521',1000000001,0,1000000002,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000005,1000000001,'Pell Quill','Pell',19,'non-binary','Eager and clumsy.','Wet cuffs.','Praise.','Scouring pots.','The cook''s temper.','A scullion learning the trade.',0,'2026-10-30 10:43:43.851223','2026-10-30 10:43:43.851223',1000000001,0,1000000002,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000006,1000000001,'Rue Ambry','Rue',36,'female','Tired and patient.','A dusty coat.','A hot meal.','Delays.','A lame horse.','A carter waiting for her supper.',0,'2026-10-30 10:43:43.857509','2026-10-30 10:43:43.857509',1000000001,0,1000000002,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000007,1000000001,'Tam Brisk','Tam',23,'male','Cheerful and loud.','Straw in his hair.','Horses.','Tight fists.','Being kicked.','The ostler who minds the guests'' horses.',0,'2026-10-30 10:43:43.861686','2026-10-30 10:43:43.861686',1000000001,0,1000000003,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000008,1000000001,'Vey Corran','Vey',40,'female','Watchful.','A long oilskin.','Open roads.','Fences.','Wolves.','A drover passing through with her herd.',0,'2026-10-30 10:43:43.865582','2026-10-30 10:43:43.865582',1000000001,0,1000000003,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000009,1000000001,'Wick Dunmore','Wick',62,'male','Talkative.','A patched pack.','A good story.','Paying for a bed.','Dying alone.','An old pedlar sleeping in the hay to save a coin.',0,'2026-10-30 10:43:43.869814','2026-10-30 10:43:43.869814',1000000001,0,1000000003,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000010,1000000001,'Yara Holt','Yara',31,'female','Restless.','Riding boots.','Speed.','Waiting.','A lost letter.','A courier resting between runs.',0,'2026-10-30 10:43:43.874924','2026-10-30 10:43:43.874924',1000000001,0,1000000004,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000011,1000000001,'Zeb Marrow','Zeb',29,'male','Easygoing.','A green waistcoat.','Applause.','Silence.','A broken string.','A fiddler hired for the evening.',0,'2026-10-30 10:43:43.878653','2026-10-30 10:43:43.878653',1000000001,0,1000000004,0,3,8,12,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO characters VALUES(1000000012,1000000001,'Ash Penrose','Ash',34,'trans man','Precise.','Ink on his fingers.','Straight lines.','Muddle.','Getting lost.','A surveyor laid up by the rain.',0,'2026-10-30 10:43:43.882211','2026-10-30 10:43:43.882211',1000000001,0,1000000004,0,3,8,12,12,12,0,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 "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, 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-10-30 10:43:43.955954','2026-10-30 10:43:43.955954',NULL,NULL,'open',NULL); +INSERT INTO location_connections VALUES(1000000002,1000000002,1000000001,'adjacent','about a minute','walking','2026-10-30 10:43:43.959238','2026-10-30 10:43:43.959238',NULL,NULL,'open',NULL); +INSERT INTO location_connections VALUES(1000000003,1000000001,1000000003,'adjacent','about a minute','walking','2026-10-30 10:43:43.961243','2026-10-30 10:43:43.961243',NULL,NULL,'open',NULL); +INSERT INTO location_connections VALUES(1000000004,1000000003,1000000001,'adjacent','about a minute','walking','2026-10-30 10:43:43.965996','2026-10-30 10:43:43.965996',NULL,NULL,'open',NULL); +INSERT INTO location_connections VALUES(1000000005,1000000001,1000000004,'adjacent','about a minute','walking','2026-10-30 10:43:43.967724','2026-10-30 10:43:43.967724',NULL,NULL,'open',NULL); +INSERT INTO location_connections VALUES(1000000006,1000000004,1000000001,'adjacent','about a minute','walking','2026-10-30 10:43:43.969040','2026-10-30 10:43:43.969040',NULL,NULL,'open',NULL); +INSERT INTO location_connections VALUES(1000000007,1000000001,1000000005,'adjacent','about a minute','walking','2026-10-30 10:43:43.970085','2026-10-30 10:43:43.970085',NULL,NULL,'open',NULL); +INSERT INTO location_connections VALUES(1000000008,1000000005,1000000001,'adjacent','about a minute','walking','2026-10-30 10:43:43.979407','2026-10-30 10:43:43.979407',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, 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,'Taproom','Benches packed shoulder to shoulder under smoky beams.','The Lantern''s taproom has never been this full.',NULL,NULL,'2026-10-30 10:43:43.674420','2026-10-30 10:43:43.674420','realized','A packed taproom.',0,'safe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO locations VALUES(1000000002,1000000001,'Kitchen','Steam, copper pans and a roaring range.','The range was built with the inn.',NULL,NULL,'2026-10-30 10:43:43.686293','2026-10-30 10:43:43.686293','realized','A hot kitchen.',0,'safe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO locations VALUES(1000000003,1000000001,'Stable','Stalls of steaming horses and a hayloft ladder.','Every stall is let tonight.',NULL,NULL,'2026-10-30 10:43:43.694934','2026-10-30 10:43:43.694934','realized','A busy stable.',0,'safe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO locations VALUES(1000000004,1000000001,'Loft','Pallets laid end to end under the eaves.','The loft is let by the pallet.',NULL,NULL,'2026-10-30 10:43:43.707747','2026-10-30 10:43:43.707747','realized','A crowded loft.',0,'safe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO locations VALUES(1000000005,1000000001,'Cellar',NULL,NULL,NULL,NULL,'2026-10-30 10:43:43.722943','2026-10-30 10:43:43.722943','stub','Steps down to the barrels.',0,'safe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'a crowd',NULL,NULL,NULL,NULL); +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_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_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,'Countryfolk','Ordinary people of the county.','2026-10-30 10:43:43.632356','2026-10-30 10:43:43.632356',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 dripping by the taproom door.','2026-09-21 19:00:00','Nell comes in out of the rain.','2026-10-30 10:43:44.133098','2026-10-30 10:43:44.133098',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,'A Crowded Cellar (engine sweep)','country adventure','The Lantern Inn is full to the rafters on a wet night.','Nell looks for room in a full inn.','2026-09-21 19:00:00',1000000001,'2026-10-30 10:43:43.651026','2026-10-30 10:43:43.651026',NULL,20,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('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-10-30 10:43:42.317995','2026-10-30 10:43:42.317999'); +INSERT INTO ar_internal_metadata VALUES('schema_sha1','ebdda9bf12dc2d5493a426a2e64de0ed551652b9','2026-10-30 10:43:42.324377','2026-10-30 10:43:42.324380'); +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',1000000012); +INSERT INTO sqlite_sequence VALUES('chats',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',1000000008); +INSERT INTO sqlite_sequence VALUES('locations',1000000005); +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_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_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_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_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_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_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/parity/worlds/a-dose-beyond-two-doors.sql b/parity/worlds/a-dose-beyond-two-doors.sql index 537a27e..d6b4781 100644 --- a/parity/worlds/a-dose-beyond-two-doors.sql +++ b/parity/worlds/a-dose-beyond-two-doors.sql @@ -299,11 +299,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:09.982420','You stand beside the workbench and the locked storeroom door.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-10 12:00:00','Cal enters the workshop.',NULL,'2026-10-02 13:26:09.982420'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:09.590338',NULL,'town adventure','Supplies wait beside a locked storeroom and a jammed loft door.','2026-09-10 12:00:00','Cal can use the supplies and open a way through the workshop.','A Dose Beyond Two Doors (engine sweep)',1000000001,'2026-10-02 13:26:09.590338'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:09.590338',NULL,'town adventure','Supplies wait beside a locked storeroom and a jammed loft door.','2026-09-10 12:00:00','Cal can use the supplies and open a way through the workshop.','A Dose Beyond Two Doors (engine sweep)',1000000001,'2026-10-02 13:26:09.590338',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -413,6 +413,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-friend-at-the-gate.sql b/parity/worlds/a-friend-at-the-gate.sql index 569aacc..24c1ce1 100644 --- a/parity/worlds/a-friend-at-the-gate.sql +++ b/parity/worlds/a-friend-at-the-gate.sql @@ -306,11 +306,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,1000000001,1000000001,NULL,'You stand with Maren beside the gate to the courtyard.','2026-09-08 12:00:00','Cal meets Maren at the market gate.','2026-10-27 12:13:21.602987','2026-10-27 12:13:21.602987',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, CONSTRAINT "fk_rails_2a912ea846" +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,'A Friend at the Gate (engine sweep)','town adventure','Maren has agreed to walk the old way with Cal, if Cal asks.','Cal and Maren cross the courtyard to the lane together, or Cal goes alone.','2026-09-08 12:00:00',1000000001,'2026-10-27 12:13:20.990086','2026-10-27 12:13:20.990086',NULL); +INSERT INTO stories VALUES(1000000001,'A Friend at the Gate (engine sweep)','town adventure','Maren has agreed to walk the old way with Cal, if Cal asks.','Cal and Maren cross the courtyard to the lane together, or Cal goes alone.','2026-09-08 12:00:00',1000000001,'2026-10-27 12:13:20.990086','2026-10-27 12:13:20.990086',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") @@ -420,6 +420,7 @@ INSERT INTO schema_migrations VALUES('20250822184651'); INSERT INTO schema_migrations VALUES('20250822184650'); INSERT INTO schema_migrations VALUES('20250822184649'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-27 12:10:16.651328','2026-10-27 12:10:16.651334'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','deec051e019741f5fc4e8fe09fff00a4e1d2f04d','2026-10-27 12:10:16.662468','2026-10-27 12:10:16.662473'); diff --git a/parity/worlds/a-key-for-the-other-door.sql b/parity/worlds/a-key-for-the-other-door.sql index dffc4cc..729c018 100644 --- a/parity/worlds/a-key-for-the-other-door.sql +++ b/parity/worlds/a-key-for-the-other-door.sql @@ -298,11 +298,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:54.604451','You stand between the cellar door and the storeroom door, both locked.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-10 12:00:00','Mar enters the workshop.',NULL,'2026-10-02 13:25:54.604451'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:54.212571',NULL,'town adventure','One key lies beside two locked doors.','2026-09-10 12:00:00','Mar can open one door with the key and try the other with a wire.','A Key for the Other Door (engine sweep)',1000000001,'2026-10-02 13:25:54.212571'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:54.212571',NULL,'town adventure','One key lies beside two locked doors.','2026-09-10 12:00:00','Mar can open one door with the key and try the other with a wire.','A Key for the Other Door (engine sweep)',1000000001,'2026-10-02 13:25:54.212571',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -412,6 +412,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-lock-in-the-moving-city.sql b/parity/worlds/a-lock-in-the-moving-city.sql index 5297549..1c07aec 100644 --- a/parity/worlds/a-lock-in-the-moving-city.sql +++ b/parity/worlds/a-lock-in-the-moving-city.sql @@ -296,11 +296,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:59.994485','You stand beside the locked door in the moving workshop.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-10 23:55:00','Cal enters the workshop.',NULL,'2026-10-02 13:25:59.994485'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:59.651915',NULL,'town adventure','You carry the key to a doorway whose far end moves with the city.','2026-09-10 23:55:00','Cal opens a door before the streets rearrange.','A Lock in the Moving City (engine sweep)',1000000001,'2026-10-02 13:25:59.651915'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:59.651915',NULL,'town adventure','You carry the key to a doorway whose far end moves with the city.','2026-09-10 23:55:00','Cal opens a door before the streets rearrange.','A Lock in the Moving City (engine sweep)',1000000001,'2026-10-02 13:25:59.651915',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -411,6 +411,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-lodge-inside-the-gate.sql b/parity/worlds/a-lodge-inside-the-gate.sql index 5b3c29f..9d0a913 100644 --- a/parity/worlds/a-lodge-inside-the-gate.sql +++ b/parity/worlds/a-lodge-inside-the-gate.sql @@ -300,11 +300,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:51.143413','You stand in the vaulted passage under the gate, a toll token in your hand. A door opens either side.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-25 07:40:00','Wren comes in under the town gate.',NULL,'2026-10-02 13:25:51.143413'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:50.694939',NULL,'town adventure','The gate is open, and somebody on either side of the passage has seen you.','2026-09-25 07:40:00','Wren has come through the town gate with a toll token and must pass the lodge or the booth.','A Lodge Inside the Gate (engine sweep)',1000000001,'2026-10-02 13:25:50.694939'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:50.694939',NULL,'town adventure','The gate is open, and somebody on either side of the passage has seen you.','2026-09-25 07:40:00','Wren has come through the town gate with a toll token and must pass the lodge or the booth.','A Lodge Inside the Gate (engine sweep)',1000000001,'2026-10-02 13:25:50.694939',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -414,6 +414,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-turn-at-the-gate.sql b/parity/worlds/a-turn-at-the-gate.sql index aef3ad6..4e5efb2 100644 --- a/parity/worlds/a-turn-at-the-gate.sql +++ b/parity/worlds/a-turn-at-the-gate.sql @@ -296,11 +296,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:08.272568','You face Maren beside the gate to the courtyard.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-08 12:00:00','Cal meets Maren at the market gate.',NULL,'2026-10-02 13:26:08.272568'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:07.937153',NULL,'town adventure','A misunderstanding has closed the courtyard gate.','2026-09-08 12:00:00','Cal and Maren can settle their disagreement and travel together.','A Turn at the Gate (engine sweep)',1000000001,'2026-10-02 13:26:07.937153'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:07.937153',NULL,'town adventure','A misunderstanding has closed the courtyard gate.','2026-09-08 12:00:00','Cal and Maren can settle their disagreement and travel together.','A Turn at the Gate (engine sweep)',1000000001,'2026-10-02 13:26:07.937153',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -410,6 +410,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-window-over-the-yard.sql b/parity/worlds/a-window-over-the-yard.sql index 9e82539..87baa56 100644 --- a/parity/worlds/a-window-over-the-yard.sql +++ b/parity/worlds/a-window-over-the-yard.sql @@ -298,11 +298,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:52.893010','The lane runs up to the farm gate, and the loft window above the yard is open.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-20 07:00:00','The story opens in the lane outside Halloway Farm.',NULL,'2026-10-02 13:25:52.893010'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:52.535642',NULL,'rural mystery','The farmhouse door is bolted from the inside, and the loft window is standing open.','2026-09-20 07:00:00','Wenna Halloway comes home up the lane to a house she cannot get into by the door.','A Window Over the Yard (engine sweep)',1000000001,'2026-10-02 13:25:52.535642'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:52.535642',NULL,'rural mystery','The farmhouse door is bolted from the inside, and the loft window is standing open.','2026-09-20 07:00:00','Wenna Halloway comes home up the lane to a house she cannot get into by the door.','A Window Over the Yard (engine sweep)',1000000001,'2026-10-02 13:25:52.535642',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -412,6 +412,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-writ-on-the-copying-desk.sql b/parity/worlds/a-writ-on-the-copying-desk.sql index d436c51..4deed9c 100644 --- a/parity/worlds/a-writ-on-the-copying-desk.sql +++ b/parity/worlds/a-writ-on-the-copying-desk.sql @@ -307,11 +307,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-26 02:10:12.018967','You are alone in the copying room, with the blank writ on the desk.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-10-25 09:00:00','Tamsin comes into the copying room for the blank writ.',NULL,'2026-10-26 02:10:12.018967'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-26 02:10:11.378462',NULL,'town adventure','The registrar wants the blank writ carried to the archive before noon.','2026-10-25 09:00:00','Tamsin has the copying room to herself and a writ to deliver.','A Writ On The Copying Desk (engine sweep)',1000000001,'2026-10-26 02:10:11.378462'); +INSERT INTO stories VALUES(1000000001,'2026-10-26 02:10:11.378462',NULL,'town adventure','The registrar wants the blank writ carried to the archive before noon.','2026-10-25 09:00:00','Tamsin has the copying room to herself and a writ to deliver.','A Writ On The Copying Desk (engine sweep)',1000000001,'2026-10-26 02:10:11.378462',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -421,6 +421,7 @@ INSERT INTO schema_migrations VALUES('20250822184651'); INSERT INTO schema_migrations VALUES('20250822184650'); INSERT INTO schema_migrations VALUES('20250822184649'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-26 02:09:45.289336','2026-10-26 02:09:45.289340'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','9fcff787fff0ed60123ee84a65c7f80738f353f3','2026-10-26 02:09:45.295415','2026-10-26 02:09:45.295421'); diff --git a/parity/worlds/a-written-mill-beside-a-stub.sql b/parity/worlds/a-written-mill-beside-a-stub.sql index 25904ea..a85cea9 100644 --- a/parity/worlds/a-written-mill-beside-a-stub.sql +++ b/parity/worlds/a-written-mill-beside-a-stub.sql @@ -292,11 +292,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:04.742332','You stand outside the workshop door.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-08 12:00:00','Cal arrives at the market.',NULL,'2026-10-02 13:26:04.742332'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:04.460643',NULL,'town adventure','A workshop and an old mill stand off the market.','2026-09-08 12:00:00','Cal opens the workshop beside the market.','A Written Mill Beside a Stub (engine sweep)',1000000001,'2026-10-02 13:26:04.460643'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:04.460643',NULL,'town adventure','A workshop and an old mill stand off the market.','2026-09-08 12:00:00','Cal opens the workshop beside the market.','A Written Mill Beside a Stub (engine sweep)',1000000001,'2026-10-02 13:26:04.460643',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -406,6 +406,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/a-yard-before-the-winter.sql b/parity/worlds/a-yard-before-the-winter.sql index f175d90..0251f3d 100644 --- a/parity/worlds/a-yard-before-the-winter.sql +++ b/parity/worlds/a-yard-before-the-winter.sql @@ -306,11 +306,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:41.901021','You stand in the farmyard as the frost lifts.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-12 06:00:00','Tamsin starts the day in the yard.',NULL,'2026-10-02 13:25:41.901021'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:41.358295',NULL,'rural mystery','The salt road is closed and winter is coming.','2026-09-12 06:00:00','Tamsin must reopen the salt road before the first snow.','A Yard Before the Winter (engine sweep)',1000000001,'2026-10-02 13:25:41.358295'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:41.358295',NULL,'rural mystery','The salt road is closed and winter is coming.','2026-09-12 06:00:00','Tamsin must reopen the salt road before the first snow.','A Yard Before the Winter (engine sweep)',1000000001,'2026-10-02 13:25:41.358295',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -420,6 +420,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-cloakroom-at-the-ferry.sql b/parity/worlds/the-cloakroom-at-the-ferry.sql index 6bc8a14..bde9f06 100644 --- a/parity/worlds/the-cloakroom-at-the-ferry.sql +++ b/parity/worlds/the-cloakroom-at-the-ferry.sql @@ -306,11 +306,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-25 22:48:33.241107','You shoulder the door shut against the wind.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-10-25 06:00:00','Wren arrives at the ferry cloakroom.',NULL,'2026-10-25 22:48:33.241107'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-25 22:48:32.809237',NULL,'town adventure','A cloakroom at the ferry stairs, where the crossing waits for the tide.','2026-10-25 06:00:00','Wren Calloway comes in out of the wind to wait for the ferry.','The Cloakroom at the Ferry (engine sweep)',1000000001,'2026-10-25 22:48:32.809237'); +INSERT INTO stories VALUES(1000000001,'2026-10-25 22:48:32.809237',NULL,'town adventure','A cloakroom at the ferry stairs, where the crossing waits for the tide.','2026-10-25 06:00:00','Wren Calloway comes in out of the wind to wait for the ferry.','The Cloakroom at the Ferry (engine sweep)',1000000001,'2026-10-25 22:48:32.809237',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -420,6 +420,7 @@ INSERT INTO schema_migrations VALUES('20250822184650'); INSERT INTO schema_migrations VALUES('20250822184649'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-25 22:48:20.183741','2026-10-25 22:48:20.183743'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','1ce6b3b7eea61111c69aac54baf282539c772990','2026-10-25 22:48:20.187552','2026-10-25 22:48:20.187553'); diff --git a/parity/worlds/the-furnished-rooms.sql b/parity/worlds/the-furnished-rooms.sql index 6ce5827..e75a683 100644 --- a/parity/worlds/the-furnished-rooms.sql +++ b/parity/worlds/the-furnished-rooms.sql @@ -307,11 +307,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:45.460900','You stand in the clerk''s study.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-28 09:00:00','Mira arrives in the study.',NULL,'2026-10-02 13:25:45.460900'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:45.056947',NULL,'town adventure','A clerk''s study opens onto a wood and a market.','2026-09-28 09:00:00','Mira looks over the ward clerk''s rooms.','The Furnished Rooms (engine sweep)',1000000001,'2026-10-02 13:25:45.056947'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:45.056947',NULL,'town adventure','A clerk''s study opens onto a wood and a market.','2026-09-28 09:00:00','Mira looks over the ward clerk''s rooms.','The Furnished Rooms (engine sweep)',1000000001,'2026-10-02 13:25:45.056947',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -421,6 +421,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-green-at-saltmarsh.sql b/parity/worlds/the-green-at-saltmarsh.sql index 0f32c29..354d66c 100644 --- a/parity/worlds/the-green-at-saltmarsh.sql +++ b/parity/worlds/the-green-at-saltmarsh.sql @@ -299,11 +299,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:03.225594','The green runs down to the ropewalk, and Wat Coyle is mending a net on it.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-21 07:00:00','The story opens on Saltmarsh Green, outside the ropewalk.',NULL,'2026-10-02 13:26:03.225594'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:02.877768',NULL,'village mystery','A new cable parted on its first day in harbour, and the ropewalk laid it.','2026-09-21 07:00:00','Jory Pask crosses the green to the ropewalk with an armful of the walk''s gear.','The Green at Saltmarsh (engine sweep)',1000000001,'2026-10-02 13:26:02.877768'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:02.877768',NULL,'village mystery','A new cable parted on its first day in harbour, and the ropewalk laid it.','2026-09-21 07:00:00','Jory Pask crosses the green to the ropewalk with an armful of the walk''s gear.','The Green at Saltmarsh (engine sweep)',1000000001,'2026-10-02 13:26:02.877768',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -413,6 +413,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-iron-gate-descends.sql b/parity/worlds/the-iron-gate-descends.sql index 06d9fa0..b851ace 100644 --- a/parity/worlds/the-iron-gate-descends.sql +++ b/parity/worlds/the-iron-gate-descends.sql @@ -359,11 +359,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:06.715927','The first thing that hits you is the stench of wet iron and old blood, thick enough to coat your throat. Then comes the cold—damp, seeping through the seams of your armor as your boot crunches on something brittle in the mud. The air hums faintly, a vibration in your teeth, and the dim glow of the fungi pulses like a slow, dying heartbeat against the black stone. The gate’s jagged teeth yawn behind you, but the tunnel ahead swallows the light whole, leaving only the sound of something shifting in the dark.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-05 20:17:00','The player steps into the Iron Gate Chamber, encountering the sensory overload of the cavern’s atmosphere and the immediate presence of the tunnel ahead.',NULL,'2026-10-02 13:26:06.715927'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:06.023309',NULL,'dark fantasy','The iron gate groans as it settles into the stone, its teeth biting into the threshold with a finality that echoes through the cavern. You stand in the dim glow of bioluminescent fungi, the air thick with the scent of damp earth and old blood. Your gauntleted hand rests on the hilt of your Veldarian sword, its edge still sharp despite the weight of the blackened plate armor pressing into your shoulders. The prince’s signet ring, cold in your palm, was found in the mud outside this gate—proof he passed this way. Behind you, the tunnel slopes upward, but the way forward is a yawning maw of obsidian, the walls slick with moisture. Somewhere in the dark, something skitters.','2026-09-05 20:17:00','A Durnish knight, clad in heavy blackened plate, stands at the threshold of the goblin caves beneath the Ashen Spire, having just forced open an iron gate. The prince’s signet ring, discovered in the mud, confirms his passage into the tunnels. The air is thick with the scent of damp earth and the faint glow of fungi, while the distant sound of movement hints at unseen dangers ahead. The Church’s decree to retrieve the prince or die trying weighs heavily, but the immediate threat is the darkness itself.','The Iron Gate Descends (engine sweep)',1000000001,'2026-10-02 13:26:06.023309'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:06.023309',NULL,'dark fantasy','The iron gate groans as it settles into the stone, its teeth biting into the threshold with a finality that echoes through the cavern. You stand in the dim glow of bioluminescent fungi, the air thick with the scent of damp earth and old blood. Your gauntleted hand rests on the hilt of your Veldarian sword, its edge still sharp despite the weight of the blackened plate armor pressing into your shoulders. The prince’s signet ring, cold in your palm, was found in the mud outside this gate—proof he passed this way. Behind you, the tunnel slopes upward, but the way forward is a yawning maw of obsidian, the walls slick with moisture. Somewhere in the dark, something skitters.','2026-09-05 20:17:00','A Durnish knight, clad in heavy blackened plate, stands at the threshold of the goblin caves beneath the Ashen Spire, having just forced open an iron gate. The prince’s signet ring, discovered in the mud, confirms his passage into the tunnels. The air is thick with the scent of damp earth and the faint glow of fungi, while the distant sound of movement hints at unseen dangers ahead. The Church’s decree to retrieve the prince or die trying weighs heavily, but the immediate threat is the darkness itself.','The Iron Gate Descends (engine sweep)',1000000001,'2026-10-02 13:26:06.023309',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -473,6 +473,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-landing-stair.sql b/parity/worlds/the-landing-stair.sql index 1653d80..56d24de 100644 --- a/parity/worlds/the-landing-stair.sql +++ b/parity/worlds/the-landing-stair.sql @@ -302,11 +302,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:13.533115','The tide is out and the stair house door is standing open, which it has no business doing.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-06 19:00:00','The story opens on the quay with the stair house standing open.',NULL,'2026-10-02 13:26:13.533115'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:13.035791',NULL,'harbour mystery','The stair house has been locked since noon and the seal on the door is broken.','2026-09-06 19:00:00','Somebody was inside the stair house when the whole quay says it was empty.','The Landing Stair (engine sweep)',1000000001,'2026-10-02 13:26:13.035791'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:13.035791',NULL,'harbour mystery','The stair house has been locked since noon and the seal on the door is broken.','2026-09-06 19:00:00','Somebody was inside the stair house when the whole quay says it was empty.','The Landing Stair (engine sweep)',1000000001,'2026-10-02 13:26:13.035791',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -416,6 +416,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-lunar-cartographer.sql b/parity/worlds/the-lunar-cartographer.sql index 1d1b8bd..f38f618 100644 --- a/parity/worlds/the-lunar-cartographer.sql +++ b/parity/worlds/the-lunar-cartographer.sql @@ -327,11 +327,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,1000000001,1000000001,NULL,'Your pen stops halfway through a bearing, because there is somebody breathing in the doorway. Old Grenn has come up to the third floor after dark, which in four years he has never once done, and he is holding his ledger flat against his chest like a man who means to read aloud from it. The lamp throws his shadow across the half-finished map, across the two blocks of the Larkspur Quarter you have not been able to make agree since morning. He does not say anything. Neither do you. Plaster ticks down out of the ceiling between you, and below the window Mournwell Lane has already gone silver, and somewhere under the floorboards the building begins, very slightly, to turn.','2026-08-31 23:00:00','The story opens in Room 3 with Grenn Ollivar standing in the doorway after dark, the rent due by morning, and the city starting to move.','2026-10-29 02:09:13.641212','2026-10-29 02:09:13.641212',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, CONSTRAINT "fk_rails_2a912ea846" +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 Lunar Cartographer (engine sweep)','Fantasy','The apartment smells of boiled cabbage and lamp oil. A fine dust of plaster drifts down from the ceiling where the building groans, settling itself into its new configuration for the night. You sit at the oak table by the window, watching motes swirl in the amber light of your kerosene lamp. Across the scarred wood, a half-finished map of Nocturnis spreads out like a rumor you can''t quite believe. The Larkspur Quarter, where you woke this morning, has already migrated two blocks north by your last bearings. The Bell of Saint Aravel chimes once in the distance—11 p.m., or close enough. Outside the open window, the cobblestones of Mournwell Lane breathe with a faint, silvery luminescence, rearranging themselves with the patience of something that has done this for seventy-five years. Your landlord, old Grenn, has left a note under your door demanding the overdue rent by morning, or he''ll have your table and your instruments out in the lane by noon. The map is worth more than the rent. Both are due before the city forgets where it put this building.','The player is a cartographer hired by the Lunar Sovereigns to map the nightly rearrangements of the city of Nocturnis, where buildings, streets, and landmarks shift with the moon''s phases due to residual magical energy called Nocturna. As they work, they uncover conspiracies within the Sovereigns, encounter the displaced peoples of the Scorch Nomads and Verdant Folk, and grapple with the disorienting effects of prolonged exposure to Nocturna, which causes memory loss. The game''s tone is grounded, atmospheric, and focused on mystery and survival in a world that refuses to stay still.','2026-08-31 23:00:00',1000000001,'2026-10-29 02:09:12.949243','2026-10-29 02:09:12.949243',NULL); +INSERT INTO stories VALUES(1000000001,'The Lunar Cartographer (engine sweep)','Fantasy','The apartment smells of boiled cabbage and lamp oil. A fine dust of plaster drifts down from the ceiling where the building groans, settling itself into its new configuration for the night. You sit at the oak table by the window, watching motes swirl in the amber light of your kerosene lamp. Across the scarred wood, a half-finished map of Nocturnis spreads out like a rumor you can''t quite believe. The Larkspur Quarter, where you woke this morning, has already migrated two blocks north by your last bearings. The Bell of Saint Aravel chimes once in the distance—11 p.m., or close enough. Outside the open window, the cobblestones of Mournwell Lane breathe with a faint, silvery luminescence, rearranging themselves with the patience of something that has done this for seventy-five years. Your landlord, old Grenn, has left a note under your door demanding the overdue rent by morning, or he''ll have your table and your instruments out in the lane by noon. The map is worth more than the rent. Both are due before the city forgets where it put this building.','The player is a cartographer hired by the Lunar Sovereigns to map the nightly rearrangements of the city of Nocturnis, where buildings, streets, and landmarks shift with the moon''s phases due to residual magical energy called Nocturna. As they work, they uncover conspiracies within the Sovereigns, encounter the displaced peoples of the Scorch Nomads and Verdant Folk, and grapple with the disorienting effects of prolonged exposure to Nocturna, which causes memory loss. The game''s tone is grounded, atmospheric, and focused on mystery and survival in a world that refuses to stay still.','2026-08-31 23:00:00',1000000001,'2026-10-29 02:09:12.949243','2026-10-29 02:09:12.949243',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") @@ -444,6 +444,7 @@ INSERT INTO schema_migrations VALUES('20250823023925'); INSERT INTO schema_migrations VALUES('20250822184651'); INSERT INTO schema_migrations VALUES('20250822184650'); INSERT INTO schema_migrations VALUES('20250822184649'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-29 02:06:59.131845','2026-10-29 02:06:59.131848'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','9ea7d9a7496841168065535777683ed7c64300e0','2026-10-29 02:06:59.136646','2026-10-29 02:06:59.136649'); diff --git a/parity/worlds/the-pottery-on-mill-lane.sql b/parity/worlds/the-pottery-on-mill-lane.sql index d7e96cd..35ed1a4 100644 --- a/parity/worlds/the-pottery-on-mill-lane.sql +++ b/parity/worlds/the-pottery-on-mill-lane.sql @@ -306,11 +306,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:01.664124','Mill Lane runs down to the river, and the pottery door stands open onto it.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-21 08:00:00','The story opens in Mill Lane, outside the Hollin pottery.',NULL,'2026-10-02 13:26:01.664124'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:01.231010',NULL,'domestic mystery','The kiln was fired in the night, and nobody in the family will say who lit it.','2026-09-21 08:00:00','Ada Hollin comes up Mill Lane with her arms full, to find the kiln still warm.','The Pottery on Mill Lane (engine sweep)',1000000001,'2026-10-02 13:26:01.231010'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:01.231010',NULL,'domestic mystery','The kiln was fired in the night, and nobody in the family will say who lit it.','2026-09-21 08:00:00','Ada Hollin comes up Mill Lane with her arms full, to find the kiln still warm.','The Pottery on Mill Lane (engine sweep)',1000000001,'2026-10-02 13:26:01.231010',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -420,6 +420,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-quay-house.sql b/parity/worlds/the-quay-house.sql index b2df7d2..22ac6bb 100644 --- a/parity/worlds/the-quay-house.sql +++ b/parity/worlds/the-quay-house.sql @@ -341,11 +341,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:36.729866','The tide is out and the custom house door is standing open, which it has no business doing.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-06 19:00:00','The story opens on the quay with the custom house standing open.',NULL,'2026-10-02 13:25:36.729866'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:36.115392',NULL,'harbour mystery','The custom house has been locked since noon and the seal on the door is broken.','2026-09-06 19:00:00','Somebody was inside the custom house when the whole quay says it was empty.','The Quay House (engine sweep)',1000000001,'2026-10-02 13:25:36.115392'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:36.115392',NULL,'harbour mystery','The custom house has been locked since noon and the seal on the door is broken.','2026-09-06 19:00:00','Somebody was inside the custom house when the whole quay says it was empty.','The Quay House (engine sweep)',1000000001,'2026-10-02 13:25:36.115392',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -455,6 +455,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-rook-wood-gate.sql b/parity/worlds/the-rook-wood-gate.sql index 1bd9897..70c49ca 100644 --- a/parity/worlds/the-rook-wood-gate.sql +++ b/parity/worlds/the-rook-wood-gate.sql @@ -289,11 +289,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-15 21:45:56.007751','You stand at the ward''s back gate.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-28 09:00:00','Tamsin comes to the gate.',NULL,'2026-10-15 21:45:56.007751'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-15 21:45:55.686665',NULL,'town adventure','The ward''s back gate opens onto a wood.','2026-09-28 09:00:00','Tamsin goes out of the gate for firewood.','The Rook Wood Gate (engine sweep)',1000000001,'2026-10-15 21:45:55.686665'); +INSERT INTO stories VALUES(1000000001,'2026-10-15 21:45:55.686665',NULL,'town adventure','The ward''s back gate opens onto a wood.','2026-09-28 09:00:00','Tamsin goes out of the gate for firewood.','The Rook Wood Gate (engine sweep)',1000000001,'2026-10-15 21:45:55.686665',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -403,6 +403,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-15 21:43:40.193939','2026-10-15 21:43:40.193941'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','62d31b9fa38811bdb1f557cc2a6f6d523066e2aa','2026-10-15 21:43:40.198165','2026-10-15 21:43:40.198167'); diff --git a/parity/worlds/the-ropewalk-at-saltmarsh.sql b/parity/worlds/the-ropewalk-at-saltmarsh.sql index cc4ecab..f8681c4 100644 --- a/parity/worlds/the-ropewalk-at-saltmarsh.sql +++ b/parity/worlds/the-ropewalk-at-saltmarsh.sql @@ -299,11 +299,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:26:03.225594','The green runs down to the ropewalk, and Wat Coyle is mending a net on it.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-21 07:00:00','The story opens on Saltmarsh Green, outside the ropewalk.',NULL,'2026-10-02 13:26:03.225594'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:02.877768',NULL,'village mystery','A new cable parted on its first day in harbour, and the ropewalk laid it.','2026-09-21 07:00:00','Jory Pask crosses the green to the ropewalk with an armful of the walk''s gear.','The Ropewalk at Saltmarsh (engine sweep)',1000000001,'2026-10-02 13:26:02.877768'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:26:02.877768',NULL,'village mystery','A new cable parted on its first day in harbour, and the ropewalk laid it.','2026-09-21 07:00:00','Jory Pask crosses the green to the ropewalk with an armful of the walk''s gear.','The Ropewalk at Saltmarsh (engine sweep)',1000000001,'2026-10-02 13:26:02.877768',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -413,6 +413,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-salt-assizes.sql b/parity/worlds/the-salt-assizes.sql index 6222131..1750e17 100644 --- a/parity/worlds/the-salt-assizes.sql +++ b/parity/worlds/the-salt-assizes.sql @@ -320,11 +320,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,1000000001,1000000001,NULL,'The chalk is still under your thumb and it is still not your handwriting. You are standing at the slate in the open court on Gallows Rock with the mile of causeway behind you already darkening at its edges, and Justicar Brace is on the bench in his gown with his hands folded, waiting to be told how long he has. Out past the low wall the flats are silvering over the way they do an hour before they stop being flats. The bell hangs on its hook at your shoulder, cold, and the figure chalked above the day''s cases says ten minutes past eight in a hand that has your slant and none of your pressure. From the post at the seaward end of the rock, faint over the surf, somebody is calling a name, and it is not yours.','2026-09-01 05:20:00','The story opens in the Causeway Court with the day''s high water altered on the tide-slate by seventy minutes, the Justicar waiting on the bench for a number, and the chained man audible from the tide post.','2026-10-29 02:09:15.636465','2026-10-29 02:09:15.636465',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, CONSTRAINT "fk_rails_2a912ea846" +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 Salt Assizes (engine sweep)','tidal legal mystery','You have rung this court up and down for nineteen years and you have never once been wrong about the water, which is why the chalk on the tide-slate is wrong in somebody else''s hand. High water is written as ten minutes past eight. High water is at seven. You wrote seven yourself, last night, on a dry board in a still room, and the figure on the slate now is not yours and is close enough to yours to pass. Out at the post, Neb Halloran has been chained since the ebb for a wrecking nobody on this coast believes he did alone, and his hearing is set for the last hour before the turn -- an hour that, on that chalk, does not exist. The Justicar is already in the court with his gown on. The bell is on its hook. Whoever moved seventy minutes has given the water time to do what the court would have had to sign for.','The player is Coraith Vell, Bell-Keeper of the Assize causeway, who finds the day''s high water altered by seventy minutes in a hand that is almost her own. The chained man at the tide post has a hearing in an hour the false chalk has erased, so working out who changed it means reading the court''s own papers against the water: the Justicar who needs a verdict, the wreck that serves as the vestry, and the question of who benefits from a drowning the record will call a delay. The tone is cold, procedural and out of doors, and the clock is the sea.','2026-09-01 05:20:00',1000000001,'2026-10-29 02:09:15.036495','2026-10-29 02:09:15.036495',NULL); +INSERT INTO stories VALUES(1000000001,'The Salt Assizes (engine sweep)','tidal legal mystery','You have rung this court up and down for nineteen years and you have never once been wrong about the water, which is why the chalk on the tide-slate is wrong in somebody else''s hand. High water is written as ten minutes past eight. High water is at seven. You wrote seven yourself, last night, on a dry board in a still room, and the figure on the slate now is not yours and is close enough to yours to pass. Out at the post, Neb Halloran has been chained since the ebb for a wrecking nobody on this coast believes he did alone, and his hearing is set for the last hour before the turn -- an hour that, on that chalk, does not exist. The Justicar is already in the court with his gown on. The bell is on its hook. Whoever moved seventy minutes has given the water time to do what the court would have had to sign for.','The player is Coraith Vell, Bell-Keeper of the Assize causeway, who finds the day''s high water altered by seventy minutes in a hand that is almost her own. The chained man at the tide post has a hearing in an hour the false chalk has erased, so working out who changed it means reading the court''s own papers against the water: the Justicar who needs a verdict, the wreck that serves as the vestry, and the question of who benefits from a drowning the record will call a delay. The tone is cold, procedural and out of doors, and the clock is the sea.','2026-09-01 05:20:00',1000000001,'2026-10-29 02:09:15.036495','2026-10-29 02:09:15.036495',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") @@ -434,6 +434,7 @@ INSERT INTO schema_migrations VALUES('20250823023925'); INSERT INTO schema_migrations VALUES('20250822184651'); INSERT INTO schema_migrations VALUES('20250822184650'); INSERT INTO schema_migrations VALUES('20250822184649'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-29 02:06:59.131845','2026-10-29 02:06:59.131848'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','9ea7d9a7496841168065535777683ed7c64300e0','2026-10-29 02:06:59.136646','2026-10-29 02:06:59.136649'); diff --git a/parity/worlds/the-unfinished-workshop.sql b/parity/worlds/the-unfinished-workshop.sql index adefc9f..b5de35e 100644 --- a/parity/worlds/the-unfinished-workshop.sql +++ b/parity/worlds/the-unfinished-workshop.sql @@ -289,11 +289,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:34.789340','You stand outside the workshop door.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-08 12:00:00','Cal arrives at the market.',NULL,'2026-10-02 13:25:34.789340'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:34.522883',NULL,'town adventure','A workshop opens onto the market.','2026-09-08 12:00:00','Cal visits Sella''s workshop.','The Unfinished Workshop (engine sweep)',1000000001,'2026-10-02 13:25:34.522883'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:34.522883',NULL,'town adventure','A workshop opens onto the market.','2026-09-08 12:00:00','Cal visits Sella''s workshop.','The Unfinished Workshop (engine sweep)',1000000001,'2026-10-02 13:25:34.522883',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -403,6 +403,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/parity/worlds/the-unrecorded-hour.sql b/parity/worlds/the-unrecorded-hour.sql index 9846b03..c703592 100644 --- a/parity/worlds/the-unrecorded-hour.sql +++ b/parity/worlds/the-unrecorded-hour.sql @@ -322,11 +322,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,1000000001,1000000001,NULL,'The gap in your daybook is still under your hand when the sound in the hallway stops being a sound and becomes a person. Sub-Inspector Rowe fills the doorway with the dark corridor behind him -- grey coat, Inspectorate seal on its chain, forty minutes early and entirely unhurried about being it. He looks at your desk, and at the stamp lying beside the daybook, and then for rather longer at the desk across from yours, cleared to the wood. Nothing in his face changes, which is worse than if something had. The mantle hisses over the two of you, the rain goes sideways past the glass, and behind you, close enough to touch, the narrow door of the supply closet stands exactly as unlocked as it has stood for eleven years.','2026-08-31 18:40:00','The story opens in Ward Office 12 with Sub-Inspector Rowe arriving forty minutes early, the missing hour still open on the daybook, and the uninventoried supply closet at the player''s back.','2026-10-29 02:09:17.618162','2026-10-29 02:09:17.618162',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, CONSTRAINT "fk_rails_2a912ea846" +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 Unrecorded Hour (engine sweep)','bureaucratic mystery','The stamp is still in your hand and the ink is still wet, and there is an hour missing out of the middle of your own daybook. Not a blank line: a clean, ruled gap between four and five o''clock, in your handwriting, with the running total carried straight across it as though nothing needed to be entered at all. You have worked Ward Office 12 for eleven years and you have never carried a total across a gap in your life. Rain is coming off the levee and going sideways past the window. Somewhere down the long hallway a door closes, and then another, nearer -- the Inspectorate does its rounds at seven and it is twenty past six. Perrin''s desk across the room has been cleared to the wood, and you cannot remember when, or by whom, or -- and this is the part that has your hands cold -- whether there was ever anybody sitting at it. There is one thing in this office nobody has audited in eleven years, and its door is behind you.','The player is a ward clerk in Ambry who finds an hour cut out of their own daybook and the desk opposite theirs cleared of a colleague they can no longer quite remember. Working out what happened in that hour means going through the Registry''s own paperwork against it: the supply closet nobody has inventoried, the long hallway with the Inspectorate coming up it, and eventually the question of who has blank writs and why one was spent on a Marginalia clerk in Ward Office 12. The tone is dry, close and procedural, and the horror is entirely administrative.','2026-08-31 18:40:00',1000000001,'2026-10-29 02:09:16.976735','2026-10-29 02:09:16.976735',NULL); +INSERT INTO stories VALUES(1000000001,'The Unrecorded Hour (engine sweep)','bureaucratic mystery','The stamp is still in your hand and the ink is still wet, and there is an hour missing out of the middle of your own daybook. Not a blank line: a clean, ruled gap between four and five o''clock, in your handwriting, with the running total carried straight across it as though nothing needed to be entered at all. You have worked Ward Office 12 for eleven years and you have never carried a total across a gap in your life. Rain is coming off the levee and going sideways past the window. Somewhere down the long hallway a door closes, and then another, nearer -- the Inspectorate does its rounds at seven and it is twenty past six. Perrin''s desk across the room has been cleared to the wood, and you cannot remember when, or by whom, or -- and this is the part that has your hands cold -- whether there was ever anybody sitting at it. There is one thing in this office nobody has audited in eleven years, and its door is behind you.','The player is a ward clerk in Ambry who finds an hour cut out of their own daybook and the desk opposite theirs cleared of a colleague they can no longer quite remember. Working out what happened in that hour means going through the Registry''s own paperwork against it: the supply closet nobody has inventoried, the long hallway with the Inspectorate coming up it, and eventually the question of who has blank writs and why one was spent on a Marginalia clerk in Ward Office 12. The tone is dry, close and procedural, and the horror is entirely administrative.','2026-08-31 18:40:00',1000000001,'2026-10-29 02:09:16.976735','2026-10-29 02:09:16.976735',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") @@ -436,6 +436,7 @@ INSERT INTO schema_migrations VALUES('20250823023925'); INSERT INTO schema_migrations VALUES('20250822184651'); INSERT INTO schema_migrations VALUES('20250822184650'); INSERT INTO schema_migrations VALUES('20250822184649'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-29 02:06:59.131845','2026-10-29 02:06:59.131848'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','9ea7d9a7496841168065535777683ed7c64300e0','2026-10-29 02:06:59.136646','2026-10-29 02:06:59.136649'); diff --git a/parity/worlds/the-weighing-house.sql b/parity/worlds/the-weighing-house.sql index 0424bd9..07d1292 100644 --- a/parity/worlds/the-weighing-house.sql +++ b/parity/worlds/the-weighing-house.sql @@ -307,11 +307,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-25 22:57:24.886899','The beam scale hangs over the floor, and Bram Hale leans on the yoke by the door.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-10-25 08:00:00','The story opens in the weighing house, at the start of market.',NULL,'2026-10-25 22:57:24.886899'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-25 22:57:24.518433',NULL,'market town','The warden''s slate has to be carried to the scales, and nobody small has managed it yet.','2026-10-25 08:00:00','Nell Fisk comes into the weighing house to tally the morning''s loads.','The Weighing House (engine sweep)',1000000001,'2026-10-25 22:57:24.518433'); +INSERT INTO stories VALUES(1000000001,'2026-10-25 22:57:24.518433',NULL,'market town','The warden''s slate has to be carried to the scales, and nobody small has managed it yet.','2026-10-25 08:00:00','Nell Fisk comes into the weighing house to tally the morning''s loads.','The Weighing House (engine sweep)',1000000001,'2026-10-25 22:57:24.518433',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -421,6 +421,7 @@ INSERT INTO schema_migrations VALUES('20250822184651'); INSERT INTO schema_migrations VALUES('20250822184650'); INSERT INTO schema_migrations VALUES('20250822184649'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-25 22:57:23.355205','2026-10-25 22:57:23.355207'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','9fcff787fff0ed60123ee84a65c7f80738f353f3','2026-10-25 22:57:23.358867','2026-10-25 22:57:23.358868'); diff --git a/parity/worlds/two-clerks-at-one-counter.sql b/parity/worlds/two-clerks-at-one-counter.sql index 707e09e..4fad208 100644 --- a/parity/worlds/two-clerks-at-one-counter.sql +++ b/parity/worlds/two-clerks-at-one-counter.sql @@ -295,11 +295,11 @@ FOREIGN KEY ("story_id") REFERENCES "stories" ("id") ); INSERT INTO scenes VALUES(1000000001,NULL,NULL,'2026-10-02 13:25:56.357172','You stand at the pawnbroker''s counter with your ticket in hand. Tamsin and Rowe are both behind it.',NULL,0,1,1000000001,NULL,NULL,NULL,1000000001,'2026-09-24 19:05:00','Ansel comes to the pawn counter to redeem a pledge.',NULL,'2026-10-02 13:25:56.357172'); -CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_2a912ea846" +CREATE TABLE IF NOT EXISTS "stories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime(6) NOT NULL, "generation_snapshot" text, "genre" varchar, "preface" text, "start_time" datetime(6), "summary" text, "title" varchar, "universe_id" integer NOT NULL, "updated_at" datetime(6) NOT NULL, "people_limit" integer, "things_limit" integer, CONSTRAINT "fk_rails_2a912ea846" FOREIGN KEY ("universe_id") REFERENCES "universes" ("id") ); -INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:55.872272',NULL,'town adventure','Two people are behind the counter and both of them have noticed you.','2026-09-24 19:05:00','Ansel has come to redeem a pledge; Tamsin wants his ticket and Rowe wants him gone.','Two Clerks at One Counter (engine sweep)',1000000001,'2026-10-02 13:25:55.872272'); +INSERT INTO stories VALUES(1000000001,'2026-10-02 13:25:55.872272',NULL,'town adventure','Two people are behind the counter and both of them have noticed you.','2026-09-24 19:05:00','Ansel has come to redeem a pledge; Tamsin wants his ticket and Rowe wants him gone.','Two Clerks at One Counter (engine sweep)',1000000001,'2026-10-02 13:25:55.872272',NULL,NULL); CREATE TABLE IF NOT EXISTS "system_one_receipts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "cost_usd" decimal(12,6) NOT NULL, "created_at" datetime(6) NOT NULL, "player_id" integer, "playthrough_id" integer, "purpose" varchar, "transport" varchar, "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") @@ -409,6 +409,7 @@ INSERT INTO schema_migrations VALUES('20261025120000'); INSERT INTO schema_migrations VALUES('20261025200000'); INSERT INTO schema_migrations VALUES('20261025230000'); INSERT INTO schema_migrations VALUES('20261027120117'); +INSERT INTO schema_migrations VALUES('20261030120000'); 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-10-02 13:25:33.143313','2026-10-02 13:25:33.143316'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','072abc2bfb80d111a1808df270e9210911f5e81d','2026-10-02 13:25:33.148224','2026-10-02 13:25:33.148228'); diff --git a/src/cast.rs b/src/cast.rs index 452d3bb..e0e7547 100644 --- a/src/cast.rs +++ b/src/cast.rs @@ -68,6 +68,9 @@ pub struct Room<'a> { pub present: i64, /// How many people the story already holds. pub in_story: i64, + /// How many people the story may hold: [`MAX_PER_STORY`] unless the + /// story names its own (`realization::people_limit`). + pub story_limit: i64, } /// The races a draw picks from: those of the wanted kind, or every race when @@ -92,7 +95,7 @@ pub fn slots<'a>(room: &Room, races: &[Race<'a>]) -> Vec> { let (_, count) = population::for_room(room.name, room.population); let drawn = count .min((MAX_PER_ROOM - room.present).max(0)) - .min((MAX_PER_STORY - room.in_story).max(0)); + .min((room.story_limit - room.in_story).max(0)); let mut rng = danger::generator_for(room.story_id, room.location_id); let throws: Vec = (0..drawn) .map(|_| danger::monstrous(room.danger, &mut rng)) @@ -144,3 +147,43 @@ pub fn generated<'a>(story_id: i64, sequence: i64, races: &[Race<'a>]) -> Genera raised_by, } } + +#[cfg(test)] +mod tests { + use super::{slots, Race, Room, MAX_PER_STORY}; + + const RACES: [Race; 1] = [Race { + name: "Countryfolk", + monstrous: false, + }]; + + /// A crowd's room with `in_story` people already in a story that may + /// hold `story_limit`. + fn crowd(in_story: i64, story_limit: i64) -> Room<'static> { + Room { + story_id: 1, + location_id: 5, + name: "Cellar", + danger: "safe", + population: Some("a crowd"), + present: 0, + in_story, + story_limit, + } + } + + #[test] + fn a_story_at_the_ordinary_limit_draws_nobody_more() { + assert_eq!(slots(&crowd(11, MAX_PER_STORY), &RACES).len(), 1); + assert!(slots(&crowd(12, MAX_PER_STORY), &RACES).is_empty()); + } + + #[test] + fn a_raised_limit_draws_past_twelve_with_the_same_dice() { + let raised = slots(&crowd(12, 20), &RACES); + assert_eq!(raised.len(), 3, "the crowd's roll, with places to spare"); + assert_eq!(slots(&crowd(0, MAX_PER_STORY), &RACES), raised); + assert_eq!(slots(&crowd(19, 20), &RACES), raised[..1]); + assert!(slots(&crowd(20, 20), &RACES).is_empty()); + } +} diff --git a/src/realization.rs b/src/realization.rs index 3f3dd59..a665b0b 100644 --- a/src/realization.rs +++ b/src/realization.rs @@ -17,6 +17,19 @@ use serde_json::{json, Value}; pub const ITEMS_PER_ROOM: i64 = 3; pub const ITEMS_PER_STORY: i64 = 60; +/// How many people a story may hold: its own `stories.people_limit`, or +/// [`MAX_PER_STORY`] where it names none (as every story did before the +/// column, and a database without it still does). +pub fn people_limit(story: &Row) -> i64 { + int(story, "people_limit").unwrap_or(MAX_PER_STORY) +} + +/// How many distinct things a story may hold: its own +/// `stories.things_limit`, or [`ITEMS_PER_STORY`] where it names none. +pub fn things_limit(story: &Row) -> i64 { + int(story, "things_limit").unwrap_or(ITEMS_PER_STORY) +} + /// `Item.bespoke`: a thing the caps count -- portable, and written by the /// room writer or a world file rather than a kit. pub fn bespoke(item: &Row) -> bool { @@ -463,7 +476,7 @@ impl<'a> Realization<'a> { .collect(); names.sort(); names.dedup(); - let world = (ITEMS_PER_STORY - names.len() as i64).max(0); + let world = (things_limit(self.story()) - names.len() as i64).max(0); let allowance = room.min(world); if allowance == 0 { return "Do not list any items: this place already holds everything it can.".into(); @@ -841,10 +854,10 @@ pub fn room_for_people(records: &Records, location: &Row) -> (i64, i64) { let in_story = records .select("characters", |row| int(row, "story_id") == story) .len() as i64; - ( - (MAX_PER_ROOM - present).max(0), - (MAX_PER_STORY - in_story).max(0), - ) + let limit = story + .and_then(|story| records.find("stories", story)) + .map_or(MAX_PER_STORY, people_limit); + ((MAX_PER_ROOM - present).max(0), (limit - in_story).max(0)) } #[cfg(test)] @@ -925,4 +938,30 @@ mod tests { besides the people Already Standing Here above.\n" )); } + + /// Twelve people in a story leave no place in it, unless the story names + /// a limit of its own. + #[test] + fn a_story_s_own_people_limit_leaves_places_past_twelve() { + let twelve: Vec<_> = (1..=12) + .map(|id| json!({"id": id, "story_id": 1, "location_id": 2})) + .collect(); + let with = |limit: serde_json::Value| { + Records::from_json(&json!({ + "stories": [{"id": 1, "people_limit": limit}], + "locations": [{"id": 1, "story_id": 1, "name": "Cellar"}], + "characters": twelve, + })) + }; + let ordinary = with(json!(null)); + let raised = with(json!(20)); + assert_eq!( + super::room_for_people(&ordinary, &ordinary.table("locations")[0]), + (3, 0) + ); + assert_eq!( + super::room_for_people(&raised, &raised.table("locations")[0]), + (3, 8) + ); + } } diff --git a/src/store.rs b/src/store.rs index 8910544..2e500d8 100644 --- a/src/store.rs +++ b/src/store.rs @@ -89,6 +89,17 @@ pub const REFUSED_LINES: &str = "refused_lines"; /// added still opens; a write to one it lacks is an error. pub const OPTIONAL: &[&str] = &[REFUSED_LINES]; +/// Columns the engine reads only where the database has them, each as the +/// fact [`shape`] would state: a story's own people and thing limits +/// (migration 20261030120000), which read as null, and so as the ordinary +/// limits, in a database from before them. [`shape`] leaves them out, so +/// a database opens with or without them; one declared any other way is +/// still a difference. +pub const OPTIONAL_COLUMNS: &[&str] = &[ + "column stories.people_limit integer pk=0", + "column stories.things_limit integer pk=0", +]; + /// What the engine relies on in a database, one fact per line, sorted: for /// every table it touches, each column's declared type (in lower case, as /// SQLite compares it), nullability, default @@ -97,7 +108,8 @@ pub const OPTIONAL: &[&str] = &[REFUSED_LINES]; /// any other table that points into one of them, since a row there can stop /// the engine deleting or rewriting one of its own. A table the engine does /// not touch, with no foreign key into one it does, is left out, so a -/// migration that only adds such a table leaves the shape as it was. +/// migration that only adds such a table leaves the shape as it was. So is +/// a column of [`OPTIONAL_COLUMNS`]. pub fn shape(conn: &Connection) -> Result, Error> { let touched: Vec<&str> = TABLES .iter() @@ -206,6 +218,7 @@ pub fn shape(conn: &Connection) -> Result, Error> { } } } + facts.retain(|fact| !OPTIONAL_COLUMNS.contains(&fact.as_str())); facts.sort(); Ok(facts) } diff --git a/src/turn/told/realize.rs b/src/turn/told/realize.rs index 596fd24..52f8f69 100644 --- a/src/turn/told/realize.rs +++ b/src/turn/told/realize.rs @@ -277,6 +277,7 @@ impl Turn<'_, '_> { int(who, "story_id") == Some(self.m.story_id()) }) .len() as i64, + story_limit: realization::people_limit(story), }; cast::slots(&room, &named) .into_iter() @@ -825,7 +826,7 @@ impl Turn<'_, '_> { let refused = is_blank(&name) || is_blank(&description) || lying >= realization::ITEMS_PER_ROOM - || distinct.len() as i64 >= realization::ITEMS_PER_STORY + || distinct.len() as i64 >= realization::things_limit(self.m.game().story()) || created.iter().any(|made| ruby_downcase(made) == lowered) || templates.iter().any(|item| { text(item, "kit_key").is_none() @@ -994,7 +995,7 @@ impl Turn<'_, '_> { || SHEET.iter().any(|name| is_blank(&field(name))) || !has_races || self.present_here(location) >= cast::MAX_PER_ROOM - || in_story >= cast::MAX_PER_STORY + || in_story >= realization::people_limit(self.m.game().story()) || self.named_by_a_person(&fullname) || self.named_by_a_place(&fullname) || self diff --git a/tests/engine.rs b/tests/engine.rs index adee5fb..77b0a9e 100644 --- a/tests/engine.rs +++ b/tests/engine.rs @@ -458,7 +458,7 @@ fn a_database_at_an_older_schema_is_refused() { let conn = rusqlite::Connection::open_in_memory().unwrap(); conn.execute_batch(&world("the-quay-house")).unwrap(); conn.execute_batch(&format!( - "DELETE FROM schema_migrations WHERE version = '{SCHEMA_VERSION}'" + "DELETE FROM schema_migrations WHERE version >= '{SCHEMA_VERSION}'" )) .unwrap(); match Engine::from_connection(conn) { @@ -616,6 +616,40 @@ fn a_newer_schema_that_adds_a_column_to_a_table_the_engine_uses_is_refused() { ); } +#[test] +fn a_database_from_before_the_story_limits_is_opened_and_plays_at_the_ordinary_limits() { + let conn = rusqlite::Connection::open_in_memory().unwrap(); + conn.execute_batch(&world("the-quay-house")).unwrap(); + conn.execute_batch( + r#"ALTER TABLE "stories" DROP COLUMN "people_limit"; + ALTER TABLE "stories" DROP COLUMN "things_limit"; + DELETE FROM schema_migrations WHERE version = '20261030120000';"#, + ) + .unwrap(); + let mut engine = Engine::from_connection(conn).expect("the older shape is opened"); + let story = engine + .story_titled(&format!("The Quay House{TITLE_SUFFIX}")) + .unwrap(); + let playthrough = engine.start(story).unwrap(); + let outcome = engine + .play(playthrough, "look around", &mut |_| {}) + .unwrap(); + assert!(outcome.state.location.is_some()); +} + +#[test] +fn a_story_limit_declared_another_way_is_refused() { + let differences = changed(migrated( + "the-quay-house", + r#"ALTER TABLE "stories" DROP COLUMN "people_limit"; + ALTER TABLE "stories" ADD "people_limit" integer NOT NULL DEFAULT 12;"#, + )); + assert_eq!( + differences, + ["found column stories.people_limit integer not null default 12 pk=0"] + ); +} + #[test] fn a_newer_schema_that_adds_a_unique_index_to_a_table_the_engine_uses_is_refused() { let differences = changed(migrated( @@ -987,6 +1021,110 @@ fn a_room_whose_ways_out_failed_is_picked_up_where_it_stopped_on_the_live_path() ); } +/// The Lantern Inn's cellar walked into with `sql` run over the world first: +/// the room writer names three people and two things whatever it is told. +/// Returns how many people the story holds after, how many things lie in +/// the cellar, and the detail prompt the writer was sent. +fn into_the_crowded_cellar(sql: &str) -> (i64, i64, String) { + use renderedstep_engine::model::{Live, Route, Secret}; + use serde_json::json; + let mut world = world("a-crowded-cellar"); + world.push_str(sql); + let mut engine = open_world(&world).unwrap(); + let story = engine + .story_titled(&format!("A Crowded Cellar{TITLE_SUFFIX}")) + .unwrap(); + let playthrough = engine.start(story).unwrap(); + let person = |fullname: &str| { + json!({ + "fullname": fullname, "nickname": fullname, "appearance": "A wet hat.", + "personality": "Calm.", "backstory": "Late for a bed.", + "likes": "Quiet.", "dislikes": "Damp.", "fears": "Rats.", + }) + }; + let thing = |name: &str| json!({"name": name, "description": "Left by a guest.", "use_kind": "ordinary", "combustible": false, "readable": false}); + let detail = json!({ + "description": "Barrels in rows.", + "lore": "The cellar takes the overflow.", + "items": [thing("tin cup"), thing("wool cap")], + "people": [person("Orrin Vale"), person("Sabine Roe"), person("Kit Lowan")], + }); + let exits = json!({"exits": [{"name": "Taproom", "teaser": "Steps up.", "distance": "adjacent", "travel_method": "walking"}]}); + let arrival = json!({"description": "You go down.", "summary": "Into the cellar."}); + let transport = Scripted { + answers: vec![answered(detail), answered(exits), answered(arrival)], + sent: Vec::new(), + }; + let route = Route::Direct { + key: Secret::new("own"), + }; + let mut live = Live::with_transport(route, transport); + engine + .submit(playthrough, "/move Cellar", "a", &mut live, &mut |_| {}) + .unwrap(); + let prompt = live.transport().sent[0]["messages"] + .as_array() + .unwrap() + .iter() + .filter_map(|message| message["content"].as_str()) + .collect::>() + .join("\n"); + let people = count( + &engine, + &format!("SELECT COUNT(*) FROM characters WHERE story_id = {story}"), + ); + let things = count( + &engine, + "SELECT COUNT(*) FROM items WHERE playthrough_id IS NULL AND location_id = (SELECT id FROM locations WHERE name = 'Cellar')", + ); + (people, things, prompt) +} + +#[test] +fn a_story_with_no_people_limit_of_its_own_holds_twelve() { + let (people, _, prompt) = into_the_crowded_cellar("UPDATE stories SET people_limit = NULL;\n"); + assert_eq!( + people, 12, + "nobody the writer names past the twelfth is born" + ); + assert!( + prompt.contains("## Who Is Here\nWrite NOBODY into this place."), + "{prompt}" + ); +} + +#[test] +fn a_story_s_own_people_limit_lets_a_room_be_born_past_twelve() { + let (people, _, prompt) = into_the_crowded_cellar(""); + assert_eq!(people, 15, "the cellar's crowd of three is born"); + assert!( + prompt.contains("Write EXACTLY 3 people who are in this place right now"), + "{prompt}" + ); + let (people, _, prompt) = into_the_crowded_cellar("UPDATE stories SET people_limit = 13;\n"); + assert_eq!(people, 13, "one place was left, and one person is born"); + assert!( + prompt.contains("Write EXACTLY 1 person who is in this place right now"), + "{prompt}" + ); +} + +#[test] +fn a_story_s_own_things_limit_bounds_the_things_its_rooms_are_written_with() { + let (_, things, prompt) = into_the_crowded_cellar(""); + assert_eq!(things, 2, "under the ordinary sixty both things lie there"); + assert!( + prompt.contains("List AT MOST 3 portable things"), + "{prompt}" + ); + let (_, things, prompt) = into_the_crowded_cellar("UPDATE stories SET things_limit = 1;\n"); + assert_eq!( + things, 1, + "the story has room for one thing, and one is admitted" + ); + assert!(prompt.contains("List AT MOST 1 portable thing"), "{prompt}"); +} + #[test] fn a_conversation_is_picked_up_again_on_the_next_talk_on_the_live_path() { use renderedstep_engine::model::{Live, Route, Secret}; diff --git a/tests/vectors/portions.rs b/tests/vectors/portions.rs index ba79c6e..2b91d49 100644 --- a/tests/vectors/portions.rs +++ b/tests/vectors/portions.rs @@ -598,6 +598,7 @@ fn cast() { population: input["population"].as_str(), present: 0, in_story: 0, + story_limit: cast::MAX_PER_STORY, }; cast::slots(&room, &races) .iter()