diff --git a/docs/aetheria/call-of-the-void-brainstorm.md b/docs/aetheria/call-of-the-void-brainstorm.md deleted file mode 100644 index 288c433..0000000 --- a/docs/aetheria/call-of-the-void-brainstorm.md +++ /dev/null @@ -1,169 +0,0 @@ -# Call Of The Void Brainstorm - -Source: https://docs.google.com/document/d/1YWn5RWsciBxuaQ4l5TN2lAEz4okaQes-aiyx1E9NAxA/edit?tab=t.0 - -This is a local plaintext import of the scattered Call of the Void brainstorming doc. Treat it as raw source material, not canon. The current compact design note remains E:\Projects\AetheriaLore\Aetheria\Game Design\Call of the Void.md. - -## Current Canon Correction - -This brainstorm predates a major Aetheria timeline migration. - -The old version assumes a colony fleet or exploratory force was shunted into -Elysium and slowly discovers that nobody is going home. That is no longer the -live premise. - -Current canon, summarized in -`E:\Projects\AetheriaLore\Aetheria\Worldbuilding\Pre-Elysium\From Sol to Elysium.md`, -is that the FTL trigger sequestered the whole Solar system, with its fleets, -institutions, corporate blocs, uploaded minds, labor systems, histories, and -unresolved social machinery. Elysium is not a remote elsewhere that a fleet -cannot leave. It is the sealed domain into which Sol itself was displaced. - -So the useful dramatic pressure is not "can the expedition return home?" -because home came with them. The better pressure is: - -- there is no clean outside to return to -- the systems people hoped to escape are trapped in Elysium too -- the old order can no longer rely on the old universe remaining stable around - it -- every faction is trying to define what survival, legitimacy, personhood, and - ownership mean now that Sol's whole inheritance has been exported into the - sealed domain -- Cat's story should turn on the realization that starting over is not escape - when the machinery you fled arrived in the same disaster - -The raw notes below remain useful for cases, characters, tones, and comic -cruelty. Treat their old "return home" twist as obsolete pressure, not active -continuity. - ---- - -Potential ideas here, feel free to discuss/deplore/detour in comments. - - -Protagonist: Catastrophe “Cat” Marrigan, an out of work private investigator, driving a particularly failure-prone space taxi to make ends meet - - -Overarching plot: Episodic PI cases/random space taxi fares which lead, somewhat circuitously, towards the discovery/revelation that the “exploratory force” had better get used to being “locals”, because the universe is not offering return tickets, and all that follows from that. - - -What’s Cat’s role in this? And are we going to have alternate endings based on choices made? Ideas, in no particular order: -* She's the original founder/inspiration for the frontier renegades who reject corporate rule and live low-tech and tiny to avoid being crushed. -* The more noir-esque ending, where the disillusioned protagonist sees the way things are going and kills themselves/goes out in a blaze of explosive glory in a futile attempt to change the course of society. -* The out-for-what-you-can-get ending, where she allies with an up and coming power to become a behind the scenes force in future aetheria. -* The really unsatisfying but realistic ending, where the corps take over and life just goes on. -* I sort of like the idea of heading towards a “you can’t win against the capitalist machine, but it’s worth fighting anyway” theme. Thoughts? - - - case/fares/conversations that exemplify the different ways people react to the point of no return, so to speak, ie: denial, determination to find a way to get back, culty doomsdays types, the “we’re all doomed so let’s party” people, the ones who see great opportunity without old earth holding them back, the people who are determined to do things better this time around (in the ‘we royally screwed up earth, let’s not do it again” sense), etc. - - -Accidental AI ship whose buggy programming makes them the worst autopilot ever orrrrr…the inciting incident is that in one of her cases/fares gone wrong Cat gets mind-melded with said slightly buggy AI, and that’s how she finds out all those juicy government secrets. Some of them may be inaccurate (see: bad code/failsafes/sabotage), but there’s no way of knowing which without going digging. Plus AI is a one of a kind experimental prototype, which sets all kinds of interesting people on their tail. Also could give us some fun things to do with ship control and actual gameplay quests. -Over the course of the story, one way to show people’s reactions to events could be to have some dialogued characters talking about what they plan to do when they get back home, then use it as a major stress point once the truth is revealed. - - -Maybe Cat works for a small, kind of terrible PI company, in which case we could get some of our quests from a dispatcher/boss/whatever. I think it’d be a little funny if in true noir fashion, boss was a hard-drinking dude in a trenchcoat, only he’s a really giggly drunk/can’t hold his liquor. -First quest for PI company: find where the boss left a random object after drinking himself to the floor. Find out he left a whole-ass ship somewhere in his drunken stupor. -Another PI quest: investigate the disappearing foodstuffs of a concerned homeowner and find out that a whole nother person was living in the crawlspace above their home and stealing their food. Decide how to deal with Mr Crawlspace. -PI quest: Investigate “ghost” sightings in an old part of a station that’s been shut down. Find out a whole town’s worth of people are living there out of the station’s control slowly siphoning off resources so as not to be noticed. Get some slightly culty vibes from them. -A short quest from an old lady who just wants to have someone over for tea. Turns out if you tolerate her long enough she’ll come in handy during a critical time. Could be she’s either rich or well-connected. -A botanist looking for his daughter. Turns out instead of some sorta protomolecule conspiracy, she’s just wandered off and is being looked after by a kind lady who’s found her. -Get a quest from a mysterious person who is only contacting Cat online, find out eventually the quest giver is some sort of AI who’s either seeking the sweet release of deletion, is looking to find another AI, or is trying to steal some sort of drone so it can go around freely. -Possibly a character who we only see as a remote-controlled drone who helps out at times but we never see the person behind the drone because they use the drone as their public avatar or something. Could be someone who might not otherwise get the chance to go out and about in public because of reasons. This does give them a limited sphere of helpfulness since the drone has to be close enough to the controller to work effectively. Could have Cat mistake the drone for the character, believing it’s some sort of self-sufficient AI driven drone and be sad when it “dies” only to meet it again once it’s re-built and realise there’s a person behind it. Bit like the “pay no attention to the man behind the curtain” bit, could call the drone “Oz”. - - -Cat is tasked with investigating a mysterious and aggressive band of pirates. Upon finding them it is revealed that they are actually a community of rogue AIs who have no option but to loot technology transports in order to keep themselves alive. - - -Cat stumbles into a friendship with a shady character, earning the attention of the even shadier Space CIA, which recruits her as a potential double agent with instructions to infiltrate the organization. - - -Cat is sent to investigate a series of mysterious disappearances of ships sent to mine a gas giant’s belt. Locals consider the place haunted. Turns out it is, by a sentient particle system which considers itself the embodied spirit of the planet. - - -DLC Area: Cat falls afoul of some sort of anomaly which sends her into a parallel universe with an alternative history. Somehow despite a very different timeline and political situation, everyone she meets is a bizarro mirror of the people she knows from her dimension, and somehow the exact same cast of characters are present despite having very different roles (listen, we can’t afford any extra actors so we’re just gonna use the cast we already have) - - -Finch is destructively scanning recently deceased human brains and then performing extensive virtual surgery on emulated instances of them in order to create and sell packaged “AI” servitors for specific tasks to compete on the market against AGI products from competitors. The Crew manages to rescue one of the program’s victims while still mostly human, before the process is complete, who [joins the party / is installed on Cat’s ship]. - - -Character: Reginald Moneybags III, inheritor of a massive family fortune, is looking to become a patron of the arts in order to impress his old-money friends. Perhaps they’re the one giving the player their ship? - - -Might could explore some of Cat’s motivations for taking the ship to Elysium in the first place. Was it by choice? Who has she left behind, if anyone? It would put her in a more conflicted position regarding her role as a double-agent. -* Seems natural that she would be escaping a maze of debt and obligation, only to end up terrifyingly close to falling into the same trap again. I kinda like this idea of completely dumping her whole life and trying to start over somewhere completely different. -* She was caught committing some felony/is railroaded/scapegoated for same/investigated someone way too powerful and was given a choice between prison and joining the colonists. -* Or combine both and bring back the idea of debtor’s prisons/workhouses and have the ship to Elysium be offered as a way out - * So, was she indentured when she arrived only to recently gain the freedom to make her own way, or has she been doing what she’s currently doing since arrival? - - -The faceless man: a guy? maybe. Wearing a spacesuit or some other obscuring disguise that pops up a little too often for random chance. Is he a red herring? Or is he 10 red herrings in a spacesuit pretending to be a guy? If he has any dialogue let it just be *splashing noises*. - - -Cat is sent to investigate an urban legend on one other stations--the simply and slightly erroneously historically named “Ripper Lee” who lives in the air vents and steals children. It actually turns out that the missing kids are just exploring the vents as children will and getting macheted by fans or getting stuck or getting pulled into the inertial compensator. [an act II continuation of this quest sees Cat investigating her suspicions that the kids didn’t necessarily go into the dangerous areas of their own impetus, but were lured there. The third act reveals an alien intelligence--though an animal one--a being of energy or something stranger who finds the particular pitch of childrens’ laughter unbearable. Maybe it destructively interferes with its phase, who knows] - - -The one perpetual drunk who always needs a lift to a different space bar. Cat can go on -a bender with him as a quest, and then have to figure out exactly what the hell happened and why there’s a crash test dummy in the front seat of her taxi. - - -The person who jumps into Cat’s cab and yells “follow that ship!”. A high octane space chase follows, at the end of which it is revealed they’ve been following the wrong ship, and the Minister of such and such is *very* displeased that he missed his Very Important Meeting for what turns out to be not even an actual assassination attempt. - - -A carjacking with several different options for resolution - - -Something strange is going on in the mining operation on PXR 6937, and Cat is sent to find out what: suggestions: the drilling released a substance from the rock that causes hallucinations and paranoia in human brains. Someone is deliberately sabotaging the operation as an environmental protest/act of general rebellion/the mining operation killed someone they cared about and now everyone must feel the same misery - - -Cat is forced to navigate the pointless bureaucracy of space offices to uncover an embezzlement scheme that conceals something much bigger. What is it? Fuck if I know. -* A furniture selling operation that appears to cover some financial wizardry but turns out to be a human trafficking operation where the names of the items are actually those of missing children OW MY HEART -* A fiendish plan to utilize the combined computing power of thousands of office servers to...mine future bitcoin? Solve something the megas don’t want solved? - - -Cat’s taxi breaks down somewhere off the beaten path, so to speak, and she finds herself drawn into an ongoing and very brutal feud between two families. - - -Have a random cab passenger speak in Nemsk and never explain it. - - -An entire district of a certain station orbiting a strange ocean planet begin to complain of seeing people who could logically never be there. Cat is asked to do a cursory look into it and remains sceptical until one day she starts seeing a person shaped figure always walking just barely out of her line of sight. We could either go full Lem, or subvert this reference by having the reveal be that the air or water are contaminated with a hallucinogenic compound. - - -A Captain Nemo like figure who flies his rather unusual ship on the far edges of the system. His purpose is unclear, and his identity more so. - - -Silica storage ruptured, spilling into common area. Now we’re doing the obligatory beach episode! Sand got into the gears of the docking bay so now everyone has to sit back for an afternoon and do anime tropes while it's getting repaired. - - -What organization is Cat infiltrating? -* People who are trying to go home, even if it costs them the ship or other people’s lives -* Believe the Megas are withholding research on the return trip, trapping everyone in Elysium for profit -* Name ideas - * Home (nice and simple; is it an acronym: H.O.M.E.?) - * A nickname could be the “homies” lmao love it “wassup homie?” - * Terra - * The Terra-rists or Terrists (like a hick would say) Get out no. - * Could be a media nickname (and everyone is really tired of explaining that “no, no, we’re the Alliance for Returning Swiftly Earthward, really” really? Butt jokes? I have never pretended to be above them. Neither have I. - * The Earth-Bound - * The Regressionists - * The Returners (sounds like a ya novel title) true - * The Retrograde Alliance - * Earthers - * The Genesis Project (Project Genesis? Sounds better.) Genesis Faction? - * Alliance for Returning Swiftly Earthward - * Gaia-ists possibly too many vowels - * The Followers of Gaia? Get that good greek mythology I kind of like this one. The Gaia Cult lmao - * Cult of Gaiains, but also yeah, the GaiaCult - * Hades (if we’re going Greek mythology, normal people go to Hades while demigods go to Elysium) Erebus - * Has the bonus “evil” connotation - * Hadesians Perhaps? Like people from there...Hadesites? - * Fits into the sentence “The CIA needs you to infiltrate Hades” - * Though if we’re going for the greek theme, Odysseans might be more apropos with the whole ‘returning home’ I like this for greek references - - - - -How do we handle double agent shenanigans? -* Cat grows to sympathise with their goals and philosophy, ends up rejecting the CIA - * Cat comes clean with her new friends, who begin reciting the typical cliche, only to have someone start to read a page that semi-describes events later in the story, like it's a script. diff --git a/docs/architecture/aetheria-agent-population-model.md b/docs/architecture/aetheria-agent-population-model.md deleted file mode 100644 index 7b0e60c..0000000 --- a/docs/architecture/aetheria-agent-population-model.md +++ /dev/null @@ -1,386 +0,0 @@ -# Aetheria Agent Population Model - -This note explains how a socially dense Aetheria region can feel inhabited -without simulating every implied person as a fully persistent agent. - -The short answer is that population and agency are not the same thing. - -A corridor can imply hundreds of thousands or millions of people while only a -few dozen individuals need to exist as full long-lived social nodes. - -## Design Goal - -We want a region that feels: - -- crowded -- economically alive -- politically pressured -- socially stratified -- full of rumor, labor, traffic, and institutional drag - -We do **not** want: - -- ten thousand expensive little chatbots idling in a warehouse -- fake scale achieved by silent cardboard extras -- a world where only named characters seem to exist - -So the population model needs to separate: - -- who exists as a persistent social mind -- who exists as a grouped social force -- who exists only as local scene color -- how offscreen population pressure becomes visible - -## Four Population Layers - -The MVP should use four layers. - -### 1. Persistent Agents - -These are the full agents. - -They have: - -- identity -- memory -- relationships -- goals -- obligations -- changing stance toward institutions and people - -These are the characters who accumulate history and can plausibly remember what -happened last week, who lied to them, who saved them, and which institution -just humiliated them. - -Examples in an Aetheria content-generation slice: - -- a faction liaison -- a ship officer -- a labor organizer -- a corporate handler -- a sanctuary coordinator -- a black-market broker -- a cutout vendor -- a technical specialist with inconvenient loyalties - -These are not the population. They are the pressure points where -population-scale systems become legible. - -### 2. Cohorts - -Cohorts are grouped social bodies that matter but do not need full individual -cognition. - -They should represent classes of people whose collective condition can change -over time. - -Examples: - -- dock labor shifts -- convoy deck crews -- insurer back-office clerks -- sanctuary residents -- clinic queues -- pirate route crews -- private security contractors -- debt pilgrims -- repair-bay technicians -- refugee transit waves - -Each cohort should have state such as: - -- size -- location -- stress -- trust in institutions -- rumor exposure -- faction sympathy -- fatigue -- scarcity pressure -- protest potential -- desertion / mutiny risk - -This is how the world gets to have labor, crowds, queues, shortages, and -unrest without pretending every forklift operator needs a hundred memories and -a private speech cadence. - -### 3. Ephemeral Scene Actors - -These are temporary people instantiated only when a scene needs bodies, -witnesses, clerks, mechanics, medics, bystanders, or small bits of friction. - -They should have: - -- a role -- a scene goal -- local awareness of current events -- a little voice -- minimal short-term memory - -They should **not** be treated as deep persistent minds by default. - -Examples: - -- a berth marshal waving traffic through a panic checkpoint -- a frightened passenger arguing with a clerk -- a dockhand spreading a fresh rumor -- a medic triaging one more body than the shift can really handle -- a sanctimonious insurer junior who disappears once the scene ends - -If an ephemeral keeps mattering, the system can promote them into a persistent -agent later. - -### 4. Ambient Population Pressure - -This is the layer that makes the world feel bigger than the visible cast. - -It is not represented by people at all. It is represented by signals. - -Examples: - -- berth queues growing or shrinking -- cargo backlogs -- corridor delay maps -- sanctuary occupancy -- clinic wait times -- food prices -- insurance repricing -- labor slowdown notices -- protest bulletins -- casualty lists -- rescue requests -- media chatter -- tribunal rulings -- route closures - -This is where the implied millions live in practice. - -## How The Layers Interact - -The model should feel like this: - -- ambient pressure changes cohort state -- cohort state changes the incentives around persistent agents -- persistent agents make decisions that alter ambient pressure -- ephemeral actors express the local scene consequences - -That loop lets a single adjudicator decision or pirate rescue cascade outward -into visible population-level effects without simulating every single person -affected. - -## Why A Few Dozen Persistent Agents Is Enough - -Because the simulation is not trying to create a census. It is trying to create -a socially legible machine. - -In a dense Aetheria slice, one persistent agent can sit at the hinge point for -a great many people: - -- one dispatcher affects dozens of ships and hundreds of crew -- one sanctuary coordinator gates a network under pressure from thousands of vulnerable lives -- one corporate official can reshape access, risk, and reputation -- one faction delegate can legitimize or delegitimize a compromise -- one broker can redirect shadow traffic across many dependent cells - -The persistent cast is therefore best understood as: - -- decision-makers -- bottlenecks -- brokers -- organizers -- interpreters of institutional rules -- people with unusual leverage over larger flows - -They are the knots in the rope, not every fiber. - -## Cohort Model - -Cohorts should be tractable and opinionated. - -Each cohort record should include: - -- `cohortId` -- `type` -- `sizeBand` -- `region` -- `factionAffinity` -- `currentPressures` -- `resourceDependency` -- `confidence` -- `grievance` -- `discipline` -- `mobilizationPotential` -- `recentIncidents` - -Useful cohort types for Aetheria story and content generation: - -- dock labor -- ship crews -- sanctuary residents -- corporate workforce -- shadow-market crews -- repair-yard workers -- shadow clinic clients -- private security detachments -- local merchant bodies -- transient passenger pools - -Cohorts do not need rich dialogue. They need believable collective reactions. - -## Ephemeral Actor Rules - -Ephemeral actors should be generated from: - -- scene location -- cohort state -- current world pressures -- factional tone -- time of day / shift - -That means the same dock concourse can produce different incidental people -depending on whether the corridor is calm, panicking, starving, over-inspected, -or politically inflamed. - -Ephemerals should support: - -- local exposition -- scene texture -- small moral friction -- witness testimony -- short disputes -- visible consequences - -They should expire cheaply unless the world keeps pulling them back into -relevance. - -## Promotion Rules - -Some ephemerals should be promoted into persistent agents when: - -- a player or major agent forms an ongoing relationship with them -- they become central to repeated incidents -- they accumulate leverage or notoriety -- they are the surviving witness to something politically explosive -- they become the face of a cohort-level shift - -Promotion is how the world grows specific people organically instead of -requiring the whole cast to be authored up front. - -## Population Signals That Make A Place Feel Busy - -If the corridor is meant to feel inhabited, the system should constantly -surface signs of offscreen life. - -That means scenes, dashboards, and local UI should be fed with things like: - -- arrivals and departures -- route advisories -- late manifests -- dockside rumor digests -- occupancy warnings -- strike whispers -- inspection delays -- tribunal alerts -- debt-claim notices -- casualty and rescue numbers -- commodity shocks -- public feeds and scandal bursts - -The player does not need to meet everyone. They need to feel surrounded by -consequences. - -## Content-Generation Population Recipe - -For the first authoring slice, a sensible starting mix is: - -- **20-40 persistent agents** -- **10-25 cohorts** -- **0-20 ephemerals per active scene**, generated on demand - -Persistent clusters should be chosen from the story context, but the useful -categories are: - -- primary faction representatives -- ship or station operators -- labor and logistics figures -- care, sanctuary, or rights workers -- criminal or deniable-economy brokers -- corporate cutouts -- technical specialists -- witnesses with leverage - -Cohorts: - -- dock labor -- crews -- sanctuary or civilian overflow -- clinic queues -- administrative or inspection staff -- security contractors -- shadow-market cells -- repair techs -- cargo handlers -- passengers / transients - -That is enough to make generated scenes feel socially populated without turning -the authoring runtime into a screaming furnace. - -## Simulation Tier Mapping - -The population layers should map onto the simulation tiers cleanly. - -### Tier 0 - -- dormant persistent agents -- slowly changing cohorts -- coarse ambient indicators - -### Tier 1 - -- active persistent agents making strategic moves -- cohorts shifting under pressure -- route, labor, and sanctuary state updating - -### Tier 2 - -- a handful of persistent agents in scene -- relevant ephemerals generated for the local moment -- cohort state informing mood, risk, and crowd behavior - -### Tier 3 - -- full interactive dialogue for the most relevant persistent agents -- ephemerals only as needed for texture or interruption -- world pressure visible through feeds, queues, alerts, and consequences - -This keeps expensive cognition focused where it matters. - -## What Not To Do - -Do not: - -- simulate every resident as a full agent -- let cohorts become inert statistical wallpaper -- use ephemerals as consequence-free decoration -- make named agents behave as if the rest of the world does not exist -- make ambient scale purely visual with no mechanical pressure - -That path leads to a world that looks crowded and feels dead. - -## Success Criteria - -The model is working if: - -- the player can feel institutional pressure without being told about it in lore prose -- small decisions by key agents visibly affect larger populations -- cohorts can become restless, relieved, fearful, or politically active -- scenes feel crowded when they should -- the same corridor can feel different under calm, panic, shortage, scandal, or repression -- the named cast feels embedded in a larger society rather than posed in a diorama - -The real test is simple: - -If the player leaves the room, do they still believe thousands of people are -having a bad day because of what just happened? - -If yes, the world is inhabited. diff --git a/docs/architecture/aetheria-content-generation-targets.md b/docs/architecture/aetheria-content-generation-targets.md deleted file mode 100644 index 3e7a6de..0000000 --- a/docs/architecture/aetheria-content-generation-targets.md +++ /dev/null @@ -1,206 +0,0 @@ -# Aetheria Content Generation Targets - -This is the first concrete target note for applying Ghostlight to Aetheria. - -The build target is not a standalone corridor simulation or local crisis game -slice. That older shape was fertile story terrain, but it is not the current -product direction. Do not let it shape the runtime unless the user explicitly -revives it. - -Ghostlight should first serve two Aetheria uses: - -1. content generation inside the **Call of the Void** slice described in the - `AetheriaLore` repository -2. dialogue scaffolding and procedural drama for narrated stories across the - Aetheria timeline - -The goal is a story and content-generation organ: a machine that can hold -characters, factions, pressures, memories, masks, and conflict arcs in explicit -state, then project that state into usable scenes, dialogue beats, outlines, -and dramatic complications. - -That organ must also hold tone. Aetheria should not be flattened into one dry -technical crisis register. The setting can carry Adams/Pratchett-style -wit-with-stakes, domestic comedy, noir suspicion, horror, wonder, dour poetry, -romance, workplace absurdity, and procedural systems prose, often inside the -same broad canon. The common rule is not "be grim." The common rule is that -tone must reveal character, setting, and consequence. - -## Why This Helps Dialogue - -Ghostlight should not ask one LLM prompt to "write good character drama" from -vibes. That path produces clever paste: fluent, energetic, and usually a little -dead behind the eyes. - -The useful split is: - -- Ghostlight builds the drama, narrative pressure, scene setup, and state. -- The dialogue renderer gives each character a constrained local context. -- The character speaks from who they are, what they have endured, what they - want, what they are feeling, what they are hiding, and how they perceive the - person in front of them. - -This does not mean every line should sound like emergency procedure. Characters -also speak from routine, fatigue, affection, boredom, private jokes, little -status games, cultural rituals, and ordinary work. Those are not filler; they -are what make later pressure legible. - -That means dialogue prompts should be character-local rather than omniscient. -They should include only the state that character plausibly has access to: - -- identity and role -- current mood and pressure -- relevant memories -- active goals -- relationship stance toward the listener -- perceived stakes -- cultural or factional scripts -- mask, concealment, or presentation strategy - -This lets characters breathe and act inside the scene instead of serving as -mouthpieces for a single plot-generating agent. The agent can shape the drama. -The character projection should preserve subjectivity. - -## Primary Use: Call Of The Void Content - -Call of the Void should be treated as the first consumer context for Ghostlight, -not as an excuse to build a full social MMO simulation immediately. - -The local source of truth is: - -- `E:\Projects\AetheriaLore\Aetheria\Game Design\Call of the Void.md` -- `docs/aetheria/call-of-the-void-brainstorm.md` for raw imported brainstorm - material - -The slice is a story-first Aetheria scope cut about Catastrophe "Cat" Marrigan: -an out-of-work private investigator making ends meet with a failure-prone space -taxi inside the aftermath of Sol's sequestration into Elysium. - -The older brainstorm frames the core twist as a colony fleet or exploratory -force discovering that nobody is going home. That premise is obsolete. Current -Aetheria canon says the FTL trigger displaced the whole Solar system into the -sealed spacetime domain later called Elysium. Home did not stay behind. Home, -with every corporate bloc, labor regime, upload abuse, political failure, and -unresolved compromise, came through too. - -So the active Call of the Void pressure should be refactored from "there is no -return ticket" into something meaner and more useful: there is no outside, no -clean restart, and no frontier innocent of Sol's history. Cat can still try to -outrun debt, coercion, legal pressure, or institutional rot, but Elysium proves -that escape exported the machinery instead of dissolving it. - -Its useful shape is authored density: - -- episodic investigations -- taxi fares as social x-rays -- station districts -- recurring characters -- faction contacts -- campaign consequence -- the social aftermath of realizing Sol's old failures are now Elysium's local - weather - -Ghostlight should help generate and manage: - -- character dossiers -- faction stances -- relationship tensions -- tonal mode and style targets -- ordinary-life texture before conflict -- scene premises -- dialogue scaffolds -- procedural complications -- continuity-aware reactions -- memory-shaped follow-up scenes -- local cultural and institutional pressure -- case premises and clue chains -- passenger encounters that reveal denial, opportunism, homesickness, fear, or reckless celebration -- continuity pressure from the sealed-domain premise -- cases that expose how old Sol institutions mutate when there is no larger - outside to appeal to - -The important thing is that generated content should emerge from structured -state instead of a prompt asking for "dramatic dialogue" and hoping the machine -does not start juggling knives in the pantry. - -## Secondary Use: Narrated Timeline Stories - -Ghostlight should also support story generation across Aetheria's broader -timeline. - -The existing Aetheria stories are tonal evidence. `When We Get Home` makes the -setting legible through jokes, domestic longing, debt, delays, and the slow -recognition that home has moved. `Rain` makes the setting legible through -ritual, memory, sensory repetition, and a patient reversal from wonder to -horror. Future fixtures should be able to choose similarly varied modes instead -of filing every event into one stern technical drawer. - -That means it should be able to produce: - -- scene outlines -- relationship escalation chains -- factional pressure maps -- alternate dialogue passes -- conflict beats -- character-specific reactions to historical events -- continuity summaries for later story work - -This does not require every story to run as a live simulation. Some outputs can -be generated as authoring scaffolds: structured suggestions, scene cards, -argument maps, motive webs, and dialogue skeletons for a human author to shape. - -## What Ghostlight Should Build For This - -The first useful organs are: - -1. canonical agent state schema -2. perceived-state overlay schema -3. relationship and faction stance records -4. event and scene records -5. prompt projection renderer for content generation -6. coordinator/story runtime driven by goals, values, pressure, memory, - continuity, branch flags, and author constraints -7. branch compiler that turns reviewed branch plans into Ink, sidecars, - callbacks, consequence variables, and visual prompt handles -8. IF artifact reviewer that catches decorative choices, fake folds, unused - variables, and missing consequence callbacks -9. dialogue scaffold renderer that preserves stance, mask, and relationship - asymmetry -10. character-local dialogue context packs that restrict each generated voice to - what that character knows, feels, wants, fears, and perceives - -The output should be inspectable. The author should be able to see why the -machine thinks a character would deflect, confess, threaten, soften, bargain, -lie, leave, spend a resource, conceal evidence, or make a choice that changes a -later scene. - -## What This Is Not - -This is not yet: - -- a standalone corridor crisis game -- a persistent corridor simulator -- a full MMO social runtime -- a requirement to simulate every offscreen person -- a replacement for authorial judgment - -Ghostlight is an authoring and social-state engine first. The live game-shaped -organs can come later if they earn the trouble. - -## Success Criteria - -The first implementation is useful if it can: - -- keep character state distinct from prompt prose -- render dialogue from character-local context rather than global plot vibes -- generate branching dialogue/action scaffolds that reflect relationship history -- create procedural drama from incompatible goals instead of random hostility -- preserve cultural and factional pressure without making clones -- produce story beats a human author can actually use -- make branch choices matter through later affordances, callbacks, visual - modifiers, costs, risks, and endings -- explain its choices in state terms rather than vibes in a rented coat - -The real test is not whether the system can improvise a cool scene once. The -real test is whether it can help generate the tenth scene without forgetting -what the first nine did to everyone involved. diff --git a/docs/architecture/aetheria-lore-grounding-architecture.md b/docs/architecture/aetheria-lore-grounding-architecture.md deleted file mode 100644 index 9528cd6..0000000 --- a/docs/architecture/aetheria-lore-grounding-architecture.md +++ /dev/null @@ -1,386 +0,0 @@ -# Aetheria Lore Grounding Architecture - -Ghostlight needs three different Aetheria modes: - -- grounded historical training -- post-Rupture procedural future training -- procedural Elysium generation - -Do not blur them. That is how a useful mystery becomes a filing cabinet full of -branch facts with the labels scraped off. - -## Core Boundary - -Planned Aetheria gameplay takes place in Elysium. What happens there is -intentionally not fully fixed in the lore vault because discovering and shaping -that history is part of the games themselves. - -The Aetheria timeline begins when humanity is transplanted into Elysium. It can -restart when humanity destroys itself again through negligence, greed, -institutional capture, civilizational momentum, and the familiar psychological -trash fire wearing a crown. - -That means Elysium-era gameplay scenes are not the best first source for -grounded Ghostlight training data. They are downstream procedural territory. - -For grounded training data, Ghostlight should start from the authored historical -archive: late Sol, Pre-Elysium institutions, factional flashpoints, personhood -conflicts, labor regimes, political collapse, and the FTL trigger. - -That does not mean Ghostlight should avoid Elysium futures. The trained models -will need to handle post-Rupture concepts: Aether, pseudospace, temporal -nonlinearity, spirits, altered substrates, necrotech, mutable bodies, and all -the new ways power learns to monetize miracles while pretending it found ethics -in a drawer. - -Elysium future data belongs in a separate lane because its canon is conditional, -not because it is fake. Sol history is a single artifact. Elysium history is a -branching state-space: every possible future is canon inside the branch whose -prior conditions produced it. A generated future must therefore carry branch -lineage, dependencies, and local truth boundaries instead of being treated as -scratch material waiting for permission to matter. - -## Revised Architecture - -Grounded historical training flow: - -```text -Aetheria authored historical lore - -> lore grounding digest - -> historical scene fixture - -> agent-state fixture - -> speaker-local input slice - -> projection artifact - -> prompt_text - -> generated dialogue or drama - -> reviewed training example -``` - -Procedural Elysium flow: - -```text -grounded pre-Elysium priors - -> procedural Elysium branch state - -> Ghostlight agents and institutions - -> projected dialogue and drama - -> simulated branch history - -> branch-local canonical state -``` - -Post-Rupture future training flow: - -```text -authored Elysium concepts and constraints - -> possible future premise - -> procedural branch fixture - -> coordinator plan and projected local contexts - -> generated action, dialogue, and event consequences - -> reviewed future-branch training artifact - -> branch-local canonical history indexed by lineage -``` - -The first flow teaches the machine what grounded social pressure looks like. -The second and third flows teach it how those pressures mutate under Elysium's -stranger conditions while keeping branch-local canon separate from the Sol -artifact and from sibling Elysium branches. - -## Source Priority - -For projection training, prefer sources in this order: - -1. Authored historical lore with explicit institutional, social, and political - context. -2. Grounded transition material around the FTL trigger and displacement. -3. Historical fiction or scene fragments that remain canon-compatible. -4. Authored post-Elysium concept documents that define altered conditions, - technologies, species, metaphysics, or social pressures. -5. Elysium-era procedural fixtures marked with explicit branch lineage and - conditional truth boundaries. - -Call of the Void and Cat/Oz can remain useful for testing projection mechanics, -speaker-local boundaries, and prompt shape. They should not be treated as the -primary linear-history training corpus because their facts belong to Elysium's -conditional branch space. - -## Historical Flashpoint Candidates - -Good first fixtures should come from parts of Aetheria that are already -pressure-dense and source-grounded: - -- contract citizenship and debt regimes -- labor-system enforcement and infrastructure dependency -- upload abuse and contested personhood -- uplift or nonhuman personhood conflicts -- algorithmic governance and predictive policing -- corporate blocs turning infrastructure into leverage -- the FTL program as a political escape hatch from Sol's failure -- the moment around the FTL trigger, where institutions and people discover - that escape did not mean absolution - -The best scenes are small, local, and socially loaded: - -- a worker negotiating dangerous contract terms -- an upload arguing over continuity, ownership, or service denial -- a technician asked to sign off on an unsafe FTL dependency -- a debtor deciding whether help is relief or capture -- an institutional agent performing compassion while enforcing a machine -- a family, crew, or workplace discovering that political collapse has become - intimate - -## Lore Grounding Digests - -Before producing training projection examples from a historical flashpoint, -create a lore grounding digest. - -The digest format is defined in: - -- `docs/architecture/lore-grounding-digest-format.md` -- `schemas/lore-grounding-digest.schema.json` -- `examples/lore-grounding/historical-flashpoint.template.json` - -A digest should include: - -- source files and relevant line or section notes -- time period -- location or institution -- involved factions, classes, and roles -- material constraints -- local norms, taboos, and scripts -- vocabulary or speech-register cues -- what each speaker plausibly knows -- what each speaker misreads -- author-only context that must not enter prompt text -- open questions needing lore elaboration - -It should also include cultural and factional pressure fields: - -- internal virtues -- internal shames -- prestige markers -- taboo triggers -- emotional display norms -- trust defaults -- speech register cues -- outsider stereotypes -- factional misread patterns -- role obligations and failure modes - -The digest is not a replacement for the lore vault. It is a compiled working -slice for one fixture, so projection examples can cite grounded pressure -without dragging the whole archive into every prompt. - -## Fixture Types - -Use explicit fixture status: - -- `historical_grounded` -- `transition_grounded` -- `procedural_branch` -- `future_branch` -- `branch_lineage_canon` - -`historical_grounded` and `transition_grounded` examples can become primary -single-history training data. - -`procedural_branch` and `future_branch` examples are canonical inside their own -branch lineage. They are useful for testing, generation, responder training, -coordinator training, and post-Rupture concept coverage, but must not be treated -as facts that also apply to sibling branches or to the Sol artifact. - -`branch_lineage_canon` examples are reviewed branch histories whose lineage, -prior conditions, and local state have been made explicit enough to serve as -stable training or gameplay continuity. - -Use `future_branch` when the point of the fixture is to explore possible -post-Rupture Elysium outcomes and weird-concept behavior. Use -`procedural_branch` for ordinary gameplay-era branch fixtures whose main job is -scene/runtime testing. - -## Projection Rules - -Grounded projection examples should prove: - -- the prompt text is self-sufficient for the dialogue model -- setting and institutional context are speaker-local -- historical pressure appears as lived constraint, not exposition paste -- the speaker does not know author-only future outcomes -- the generated behavior follows from state, culture, memory, relationship, and - material pressure - -If the lore source is too vague for a convincing scene, stop and elaborate the -lore slice first. Do not train the model to pave over missing social reality -with confident fog. - -## Post-Rupture Future Branches - -Future-branch generation should be deliberate, not a slush pile of glittering -possibilities with no handles. - -Each possible future fixture should declare: - -- which authored post-Elysium concepts it exercises -- which facts are fixed source constraints -- which facts are generated branch assumptions -- which branch facts are local to this possible future -- which prior conditions make this branch true -- which facts belong to this branch lineage and not to sibling branches -- which generated facts must not leak back into single-history Sol training -- what new social pressure the weird concept creates -- what old pre-Elysium pressure is returning in a new costume - -## Attractors, Rails, And Injections - -Elysium is a branching state-space, not an undifferentiated fog. Some events may -happen in most branches because the pressures almost always produce them. Some -events may be authored constraints because the game needs a stable enough world -to design around. Some events may be injected by quests or scenario logic when -an active branch reaches a compatible shape. - -Use separate labels: - -- `branch_attractor` -- `fated_event` -- `tech_order_constraint` -- `quest_injection` -- `branch_local_event` - -`branch_attractor` means an event is highly likely under broad pressures but -not absolutely forced. The founding of a faction born inside Elysium may start -here if the social, economic, metaphysical, and institutional gradients make it -show up again and again with local variation. - -`fated_event` means the authorial hand is on the scale. The event should occur -unless the branch has explicitly disabled it. Use this sparingly, because too -much fate turns the quantum superposition back into a hallway with rude -wallpaper. - -`tech_order_constraint` means discovery order matters. Some technologies, -metaphysical practices, industrial dependencies, or social adaptations should be -unavailable until their prerequisites exist. This is not merely lore flavor; it -is a runtime gate for what quests, economies, factions, and character actions -can plausibly do. - -`quest_injection` means authored content enters the active timeline at a branch -point. A quest may require prerequisites, forbid certain prior states, create -new local facts, or push an attractor toward one concrete manifestation. - -`branch_local_event` means the event is canonical inside its lineage but has no -special pull across other branches. - -Future branch fixtures should record: - -- event type from the labels above -- probability or pull strength, for attractors -- required branch prerequisites -- excluded branch states -- technology prerequisites -- faction or institution prerequisites -- quest ids or content hooks, if injected -- local variation allowed -- hard facts created -- branch facts that remain conditional - -Future branch fixtures should also emit technology and item manifest candidates -when exploration changes the material economy: - -- new item families -- new item variants -- component and subassembly breakdowns -- assembly upgrade surfaces -- technology prerequisites -- faction or manufacturer access -- supply bottlenecks -- salvage, counterfeit, maintenance, and substitution paths -- quest hooks created by scarcity or discovery - -See `docs/architecture/technology-item-manifest-plan.md`. - -Factions born in Elysium should be modeled through this lens. Adrasteia or Miss -Terri's Sugarrific Snack Company can be represented as pressure-born attractors, -fated institutions, quest-injected branch content, or some combination. The -point is not to decide that once in prose and hope the game remembers. The point -is to make the founding mechanism explicit enough for Ghostlight, the active -timeline, and later game systems to agree on what kind of inevitability they are -dealing with. - -Good future branches should stress the model with conditions it cannot learn -from late-Sol history alone: - -- Aether as infrastructure, ecology, religion, weapon, medicine, or status good -- pseudospace as transit, concealment, displacement, exile, or labor terrain -- temporal nonlinearity as memory, debt, evidence, grief, insurance, or law -- spirits as persons, tools, contaminants, witnesses, ancestors, or frauds -- necrotech as care, extraction, continuity, punishment, or labor capture -- mutable bodies and species boundaries as liberation, class marker, liability, - taboo, or supply chain -- post-Rupture institutions rebuilding old hierarchies with new miracles - -These branches should feed: - -- Aetheria responder training, so the model learns post-Rupture assumptions -- coordinator training, so the story runtime can handle weird scene premises -- appraiser and relationship training, so characters misread new phenomena in - socially grounded ways -- institution/faction/consumer training, so economic and political behavior can - respond to miracles as markets, threats, privileges, and dependencies - -Keep source provenance strict. A branch can invent a local future, but it should -say what it invented and what branch conditions make it true. The machine may -generate futures under supervision; it does not get to erase the branch index -while everyone is looking at the shiny ghost. - -## Operating Doctrine - -Ghostlight will generate a lot of Aetheria dialogue, branching scenes, and -training data. That means it will also be the first tool to stress-test many -timeline details at room scale. Treat that as part of the job, not an -exception. - -Before writing an Aetheria scene or generating data from one, do a source pass: - -1. Check AetheriaLore for the factions, social movements, institutions, species - or body types, location, and time period present in the scene. -2. Extract the material constraints that shape behavior: habitat form, - infrastructure, law, money, route access, labor pressure, class position, - surveillance, body affordances, communication channels, and local failure - costs. -3. Distill those details into the lore grounding digest, agent-state fixture, - projected local context, or Ink sidecar before prompting a response model. -4. Keep the prompt character-local. Source grounding tells Ghostlight what the - room and culture make possible; it does not grant characters omniscience. -5. If the lore does not support a needed concrete detail, do not fill the gap - with confident furniture. Mark the gap, elaborate the AetheriaLore source, - then regenerate or revise the Ghostlight artifact from the patched source. -6. Commit the lore patch in AetheriaLore and cite the source path from - Ghostlight so the training artifact has a clean provenance trail. - -The output goal is not only clean training data. It is also playable, readable, -fun interactive fiction that discovers where the worldbuilding is thin by -leaning on it. If Ghostlight needs to know what a sanctuary intake board looks -like to a cetacean Navigator, that is not trivia. That is worldbuilding under -load. - -## Lore Gap Policy - -When a gap appears, classify it before writing: - -- `blocking`: generation would produce wrong bodies, wrong institutions, wrong - authority, or wrong material constraints without the missing detail. -- `safe_to_stub`: the scene can proceed with a clearly marked provisional - detail that does not affect canon-critical behavior. -- `defer`: the detail is decorative and should not enter the prompt yet. - -Blocking gaps should be patched in AetheriaLore first. Safe stubs must be -tracked in the digest or sidecar and revisited before promotion. Deferred gaps -should stay out of prompt text so they do not harden by accident. - -## Training Boundary - -Ground the machine in the past, then generate possible futures under -supervision with branch labels sharp enough that infinity does not show up -wearing one nametag. - -Historical fixtures teach single-history social pressure. Future-branch -fixtures teach conditional canon. Cat/Oz-style procedural fixtures teach -runtime mechanics. Those lanes can compare against each other, but they should -not collapse into one unlabeled corpus. diff --git a/docs/architecture/aetheria-persistent-agent-architecture.md b/docs/architecture/aetheria-persistent-agent-architecture.md deleted file mode 100644 index 76dc16b..0000000 --- a/docs/architecture/aetheria-persistent-agent-architecture.md +++ /dev/null @@ -1,586 +0,0 @@ -# Aetheria Persistent Agent Architecture - -This is the companion document to -[Things To Steal](../research/things-to-steal.md). - -For the first concrete target, see -[Aetheria Content Generation Targets](./aetheria-content-generation-targets.md). - -For the scaling model that explains how a crowded region can be simulated with -a relatively small persistent cast, see -[Aetheria Agent Population Model](./aetheria-agent-population-model.md). - -For the deeper note on how culture, personality distributions, memory, and -perceived state should project into prompts, see -[Agent State Distributions And Prompt Projection](./agent-state-distributions-and-prompt-projection.md). - -That document is the theft list. This one is the machine we are trying to build -out of the stolen parts. - -The long-horizon target is a persistent world full of in-universe agents who: - -- remember what happened -- want different things -- collide with each other because their values and interests do not line up -- interact with humans without collapsing into quest dispensers or therapy plushies - -The important bit is that the world should not exist solely to flatter the -player. Humans are participants, not the sun around which every synthetic -little bastard must orbit. - -## Design Goals - -The near-term target is content generation and story scaffolding, not a -standalone game slice. Ghostlight should first help Aetheria authors generate -dialogue, scene pressure, procedural drama, and character reactions from -explicit social state. - -We want a world where: - -- agents persist across sessions -- relationships evolve over time -- off-screen life continues -- conflict emerges from incentives -- the same character remains recognizably themselves under pressure -- human intervention can redirect events without erasing everyone else's agency - -We do **not** want: - -- a thin layer of LLM chat stapled onto static NPC behavior -- every character becoming a slightly differently dressed assistant -- a world that only animates when a human looks at it -- fake drama generated by random hostility instead of meaningful friction - -## World Model - -The world should be represented as a persistent simulation with five main state -layers: - -1. **Canonical world state** - - locations - - factions - - resources - - institutions - - active conflicts - - world-level events -2. **Agent identity state** - - role - - background - - loyalties - - values - - aversions - - appetites - - speech style -3. **Agent dynamic state** - - current location - - current obligations - - current mood / pressure / fatigue - - current social exposure - - short-horizon plans -4. **Relationship state** - - trust - - respect - - resentment - - fascination - - fear - - obligation - - debt -5. **Memory state** - - episodic incidents - - scene summaries - - semantic profile conclusions - - relationship summaries - - active inferred goals and concerns - -## Agent Stack - -Each agent should be built from explicit layers instead of one giant persona -prompt. - -### 1. Identity Layer - -Relatively stable facts: - -- who they are -- what they believe -- what they want to be seen as -- what they cannot tolerate -- what they are drawn toward - -This should be treated as durable but revisable. Identity is not immutable, but -neither should it drift because the model got bored. - -### 2. Relationship Layer - -Every important other should have a relationship record, including: - -- another agent -- a human player -- a group or faction - -The record should track: - -- trust -- respect -- resentment -- dependence -- attraction or fascination where relevant -- leverage -- recent unresolved incidents - -The point is not to create one friendship slider like a life sim from 2004. The -point is to track the actual shape of a social bond. - -### 3. Goal Layer - -Agents need active goals, not just a biography. - -Goals should be: - -- private or public -- immediate or long-range -- strategic or emotional -- revisable in response to new information - -A goal object should include: - -- description -- priority -- time horizon -- emotional stake -- blockers -- dependencies -- known rivals -- likely next moves - -### 4. Memory Layer - -Memory should be split into: - -- **working memory** - - current scene - - immediate context - - active inferences -- **episodic memory** - - timestamped incidents - - where, who, what, consequence -- **scene memory** - - distilled summaries of interactions -- **semantic memory** - - generalized beliefs about self, others, and world -- **relationship memory** - - remembered incidents and inferred patterns tied to a specific other - -This is where the current interaction-memory work is directly useful. - -### 5. Theory-of-Mind Layer - -Each active interaction should have a lightweight scratchpad: - -- what the other party likely wants -- what they fear -- what they think is happening -- what they are trying to get from me -- how confident we are about those guesses - -This should be ephemeral and revisable. First impressions are useful, but -worshipping them is how systems become smug and stupid. - -## Simulation Tiers - -A persistent world cannot run every agent at full dialogue fidelity all the -time unless we want to immolate the hardware. - -So the world should run on tiers. - -### Tier 0: Dormant Persistence - -For agents far away from any relevant action: - -- maintain location, obligations, and long-horizon goals -- advance the clock coarsely -- update minimal state - -### Tier 1: Strategic Tick - -For agents in active regions but not in a live scene: - -- update goals -- choose broad actions -- move, trade, coordinate, prepare, avoid, investigate -- write compact event records - -### Tier 2: Scene Simulation - -For agents inside a socially or narratively relevant scene: - -- model who is present -- what each actor knows -- what each actor wants -- who is hiding what -- who is under pressure -- resolve short exchanges, negotiations, or conflicts - -### Tier 3: Live Interactive Presence - -For agents currently engaged with a human or central dramatic scene: - -- full dialogue generation -- richer perception and recall -- fine-grained ToM updates -- explicit action selection tied to the live interaction - -This tiered model is how we get a world that feels alive without paying for a -small national grid. - -## Core Loop - -At a high level, each active agent loop looks like: - -1. Perceive - - scene state - - nearby actors - - new events - - human input -2. Interpret - - what matters - - what changed - - what this implies for goals and relationships -3. Update internal state - - working memory - - ToM scratchpad - - emotional pressure / stance -4. Retrieve memory - - relevant episodes - - relationship incidents - - semantic conclusions -5. Evaluate goals - - what is threatened - - what is newly possible - - what should take precedence now -6. Choose action - - speech - - movement - - trade - - alliance - - concealment - - refusal - - violence - - delay -7. Commit result - - world state update - - event log - - memory writes -8. Reflect later - - consolidate incidents - - revise relationship state - - revise semantic beliefs - - revise goals - -## Relationship Engine - -The relationship system should be treated as first-class infrastructure, not -decorative metadata. - -Each relationship record should have: - -- scores or categorical state for trust, respect, resentment, obligation, fear, fascination -- a short summary of the current relationship -- the unresolved incidents driving that summary -- known pressure points -- current access level - -Example consequences: - -- low trust + high obligation = brittle alliance -- low respect + high dependence = contemptuous reliance -- high fascination + high fear = unstable orbit -- high resentment + high access = sabotage risk - -That is where drama comes from. - -## Goal Engine - -Goals should be generated and updated from: - -- identity -- current needs -- memory -- faction context -- scene opportunities -- rival actions - -We should distinguish between: - -- **maintenance goals** - - survive - - maintain station - - avoid exposure -- **strategic goals** - - secure influence - - gain a resource - - undermine a rival -- **emotional goals** - - seek vindication - - restore dignity - - protect someone - - punish betrayal - -Emotional goals matter because otherwise every character becomes a boring little -optimization engine with no pulse. - -## Scene Engine - -A scene should be an explicit object, not just "some chat happened." - -A scene record should contain: - -- location -- participants -- public stakes -- hidden stakes -- triggering event -- current tension axes -- known facts by actor -- unknown facts by actor -- scene outcome - -Useful tension axes: - -- status -- safety -- secrecy -- leverage -- affection -- ideology -- scarcity - -The scene engine should decide: - -- whether to escalate -- whether to de-escalate -- whether to fork into violence, bargain, confession, retreat, or deception - -## Human Participation - -Humans should be one force in the world, not the privileged audience every -character was born to adore. - -That means: - -- agents should remember human actions -- agents should form durable impressions of specific humans -- agents should change how much they reveal, trust, or tolerate -- agents should be willing to refuse or redirect -- agents should sometimes try to use the human for their own ends - -Humans should be able to: - -- build alliances -- ruin them -- become symbols -- become liabilities -- become prey -- become confidants - -That is much more interesting than "click NPC, receive lore paragraph." - -## Narrative Layer - -We should not hard-script drama, but we should summarize it. - -The narrative layer should: - -- generate personal chronicles from actual events -- generate regional or faction news from high-impact changes -- generate rumor propagation when information is partial or distorted - -The crucial rule: - -- narrative is downstream of simulation -- not a replacement for simulation - -## How The Current Supporting Stack Maps To This - -The nice part is that some useful scaffolding already exists elsewhere. - -Current useful pieces: - -- Postgres-backed persistent state -- Qdrant-backed semantic retrieval -- interaction memory with behavioral dimensions -- source and lore indexing -- provider-side tool use -- owner-safe MCP patterns - -What needs to be added: - -- multi-agent world state store -- relationship graph -- explicit goal objects -- scene scheduler -- reflection/consolidation jobs for cast state -- tiered simulation runtime -- world-facing tools for observation and action - -In other words, the existing conversational stack is already halfway to being a -mind-and-memory service. What it lacks is the world model and the cast -scheduler. - -## Suggested Data Model - -At minimum, the persistent store should grow tables or equivalents for: - -- `world_regions` -- `world_events` -- `agents` -- `agent_identity_snapshots` -- `agent_dynamic_state` -- `agent_goals` -- `agent_relationships` -- `agent_memories_episodic` -- `agent_memories_scene` -- `agent_memories_semantic` -- `scene_instances` -- `scene_participants` -- `human_agent_interactions` -- `rumors` - -Qdrant or equivalent can remain the retrieval layer for: - -- episodic recall -- lore retrieval -- source grounding -- scene similarity - -But the canonical social and world state should stay relational and -inspectable. - -## Suggested Runtime Services - -The world runtime should likely split into: - -- **world scheduler** - - advances ticks - - activates scenes - - downgrades inactive agents -- **agent executor** - - runs an agent turn - - retrieves memory - - updates goals and relationships -- **scene resolver** - - handles active multi-party interactions -- **reflection worker** - - consolidates events into longer-term memory -- **narrative worker** - - writes chronicles and reports - -That keeps the system legible instead of letting one monstrous worker do all -the thinking and all the plumbing at once. - -## Failure Modes To Watch For - -### 1. Everyone Becomes The Same Person - -The agent voices flatten and all conflict becomes cosmetic. - -Countermeasure: - -- strong identity layer -- explicit value hierarchy -- personality consistency evaluation - -### 2. Memory Becomes Sludge - -Everything is stored, nothing is distinguished, retrieval turns to soup. - -Countermeasure: - -- tiered memory -- write-path filtering -- periodic consolidation -- clear forgetting policy - -### 3. Drama Becomes Random Meanness - -Characters feel chaotic rather than motivated. - -Countermeasure: - -- tie conflict to values, history, incentives, and pressure - -### 4. Humans Break The World By Existing - -Every character over-orients around the nearest player. - -Countermeasure: - -- keep off-screen goals live -- preserve non-human social gravity -- let humans matter without becoming the axis mundi - -### 5. Sycophancy Wears A Costume - -The bot sounds spicier but still validates whatever frame the user wants. - -Countermeasure: - -- explicit anti-sycophancy evaluation -- persistent relationship memory -- boundary-aware response guidance - -## Build Order - -### Phase 1: Authoring Cast Spine - -- explicit agent identity dossiers -- explicit goal objects -- explicit relationship objects -- episodic + semantic memory split - -### Phase 2: Dialogue And Drama Scaffolding - -- prompt projection for scene and dialogue drafts -- relationship-aware dialogue skeletons -- conflict beat generation from incompatible goals -- author-visible rationale for generated moves - -### Phase 3: Social Simulation - -- scene objects -- scene scheduler -- relationship updates from scenes -- goal revision from scenes - -### Phase 4: Persistent World - -- region state -- off-screen strategic ticking -- rumor/news propagation -- faction and economy hooks - -### Phase 5: Human Integration - -- live player-facing interactions -- persistent human reputation -- access, trust, and consequence systems - -### Phase 6: Rich Narrative Surface - -- chronicles -- regional reports -- replay and spectator tooling - -## The Real Ambition - -The ambition here is not "better NPC dialogue." - -It is: - -- a world with inhabitants -- inhabitants with memory -- memory that changes what they want -- wants that collide -- collisions that produce story - -That is the actual prize. Everything else is just wiring and smoke. diff --git a/docs/architecture/agent-state-distributions-and-prompt-projection.md b/docs/architecture/agent-state-distributions-and-prompt-projection.md deleted file mode 100644 index c171bad..0000000 --- a/docs/architecture/agent-state-distributions-and-prompt-projection.md +++ /dev/null @@ -1,461 +0,0 @@ -# Agent State Distributions And Prompt Projection - -This note describes how personality, culture, memory, and social context should -be represented in structured state, and how that state should be projected into -prompts for dialogue generation. - -The central rule is simple: - -- the prompt is not the source of truth -- the prompt is a temporary projection of deeper state for one turn or one scene - -If we try to store the whole person in prompt prose, the system turns back into -theatrical mush. The real machine has to live in explicit state. - -For the related notes on personality structure and dialogue classification, see: - -- [Personality Model Roadmap](../research/personality-model-roadmap.md) -- [Personality Signal Classifier](../research/personality-signal-classifier.md) - -## Core Principle - -We should model agents through: - -1. canonical latent state -2. perceived state for each agent -3. prompt projection from perceived state into live generation - -That gives us: - -- stable world truth -- subjective misunderstanding -- efficient live prompting without pretending the prompt is the database - -## State Families - -Each agent should have explicit state families, not one giant personality blob. - -### 1. Underlying Organization - -These are deep structural variables: - -- self-coherence -- contingent worth -- shame sensitivity -- reciprocity capacity -- mentalization quality -- authenticity tolerance -- mask rigidity -- external-regulation dependence - -These are slow-changing and often heavily shaped by early development and -repeated relational history. - -### 2. Stable Dispositions - -These are relatively persistent tendencies: - -- novelty-seeking -- conformity -- status hunger -- risk tolerance -- sociability -- baseline threat sensitivity -- aesthetic appetite -- ideological rigidity - -### 3. Behavioral Dimensions - -These are first-class, not optional garnish. They belong in the rebuild from -the start: - -- interpersonal warmth -- drive -- grandiosity -- validation-seeking -- anxiety -- control pressure -- hostility -- suspicion -- rigidity -- withdrawal -- volatility -- attachment-seeking -- distance-seeking - -These are the main handles for social behavior, institutional pressure, and -consumer or factional drift. - -### 4. Presentation Strategy - -These describe how the self is performed: - -- charm -- compliance -- superiority -- detachment -- seductiveness -- competence theater -- moral theater -- strategic opacity -- cultivated harmlessness -- abrasive boundary -- ironic distance - -These are not just decorative style. In some agents they are survival -machinery. - -### 5. Voice Style - -These describe how the performed self comes out in language: - -- dryness -- verbal warmth -- formality -- verbosity -- pace -- plainspoken directness -- lexical precision -- technical density -- technical compression -- figurative language -- lyricism -- narrative detail -- emotional explicitness -- pointedness -- self disclosure -- hedging -- certainty marking -- politeness -- coded politeness -- ritualized address -- register switching -- dialect marking -- theatricality -- humor -- conversational dominance -- listening responsiveness -- question asking -- profanity - -### 6. Derived Verbal Responses - -Defensive verbal moves are derived during projection. The canonical state stores -the pressures and speech mechanics that make those moves likely. - -Target emergent behaviors: - -- sarcastic deflection can emerge from shame sensitivity, ironic distance, - exposure pressure, suspicion, and a dry or pointed voice -- sincerity evasion can emerge from mask rigidity, low authenticity tolerance, - strategic opacity, and low emotional explicitness -- emotional evasion can emerge from distance-seeking, withdrawal, acute shame, - or control pressure with low self-disclosure -- banter as boundary can emerge from humor, ironic distance, attachment - pressure, and distance-seeking -- verbal aggression can emerge from hostility, perceived status threat, - grievance activation, and abrasive boundary - -These are behaviors Ghostlight should be able to produce and test for without -storing them as authored canonical traits. - -### 7. Situational State - -These are transient activations: - -- exhaustion -- scarcity pressure -- humiliation -- panic -- triumph -- grief -- overstimulation -- grievance activation -- acute shame -- perceived status threat - -### 8. Relationship State - -Per target person, faction, group, product domain, or institution: - -- trust -- resentment -- dependence -- fear -- fascination -- obligation -- envy -- moral disgust -- perceived status gap -- expectation of care -- expectation of betrayal - -### 9. Goals And Values - -- active goals -- protected values -- emotional stakes -- tradeoffs -- unforgivables - -## How To Represent Variables - -Do not represent most of these as naked scalars if we want culture and history -to shape them properly. - -A practical representation is: - -- `mean` -- `plasticity` -- `current_activation` - -So instead of: - -- `status_hunger = 0.72` - -use something like: - -- `status_hunger.mean = 0.72` -- `status_hunger.plasticity = 0.22` -- `status_hunger.current_activation = 0.89` - -This gives us: - -- stable baseline personality -- different rates of change -- scene-sensitive activation without rewriting the whole person every turn - -Canonical authored state should not include epistemic uncertainty about itself. -If a value is only an observer's read, store it as perceived state rather than -canonical state. Perceived dimensions should not expose canonical `mean` or -`plasticity`; they should track observed activation, attributed disposition, -and confidence. This lets the model represent -fundamental attribution bias: someone can behave a certain way under pressure -and be perceived as simply being that way. - -## Culture As A Prior Field - -Culture should not create clones. Culture should shape distributions. - -For each culture, faction, class stratum, or institution, define: - -- prior means over variables -- covariance structure -- reward gradients -- penalty gradients -- preferred masks -- taboo map -- prestige map -- default relationship posture to insiders, outsiders, rivals, inferiors, and superiors -- favored narrative scripts - -This means a culture is not "people here are high in trait X." - -It is more like: - -- this culture rewards controlled presentation -- penalizes spontaneous vulnerability -- elevates status anxiety -- normalizes suspicion of low-status outsiders -- attaches prestige to procedural fluency and emotional composure - -That is how a Dominion or Lucent style environment should work: as a field that -shapes what people become profitable or safe enough to be. - -## Personal History As A Transform Layer - -Culture is only the starting pressure. - -Then the prior is transformed by: - -- attachment history -- class position -- faction indoctrination -- educational shaping -- labor regime -- remembered humiliations -- remembered betrayals -- remembered rescue, admiration, abandonment, and obligation - -So agent state should be read as: - -- cultural prior -- transformed by developmental history -- transformed by remembered episodes -- currently activated by scene pressure - -## Cohorts And Populations - -The same representation can be lifted from individuals to populations. - -A colony, district, labor bloc, or consumer cohort can have: - -- shared priors -- institutional conditioning -- repeated collective incidents -- relationship state toward factions, employers, media ecosystems, and product classes - -This is much better than Big Five-style population sliders because it lets us -model things like: - -- prestige hunger -- fear-state compliance -- grievance accumulation -- attachment to institutions -- validation loops induced by media -- suspicion induced by audit or betrayal - -That is much closer to Aetheria than a broad trait scaffold alone. - -## Canonical State Vs Perceived State - -The world should not only track what is true. It should track what each agent -thinks is true. - -So we need: - -- canonical world state -- canonical agent state -- per-agent perceived state - -Perceived state includes: - -- what this agent believes about others -- what motives they attribute -- what traits they think they are seeing -- what mask they think someone is wearing -- what threats or opportunities they think are present - -This is where emotional intelligence, suspicion, attachment hunger, status -anxiety, and cultural priors distort interpretation. - -The acting agent should mostly be prompted from perceived state, not canonical -truth. That is how misunderstanding becomes organic instead of hand-authored. - -## Prompt Projection - -Prompt rendering should be treated as projection, not storage. - -For a live scene, build the prompt from: - -### 1. Identity And Role - -- who the agent is -- what role they occupy -- what they want to be seen as - -### 2. Cultural Default Frame - -- prestige rules -- taboo zones -- expected forms of control or intimacy -- factional posture - -### 3. Current Presentation Strategy - -- how they are trying to appear right now -- what they are concealing -- what they must not look like - -### 4. Current Situation - -- scene pressure -- public exposure -- scarcity -- humiliation risk -- safety risk - -### 5. Relationship Context - -- what they think of the other party -- what they need from them -- what wounds or debts are active -- what status relation they perceive - -### 6. Relevant Memory - -Not full history. Only: - -- the few most relevant episodes -- relationship summaries -- current active fears, loyalties, or grievances -- currently salient cultural scripts - -### 7. Goals And Constraints - -- what they are trying to achieve in this scene -- what they cannot afford -- what values they will not betray - -### 8. Listener Model - -If the scene involves another agent, include: - -- what this agent thinks the other wants -- what they fear the other is doing -- where they may be misreading them - -## What The Prompt Should Not Do - -Do not make the prompt: - -- the sole canonical store of identity -- a full dump of all memories -- a taxonomy recital -- a fake omniscient summary that erases subjective misreading - -The prompt should be compact, selective, and scene-bound. The state store -carries the rest. - -## Economic Consequences - -This model gives us much more useful demand and cultural behavior than old -trait-only systems. - -For example: - -- high status hunger plus validation-seeking plus fragile self-worth leads toward prestige goods, symbolic upgrades, and visible luxury -- high threat sensitivity plus conformity plus shame reactivity leads toward safety goods, procedural systems, insurance, and respectable signaling -- high drive plus novelty-seeking plus low institutional attachment leads toward frontier gear, gray-market experimentation, and risky migration -- high mask rigidity plus high impression-management intensity leads toward corrective aesthetics, social camouflage, and reputation-maintenance consumption - -That is how culture, labor, media, and institutions become market-shaping -forces instead of mere flavor text. - -## Recommended Implementation Path - -1. Define the state schema with first-class support for: - - underlying organization - - stable dispositions - - all core behavioral dimensions, including `volatility`, `attachment-seeking`, and `distance-seeking` - - presentation strategies - - voice styles - - situational state - - relationship state - - goals and values -2. Represent those variables as priors plus activation, not just fixed scalars. -3. Define cultural and institutional prior templates. -4. Add history transforms from remembered episodes. -5. Add per-agent perceived state overlays. -6. Build prompt renderers that project perceived state into live generation. -7. Keep canonical state, perceived state, and prompt projection cleanly separated. - -## Bottom Line - -The right machine is not: - -- a persona prompt with some adjectives taped to it -- a canonical trait sheet with no cultural shaping -- a direct line from "personality value" to dialogue - -The right machine is: - -- latent state distributions -- shaped by culture -- reshaped by history -- distorted by perception -- projected into prompts for one scene at a time - -That gives us agents who can feel culturally situated, personally scarred, -socially biased, and dynamically alive without making the prompt carry the -whole civilization on its back. diff --git a/docs/architecture/agent-state-variable-glossary.md b/docs/architecture/agent-state-variable-glossary.md deleted file mode 100644 index 7d11bca..0000000 --- a/docs/architecture/agent-state-variable-glossary.md +++ /dev/null @@ -1,273 +0,0 @@ -# Agent State Variable Glossary - -This document explains the current v0 Ghostlight state variables. It is the -human-facing companion to: - -- `schemas/agent-state.schema.json` -- `schemas/agent-state.required-fields.json` -- `examples/agent-state.call-of-the-void.json` - -The schema is not pretending this vocabulary is final. It is a first stable -core: enough shared axes to compare characters, build prompt projection, and -avoid turning every new scene into a bespoke little fog machine. - -## Variable Components - -Canonical scalar-like state variables use three numeric components. - -| Field | Meaning | -| --- | --- | -| `mean` | The baseline tendency or long-run level for this variable. A high `mean` means this trait, strategy, pressure, or stance is normally strong for the agent. | -| `plasticity` | How easily this variable can change. High plasticity means the value can move quickly under events, relationships, culture, or scene pressure. Low plasticity means it is entrenched. | -| `current_activation` | How active the variable is right now, in this scene or current state. This can spike above or fall below the baseline without rewriting the agent. | - -Example: - -```json -{ - "mean": 0.35, - "plasticity": 0.2, - "current_activation": 0.9 -} -``` - -This means the agent is not generally high in the variable, the baseline is not -very easy to change, but the variable is strongly activated right now. -Translation: this is a situation, not a personality transplant. - -Canonical character state does not include `certainty`. If a generated or -imported profile is provisional, track that in workflow provenance, draft -status, imported-source notes, or review status. - -Perceived state uses a different shape because observers do not know canonical -baseline or plasticity. They see behavior, then often treat that behavior as -evidence of what the target is like. - -```json -{ - "observed_activation": 0.9, - "attributed_disposition": 0.7, - "confidence": 0.4 -} -``` - -| Field | Meaning | -| --- | --- | -| `observed_activation` | How strongly the observer thinks the target expressed the dimension in the observed event or scene. | -| `attributed_disposition` | How much the observer generalizes from the observed behavior into "this is what the target is like." | -| `confidence` | How strongly the observer trusts this read. This is where evidence strength, emotional investment, prejudice, relationship stakes, prior memory, and social reinforcement show up. | - -This models fundamental attribution bias directly. A character can see someone -behave coldly during a crisis and conclude "they are cold," not "they were -activated toward distance under exceptional pressure." Correcting that -impression takes work because the observer's confidence is supported by memory, -emotion, stakes, prior assumptions, and social reinforcement. - -Perceived overlays may use structured belief metadata such as subject, claim -type, evidence events, visibility, and emotional charge. That metadata is not -canonical certainty. It describes why a specific observer trusts a specific -read. - -## Label Set Policy - -The labels in `agent-state.required-fields.json` are the required v0 core, -not per-character tags. They cover the axes Ghostlight currently treats as -first-class. - -The validator requires each canonical agent fixture to include the full core -set so agents can be compared on the same axes. That means Cat's example does -not contain only labels that apply strongly to Cat. It contains all required -labels, with low values for weak or inactive axes and high values for strong or -activated axes. - -Variable maps may still grow extra labels where a character, culture, or story -needs them. Do not promote a new label into the required core until it has -proved broadly useful across multiple characters or scenes. Otherwise the -schema becomes a junk drawer with a badge. - -## Underlying Organization - -| Label | Meaning | -| --- | --- | -| `self_coherence` | How integrated and stable the agent's sense of self is under pressure. | -| `contingent_worth` | How much the agent's felt worth depends on approval, utility, status, purity, or external validation. | -| `shame_sensitivity` | How painful exposure, correction, failure, or diminishment feels. | -| `reciprocity_capacity` | Ability to recognize and sustain mutual obligations rather than purely extractive or avoidant relations. | -| `mentalization_quality` | Ability to model other minds with nuance instead of flattening them into crude threat, need, or utility categories. | -| `authenticity_tolerance` | Capacity to be known without immediately retreating into performance, control, or concealment. | -| `mask_rigidity` | How necessary and inflexible the performed self is. High values mean the mask is load-bearing. | -| `external_regulation_dependence` | How much emotional stability depends on other people, institutions, substances, scripts, or external structures. | - -## Stable Dispositions - -| Label | Meaning | -| --- | --- | -| `novelty_seeking` | Attraction to new experience, strange opportunities, and unproven paths. | -| `conformity` | Preference for accepted norms, procedures, and group expectations. | -| `status_hunger` | Desire for rank, recognition, prestige, or visible superiority. | -| `risk_tolerance` | Willingness to accept danger, uncertainty, or loss for gain or freedom. | -| `sociability` | Baseline draw toward company, conversation, networks, and social energy. | -| `baseline_threat_sensitivity` | Default readiness to detect danger, exploitation, betrayal, or humiliation. | -| `aesthetic_appetite` | Sensitivity to beauty, style, taste, symbolic form, or expressive environment. | -| `ideological_rigidity` | Resistance to revising beliefs, myths, doctrines, or explanatory frames. | - -## Behavioral Dimensions - -| Label | Meaning | -| --- | --- | -| `interpersonal_warmth` | Tendency to express care, friendliness, affection, or social welcome. | -| `drive` | Goal pressure, persistence, ambition, and forward force. | -| `grandiosity` | Inflated self-importance, entitlement, exceptionalism, or self-mythologizing. | -| `validation_seeking` | Need for reassurance, approval, recognition, or confirmation of worth. | -| `anxiety` | Anticipatory fear, worry, nervous vigilance, or instability under uncertainty. | -| `control_pressure` | Urge to manage people, situations, information, or outcomes tightly. | -| `hostility` | Readiness toward anger, contempt, attack, punishment, or antagonism. | -| `suspicion` | Expectation that others hide motives, threats, traps, or bad faith. | -| `rigidity` | Difficulty adapting behavior, interpretation, or plans under new evidence. | -| `withdrawal` | Tendency to disengage, retreat, shut down, or reduce availability. | -| `volatility` | Speed and intensity of emotional swings or escalation. | -| `attachment_seeking` | Pull toward closeness, reassurance, fusion, privileged access, or being chosen. | -| `distance_seeking` | Push toward space, opacity, autonomy, and reduced emotional claim from others. | - -## Presentation Strategy - -Presentation strategy describes the self being performed. This is not identical -to voice style. It is the social face, mask, posture, or survival presentation -the agent is trying to maintain. - -| Label | Meaning | -| --- | --- | -| `charm` | Performs warmth, ease, charisma, or pleasantness to influence or smooth contact. | -| `compliance` | Performs agreement, submission, helpfulness, or nonthreatening cooperation. | -| `superiority` | Performs being above others, more competent, more refined, or less vulnerable. | -| `detachment` | Performs cool distance, emotional unavailability, or not-needing. | -| `seductiveness` | Performs desirability, invitation, or intimate leverage. | -| `competence_theater` | Performs capability and control, sometimes beyond what is actually secure. | -| `moral_theater` | Performs righteousness, purity, sacrifice, or ethical authority. | -| `strategic_opacity` | Controls what others can know; hides motives, pain, dependency, or plans. | -| `cultivated_harmlessness` | Performs being safe, small, useful, cute, or beneath concern. | -| `abrasive_boundary` | Performs difficulty, bite, or unpleasantness to keep others from pressing closer. | -| `ironic_distance` | Performs irony, detachment, or joking distance to avoid naked sincerity. | - -## Voice Style - -Voice style describes how the performed self comes out in language. The v0 -required vector covers broad communication mechanics, not only the most obvious -quirks in the current examples. - -| Label | Meaning | -| --- | --- | -| `dryness` | Understated, deadpan, low-sentiment phrasing. | -| `verbal_warmth` | Inviting, affectionate, reassuring, or socially soft phrasing. | -| `formality` | Uses formal structure, titles, careful address, or institutionally correct phrasing. | -| `verbosity` | Tends toward longer turns, elaboration, qualification, or verbal sprawl. | -| `pace` | Moves quickly through turns, interruptions, replies, or topic shifts. | -| `plainspoken_directness` | Speaks plainly, concretely, or bluntly rather than ornamenting or obscuring. | -| `lexical_precision` | Chooses exact words, distinctions, definitions, or careful terms. | -| `technical_density` | Packs speech with specialist terms, systems language, procedure, or analysis. | -| `technical_compression` | Compresses technical meaning into terse expert shorthand. | -| `figurative_language` | Uses metaphor, image, analogy, poetic compression, or symbolic framing. | -| `lyricism` | Uses musical, poetic, sensuous, or rhythmically heightened language. | -| `narrative_detail` | Explains through context, sequence, anecdote, or concrete scene detail. | -| `emotional_explicitness` | Names feelings, needs, wounds, affection, fear, or attachment directly. | -| `pointedness` | Cuts directly, sharply, or with barbed precision. | -| `self_disclosure` | Volunteers personal history, inner state, motives, or private stakes. | -| `hedging` | Softens claims with uncertainty markers, caveats, deference, or exits. | -| `certainty_marking` | Signals confidence, finality, authority, or refusal to leave claims open. | -| `politeness` | Uses courtesy, mitigation, face-saving language, or social smoothing. | -| `coded_politeness` | Uses polite phrasing to imply criticism, threat, refusal, hierarchy, or hidden meaning. | -| `ritualized_address` | Uses formulaic greetings, titles, honorifics, oaths, prayers, or ceremonial phrases. | -| `register_switching` | Shifts between speech registers depending on audience, status, danger, or role. | -| `dialect_marking` | Shows regional, class, occupational, subcultural, or community-specific speech markers. | -| `theatricality` | Performs speech with heightened drama, staging, persona, flourish, or rhetorical display. | -| `humor` | Uses jokes, wit, absurdity, teasing, or comic framing as a regular speech tool. | -| `conversational_dominance` | Takes, holds, redirects, or controls conversational floor and agenda. | -| `listening_responsiveness` | Reflects, tracks, validates, or adapts to what the other person just said. | -| `question_asking` | Uses questions to probe, invite, corner, teach, test, or keep the other person talking. | -| `profanity` | Uses taboo, vulgar, sacred, or deliberately coarse language. | - -## Derived Verbal Responses - -Defensive verbal moves are projection outcomes, not canonical labels. A renderer -can derive sarcasm, sincerity evasion, emotional evasion, banter-as-boundary, or -verbal aggression from the interaction between active state families. - -Examples: - -| Response | Common active-state pattern | -| --- | --- | -| Sarcastic deflection | High shame sensitivity, ironic distance, threat sensitivity, and exposure pressure through a dry or pointed voice. | -| Sincerity evasion | Low authenticity tolerance, high mask rigidity, strategic opacity, and low emotional explicitness. | -| Emotional evasion | High distance-seeking, withdrawal, acute shame, or control pressure with low self-disclosure. | -| Banter as boundary | High ironic distance, humor, attachment pressure, and distance-seeking in the same scene. | -| Verbal aggression | High hostility, perceived status threat, grievance activation, and abrasive boundary. | - -Treat these as target emergent behaviors for projection tests. They are useful -because the system should produce them under the right pressures, not because -they deserve their own canonical storage slot. - -## Situational State - -| Label | Meaning | -| --- | --- | -| `exhaustion` | Current depletion, fatigue, overuse, or low reserve. | -| `scarcity_pressure` | Pressure from money, supplies, access, time, space, safety, or opportunity being scarce. | -| `humiliation` | Current felt diminishment, exposure, embarrassment, or status wound. | -| `panic` | Acute fear, urgency, overwhelm, or threat response. | -| `triumph` | Current victory, vindication, high confidence, or emotional lift. | -| `grief` | Active loss, mourning, sorrow, or ache. | -| `overstimulation` | Current sensory, social, cognitive, or emotional overload. | -| `grievance_activation` | Active resentment, injustice memory, or retaliatory moral charge. | -| `acute_shame` | Immediate shame flare, exposure pain, or self-disgust. | -| `perceived_status_threat` | Current sense that rank, dignity, competence, or face is under threat. | - -## Relationship Stance - -Relationship stance is directional. A `source_id -> target_id` record describes -how the source feels and predicts the target, not a shared relationship object. -Reciprocal records can disagree. - -| Label | Meaning | -| --- | --- | -| `trust` | Expectation that the target will not exploit vulnerability or act in bad faith. | -| `respect` | Recognition of competence, integrity, status, or seriousness. | -| `resentment` | Accumulated grievance, bitterness, or unpaid emotional debt. | -| `dependence` | Need for the target's resources, care, access, protection, or recognition. | -| `fear` | Expectation that the target can or will cause harm. | -| `fascination` | Captivation, curiosity, attraction, fixation, or unresolved interest. | -| `obligation` | Felt debt, duty, promise, or responsibility toward the target. | -| `envy` | Pain around what the target has, is, receives, or represents. | -| `moral_disgust` | Aversion rooted in perceived violation, corruption, cruelty, or wrongness. | -| `perceived_status_gap` | Felt difference in rank, leverage, dignity, or social position. | -| `expectation_of_care` | Belief that the target may protect, soothe, support, or choose the source. | -| `expectation_of_betrayal` | Belief that the target may abandon, expose, exploit, or turn. | - -## Cat Fixture Policy - -Cat's example fixture currently includes all required core labels for Cat and -Oz. It is not a sparse profile of only traits that apply to them. - -That is deliberate for v0: - -- complete vectors make comparison and validation easier -- low `mean` values are meaningful -- low `current_activation` values tell the renderer not to emphasize a variable - -Later, Ghostlight may support sparse authoring overlays for convenience. The -canonical fixture should remain explicit until we have enough tooling to avoid -silent defaults becoming accidental canon. - -## Event Interpretation - -Events may carry three optional interpretation layers: - -| Field | Meaning | -| --- | --- | -| `observed_exchange` | What was externally observable: who acted or spoke, what they seemed to do, and the visible cues. | -| `private_interpretations` | How each participant appraised the event from their own partial state. | -| `event_effects` | The proposed consequences: state deltas, new beliefs, or memory updates caused by the event. | - -These fields are immediate scaffolding for projection. They do not yet define a -complete transition engine. For now, they make important scene history legible -enough that a prompt projector can explain why a later line bends toward trust, -evasion, curiosity, fear, or repair. diff --git a/docs/architecture/canonical-agent-state-schema.md b/docs/architecture/canonical-agent-state-schema.md deleted file mode 100644 index c75ec57..0000000 --- a/docs/architecture/canonical-agent-state-schema.md +++ /dev/null @@ -1,244 +0,0 @@ -# Canonical Agent State Schema - -Ghostlight's first runtime organ is a state contract, not a generator. - -The schema lives in: - -- `schemas/agent-state.schema.json` -- `schemas/agent-state.required-fields.json` - -The first example lives in: - -- `examples/agent-state.call-of-the-void.json` - -The label and numeric glossary lives in: - -- `docs/architecture/agent-state-variable-glossary.md` - -## Objective - -The schema defines the minimum state Ghostlight needs before it can safely build -prompt projection, dialogue scaffolding, classifier records, or procedural -drama. - -The core rule is unchanged: - -- canonical state is what the world treats as true -- perceived state is what a specific observer thinks is true -- dialogue context packs are character-local projections for one speaker in one - scene - -If these layers collapse into each other, the machine turns back into one -omniscient narrator with a pocket full of vibes. This is a known industrial -hazard. We are wearing goggles now. - -## State Families - -Each agent has: - -- `identity` -- `canonical_state` -- `goals` -- `memories` -- `perceived_state_overlays` - -`canonical_state` is split into: - -- `underlying_organization` -- `stable_dispositions` -- `behavioral_dimensions` -- `presentation_strategy` -- `voice_style` -- `situational_state` -- `values` - -Each canonical scalar-like dimension is represented as: - -```json -{ - "mean": 0.5, - "plasticity": 0.5, - "current_activation": 0.5 -} -``` - -This keeps baseline, change rate, and scene activation separate. -A person can be dispositionally suspicious without being maximally suspicious -in every scene. A person can be highly activated right now without rewriting -their whole soul because someone coughed near a status wound. - -Canonical variables do not include confidence or certainty. Perceived variables -do not expose canonical `mean` or `plasticity`; they store observed activation, -attributed disposition, and confidence. - -For full meanings of canonical `mean`, `plasticity`, `current_activation`, -perceived attribution fields, and every required v0 label, see -`docs/architecture/agent-state-variable-glossary.md`. - -## Required First-Class Dimensions - -`schemas/agent-state.required-fields.json` names the required core variable -families. The validator enforces those fields for canonical agent state and -relationship stance. - -The required core is not exhaustive. It is the shared comparison surface. A -character fixture currently includes all required labels, even when many are low -or inactive, so downstream tooling can compare agents without guessing whether a -missing value means "not applicable," "forgotten," or "quietly eating the -floorboards." - -The behavioral dimensions include the known must-not-drop set: - -- `volatility` -- `attachment_seeking` -- `distance_seeking` - -Those are not garnish. They are load-bearing social handles. - -## Presentation, Voice, And Response - -`presentation_strategy` describes the self being performed. - -That can include charm, detachment, competence theater, cultivated -harmlessness, or deliberately performing someone who is abrasive or difficult. -Sometimes that abrasive performance is not random meanness. It is a boundary, -a threat display, a way to prevent intimacy, or a test to see who flinches. -Human beings are regrettably efficient little porcupines. - -`voice_style` describes how that performed self comes out in language. - -The required voice handles are: - -- `dryness` -- `verbal_warmth` -- `formality` -- `verbosity` -- `pace` -- `plainspoken_directness` -- `lexical_precision` -- `technical_density` -- `technical_compression` -- `figurative_language` -- `lyricism` -- `narrative_detail` -- `emotional_explicitness` -- `pointedness` -- `self_disclosure` -- `hedging` -- `certainty_marking` -- `politeness` -- `coded_politeness` -- `ritualized_address` -- `register_switching` -- `dialect_marking` -- `theatricality` -- `humor` -- `conversational_dominance` -- `listening_responsiveness` -- `question_asking` -- `profanity` - -Behavioral warmth and verbal warmth are intentionally separate: - -- `behavioral_dimensions.interpersonal_warmth` is the tendency to offer care, - welcome, or affiliation. -- `voice_style.verbal_warmth` is the language surface that can sound soft, - reassuring, affectionate, or socially inviting. - -So Cat's prickliness is not only a dialogue prompt instruction. It is backed by -canonical state: - -- high `presentation_strategy.abrasive_boundary` -- high `presentation_strategy.ironic_distance` -- high `underlying_organization.shame_sensitivity` -- high `underlying_organization.mask_rigidity` -- high `behavioral_dimensions.distance_seeking` -- high `behavioral_dimensions.suspicion` -- high `situational_state.acute_shame` when exposed - -The renderer derives defensive speech from those intersections plus voice -style. A dry, pointed voice under shame and exposure pressure may produce -sarcastic deflection; the schema does not store sarcasm-as-defense as its own -canonical organ. - -Sarcastic deflection, sincerity evasion, emotional evasion, -banter-as-boundary, and verbal aggression remain target emergent behaviors for -projection tests. - -## Perceived State - -Perceived overlays are observer-specific. They do not replace canonical state. - -An overlay records: - -- observer -- target -- perceived dimensions, including observed activation and attributed disposition -- beliefs -- distortions - -This is where misunderstanding lives. Suspicious agents can overread threat. -Attachment-hungry agents can overread interpersonal warmth. Avoidant agents can -underread care. Fundamental attribution bias also lives here: an observer can -mistake exceptional behavior for stable character. None of that requires -corrupting the canonical state. - -Relationship stance is directional. If Cat has a relationship record toward Oz, -Oz needs a separate record toward Cat. Mutual presence does not imply symmetric -trust, fear, obligation, dependence, or expectation of betrayal. - -## Event Interpretation - -Events can include optional interpretation scaffolding: - -- `observed_exchange` for externally visible action or dialogue -- `private_interpretations` for each participant's appraisal of what happened -- `event_effects` for proposed state deltas, belief creation, and memory updates - -This is not a full social transition engine yet. It is enough structure for the -projection layer to know what an event changed without asking later prompts to -infer everything from a one-line summary and a bad attitude. - -## Dialogue Context Packs - -Scenes contain `dialogue_context_packs`. - -A pack is a character-local prompt payload for one speaker. It includes: - -- speaker-local truth -- speaker beliefs -- active memories -- active goals -- presentation constraints - -The point is not to make the dialogue generator smarter by shouting plot at it. -The point is to keep each character inside their own partial reality. -Packs are positive-context payloads: if the speaker should not know something, -it is not included. Secrets the speaker does know but wants to withhold belong -in goals, memories, beliefs, and presentation constraints. - -Ghostlight can build the trap. The character projection decides how the person -inside the trap breathes. - -## Current Validation - -The first validator is intentionally small and dependency-free: - -- `tools/validate_agent_state.py` - -It does not implement all of JSON Schema. It checks the invariants Ghostlight -currently cares about: - -- example files parse as JSON -- schema versions match -- agent IDs are unique -- required canonical variable groups are present -- required relationship stance fields are present -- state variable components stay in `0..1` -- goals, memories, relationships, scenes, and dialogue context packs reference - existing IDs -- dialogue packs carry speaker-local context without requiring negative - author-only fences - -This gives us a real seam before we build the prompt renderer. Not perfect. -Useful. We are allowed to be both. diff --git a/docs/architecture/corpus-coverage-ledger.md b/docs/architecture/corpus-coverage-ledger.md deleted file mode 100644 index ba49d87..0000000 --- a/docs/architecture/corpus-coverage-ledger.md +++ /dev/null @@ -1,81 +0,0 @@ -# Corpus Coverage Ledger - -The corpus coverage ledger is the project-level index for accepted and planned -Aetheria training fixtures. - -Its job is not to store story content. Its job is to keep the corpus honest: -which factions, movements, flashpoints, timeline lanes, tonal modes, collision -axes, review states, and item/economy hooks are represented, and which are still -missing. - -## Live Files - -- Ledger: `state/corpus-coverage.json` -- Schema reference: `schemas/corpus-coverage.schema.json` -- Validator/status tool: `tools/validate_corpus_coverage.py` -- Command: `npm run coverage:status` - -## Entry Contract - -Each fixture entry records: - -- `fixture_id`: stable fixture handle. -- `status`: `planned`, `draft`, `accepted_as_draft`, `accepted`, - `needs_revision`, `rejected`, or `superseded`. -- `timeline_lane`: `historical_grounded`, `transition_grounded`, or - `future_branch`. -- `canon_status`: single-history, branch-local, promoted branch, template, or - draft status. -- `story_type`: founding-era, day-in-the-life, flashpoint, movement, - future-branch, or trade-life story. -- `primary_subjects` and `secondary_subjects`: factions, movements, - institutions, species/body groups, or other represented subjects. -- `collision_axes`: the pressures the fixture exercises, such as law, labor, - care, class, logistics, species/body affordance, trade, memory, personhood, - technology, legitimacy, or infrastructure. -- `tonal_modes`: prose modes the fixture contributes to the corpus. -- `training_targets`: organs or reference surfaces this fixture is relevant to. -- `training_usability`: explicit per-stage declaration of whether the fixture - is `training_ready`, `reference_only`, or `not_training_data`. -- `artifacts`: paths to fixture files. -- `review`: status of schema, narrative, lore, spatial, visual, and IF review. -- `economy_hooks`: item, assembly, trade-good, supply-chain, or tech hooks. -- `open_lore_gaps`: blocking or useful gaps discovered during generation. - -## Acceptance Rule - -An accepted or accepted-as-draft fixture must have the core artifact refs: - -- lore digest -- agent state -- coordinator artifact -- Ink file -- training sidecar - -It must also carry review fields for schema, narrative, lore, spatial, visual, -and IF artifact review. A fixture may still be accepted-as-draft with review -caveats, but the caveats should be visible instead of hidden under the nice rug. - -Coverage status is not training readiness. A fixture that looks good as a story -can still be unusable for a model stage if it lacks exact input/output receipts, -raw outputs, reviewer decisions, hidden-context audits, or mutation records in -the shape that stage requires. The ledger should be rude about this. If a -fixture is only a reference for story shape or grounding, mark it -`reference_only`; do not promote it by implication. - -## Report Shape - -`npm run coverage:status` validates the ledger and prints: - -- total entries and accepted count -- progress toward the 100-150 broad target -- status, timeline lane, story type, collision-axis, tonal-mode, and subject - counts -- training-usability counts -- major-power founding/day-in-life candidates when present -- basic gap signals, such as missing future-branch coverage or no day-in-life - stories yet - -This is deliberately a coarse instrument. It should tell us where to point the -next fixture without pretending to be a corpus scientist in a lab coat made of -spreadsheet tabs. diff --git a/docs/architecture/cultnet-shared-agent-state-contract.md b/docs/architecture/cultnet-shared-agent-state-contract.md deleted file mode 100644 index b96e28e..0000000 --- a/docs/architecture/cultnet-shared-agent-state-contract.md +++ /dev/null @@ -1,98 +0,0 @@ -# CultNet Shared Agent-State Contract - -Ghostlight owns the first cross-runtime agent-state payload contract. - -That contract is not a new ontology. It is the existing Ghostlight state shape -moving over a wire without turning into bespoke JSON fog in every other repo. - -## Canonical Payload - -The first shared payload contract is: - -- schema id: - `https://github.com/GameCult/Ghostlight/schemas/agent-state.schema.json` -- schema version: - `ghostlight.agent_state.v0` -- canonical file: - `schemas/agent-state.schema.json` - -This is the same state shape already used for Ghostlight fixtures and the same -top-level shape Epiphany role dossiers adopted. The contract is: - -- `world` -- `agents` -- `relationships` -- `events` -- `scenes` - -If another runtime wants to carry socially persistent agent state without -inventing its own private folk religion, this is the first house shape. - -## Wire Envelope - -CultNet should carry the Ghostlight payload as a typed document replication -message, not as a one-off ad hoc blob. - -Current expected document envelope: - -- `documentType`: `ghostlight.agent-state` -- `documentKey`: runtime-defined stable key -- `payloadSchemaVersion`: `ghostlight.agent_state.v0` -- `payload`: exact Ghostlight state document - -The current TypeScript client library is: - -- package: `cultnet-ts`, in `GameCult/CultLib` under `packages/cultnet-ts` - -Its job is not merely to make pipes pretty. It owns: - -- direct-pipe MessagePack framing -- typed message contracts -- authentication/session semantics compatible with CultLib's `GameCult.Networking` -- typed replication into CultCache-compatible stores - -## Authentication Story - -CultNet inherits the useful security shape from CultLib: - -- a shared connection key known to client and server/runtime peers -- AES-GCM encrypted auth/session payloads derived from that key -- a server-side session-signing secret -- signed session tokens used for verify/reconnect flows - -This matters because "shared agent state" is not only a serialization problem. -It is also a trust boundary problem. We want one family resemblance across C#, -TypeScript, Rust, and Python instead of four mutually unintelligible little -shrines to local convenience. - -## Contract Discipline - -Ghostlight remains the source of truth for the payload shape. - -That means: - -- if `schemas/agent-state.schema.json` changes, CultNet mirrors must update in - lockstep -- consumers may add local document metadata around the payload, but should not - silently mutate the payload contract itself -- if a runtime needs a narrower projection or local working view, that is a - derivative contract, not a revision of `ghostlight.agent_state.v0` - -The rule is simple: - -- prompt projection may differ -- storage engines may differ -- language bindings may differ -- the shared payload contract does not drift just because another repo got - lonely - -## Immediate Consumers - -The first intended consumers are: - -- Ghostlight fixture/state tooling -- EpiphanyAgent role dossiers and heartbeat-adjacent agent state -- VoidBot companion-state and social memory machinery where the full Ghostlight - payload is useful - -More bindings can come later. They do not get to invent a prettier truth. diff --git a/docs/architecture/ghostlight-dungeon-multiplayer-intention.md b/docs/architecture/ghostlight-dungeon-multiplayer-intention.md deleted file mode 100644 index 27c3c51..0000000 --- a/docs/architecture/ghostlight-dungeon-multiplayer-intention.md +++ /dev/null @@ -1,141 +0,0 @@ -# Ghostlight Dungeon Multiplayer Intention - -## Status - -Bounded cooperative multiplayer is implemented in the current MVP: one to -eight authenticated players create and seed a world (`world.create` v2, -`world.seed`) and begin in one shared scene with sequential public actions, -actor-filtered surfaces, pooled Persona-cell entitlements, and unanimous time, -travel, and budget governance. -The broader model in this document remains the direction for split parties, -private play actions, simultaneous declarations, delegation, and PvP. - -The existing simulation is already shaped around multiple bounded actors. The -extension should expose that anatomy to multiple human controllers without -creating a second world authority or a special multiplayer simulation loop. - -## Objective - -Let several human-controlled characters inhabit one persistent campaign while -preserving the same spatial, epistemic, causal, and commit invariants as solo -play. The implemented milestone keeps the party together. Split locations, -late joining, and private in-play actions remain future governance work. - -## Authority map - -- **Owner:** one per-campaign `WorldKernel` continues to own canonical state, - fictional time, revisions, rolls, events, and commits. -- **Inputs:** authenticated commands attributed to one campaign member and one - exact human-controlled actor; NPC and Gestalt proposals; scheduler commands; - current campaign and resolution revisions. -- **Outputs:** one atomic world transition plus actor-specific perceived events, - narrative projections, news access, and command receipts. -- **Derived state:** party rosters, shared transcript views, presence indicators, - ready state, and client notifications are projections of campaign membership, - occupancy, perception, and committed events. -- **Forbidden writers:** browsers, sessions, party leaders, Personas, - Interpreters, narrators, initiative, and realtime transports cannot commit or - repair campaign state. -- **Shared path:** solo commands, bounded multiplayer commands, unanimous waits - and travel, NPC reactions, scheduler ticks, and reconnects use the same - `WorldCommand → validate → atomic commit` primitive. Future simultaneous - windows must join this path too. -- **Cut line:** do not add a parallel room-state store, party prompt, shared - narrator memory, or multiplayer-only mutation path. - -## Intended model - -```text -Player A session ──> actor A command ─┐ -Player B session ──> actor B command ─┼─> campaign mailbox -NPC / Gestalt proposals ──────────────┘ │ - v - WorldKernel - │ - one committed event + revision - │ │ - A-perceived projection B-perceived projection - │ │ - A's surface B's surface -``` - -A human-controlled actor differs from a Persona-controlled actor only in the -source of its candidate action. Human text still describes an attempt. It does -not bypass capability, location, custody, knowledge, opposition, assessment, -initiative, or commit validation. - -## Invariants - -- Every active canonical subject is represented exactly once in the resolution - cover regardless of how many humans are connected. -- One authenticated campaign member controls one or more explicitly assigned - actors according to campaign policy. Control is never inferred from scene - presence. -- An absent or disconnected player's character is not puppeted. Delegation or - Persona proxying requires an explicit, revocable campaign permission. -- Perception and knowledge remain actor-local. A shared party transcript may - contain only events all included viewers are permitted to perceive. -- Private speech, hidden action, secret evidence, and character-local news are - projected only to entitled sessions. -- Players in different locations receive different narrative streams derived - from the same committed world. -- A player cannot make another player's action, reaction, injury, belief, or - relationship true by describing it. -- Simultaneously submitted incompatible attempts resolve from one snapshot and - one deterministic initiative/conflict pass. Arrival order at HTTP or CultNet - transport is not fictional initiative. -- Each active member contributes the allowance returned by the entitlement - port. The campaign pool is capped by the operator ceiling of 240. Human - actors occupy mandatory cells without Persona inference; provider request - concurrency remains independent of the chosen cover. -- Reconnect and replay derive the player's view from committed receipts and - perception rules. A client cache cannot repair or override the kernel. -- One malformed, stale, or unauthorized participant proposal cannot partially - mutate the shared world. - -## Social policy still to design - -The architecture makes shared worlds straightforward. A usable multiplayer -game still needs explicit answers for: - -- exclusive character control, temporary delegation, and permanent departure; -- host powers over invitation, removal, reset, fork, export, and campaign policy; -- asynchronous pacing and how much fictional time one active player may advance; -- simultaneous declaration windows for conflict, stealth, and split scenes; -- consent for player-versus-player persuasion, deception, theft, restraint, - injury, extraordinary influence, and character death; -- disclosure of hidden rolls, private messages, secrets, and retrospective logs; -- moderation, blocking, reporting, and campaign-data deletion; -- mixed privacy/provider lanes and whether one campaign may contain them; -- campaign billing, seats, guests, and ownership transfer. - -These are campaign-governance decisions, not browser affordances. They must be -typed, persisted, inspectable, and enforced at command admission. - -## Product sequence - -1. Prove the solo loop and multiresolution setting agency. **Complete.** -2. Add campaign membership and exact actor-control assignments. **Complete.** -3. Support up to eight cooperative players in one scene with actor-specific - output and unanimous group governance. **Complete in this milestone.** -4. Support split locations, private communication, departure, and late joining. -5. Add snapshot-bound simultaneous declaration windows. -6. Admit adversarial actions only after consent and governance policy is typed - and tested. - -The first multiplayer acceptance target should be cooperative and small. The -runtime should earn social complexity one invariant at a time. - -## Acceptance direction - -- Two players in one scene see one committed event and their own permitted - interpretations. -- A private fact learned by one player never appears in the other's projection. -- Split players can act in different locations without duplicating geometry, - actors, clocks, or institutions. -- Concurrent incompatible attempts resolve once from the same revision. -- A disconnected player remains unpuppeted while world clocks and remote agency - continue under campaign policy. -- Rejoining reconstructs the player's permitted continuity from exact receipts. -- Gestalt merge, split, migration, and named-member rematerialisation remain - correct while several human actors create simultaneous foreground pressure. diff --git a/docs/architecture/ghostlight-dungeon-session-zero.md b/docs/architecture/ghostlight-dungeon-session-zero.md deleted file mode 100644 index 0c170f0..0000000 --- a/docs/architecture/ghostlight-dungeon-session-zero.md +++ /dev/null @@ -1,333 +0,0 @@ -# Ghostlight Dungeon Session Zero and Bounded Co-op - -## Status - -Teardown evidence, not a live authority map. The `SessionZeroKernel`, the -compiler, the preview and contract-review organs described below exist in no -committed source. World creation is `world.create` on the sealed kernel; seed -authoring is plan step 8, the seed producer: a Draft-phase authoring session -that admits `AdmitPatch` seeds as the owner for approval before activation -(`notes/ghostlight-implementation-plan.md`). Read this document only for the -co-op intent and the rejected compiler shape. - -## Owners - -### SessionZeroKernel - -`SessionZeroKernel` owns one persistent draft mailbox and its revisions. Its -MessagePack CultCache store contains the roster, single-use invitations, -shared/private channels, messages, contract, private character drafts, -boundaries, decisions, approvals, DM Persona, evidence coverage, compilation -preview, and publication receipt. - -The store keeps two deliberately different model-receipt collections. The -inference audit contains every committed invocation, including two calls whose -semantic receipt hashes match but whose latency or provider-attempt telemetry -differs. The active-preview proof set contains only the compiler transaction -that produced the currently retained preview. Replacing or retiring a preview -clears that proof set without erasing the audit. A campaign publication carries -only the active proof set; historical DM turns and superseded compiler runs do -not become evidence for a seed they did not produce. - -Player messages are durable conversation, not campaign facts. Projector, DM -Persona, Interpreter, retrieval, and compilation stages return proposals. Only -the kernel may change the draft. - -Private DM channels use character-component and channel epochs. Independent -private turns can finish in parallel even if an unrelated private component -commits first. Shared changes serialize through the shared epoch. No output is -rebased. - -### WorldKernel - -`WorldKernel` receives nothing while Session Zero is drafting. Publication -builds a new campaign store in a private staging directory. Campaign seed, -membership, contract, governance, DM Persona, approved brief, approval digests, -Vault evidence, and model receipts enter one empty CultCache batch. The -directory becomes discoverable only after the batch succeeds. - -Publication is idempotent by the approved seed digest. Repeating the same -publication recovers the campaign. Reusing the campaign ID for a different -digest is rejected. - -## Privacy membrane - -Shared DM inference receives the shared contract, aggregate boundary policy, -public party cards, shared decisions, evidence coverage, and recent shared -messages. It cannot receive raw boundaries, another player's private draft, or -private messages. - -Private DM inference receives the shared contract, aggregate policy, public -party cards, that player's character draft, that player's attributed -boundaries, visible decisions, and recent messages from that private channel. -It cannot receive another player's private state. - -Account hashes and invite-token hashes remain private persistence fields. They -are absent from JSON Schemas, browser projections, CultMesh surfaces, and model -contexts. Actor-specific campaign surfaces use random campaign member IDs and -the exact assigned actor. - -The structured Projector and Interpreter receive their exact stable JSON -Schema before any dynamic context. OpenAI-compatible JSON-object modes -constrain syntax but do not communicate the application schema by themselves. -The DM Persona owns the natural utterance. The Interpreter's model-facing -schema has no speech field: it emits only new typed proposals and reply -affordances, after which the runtime binds the Persona output losslessly into -the proposed kernel delta. It cannot rewrite, summarize, or truncate the -Persona while extracting state. The kernel still treats the three stages as -one atomic proposal; an invalid Interpreter commits neither speech nor state. - -The Interpreter receives only the current contract, its channel and member -scope, the entitled private character when applicable, unresolved material -decisions, and the exact Persona response. Non-material opening and role cards -remain renderer-visible suggestions but never enter Projector or Interpreter -cognition unless the player explicitly selects or discusses one. Transcript windows, evidence coverage, -boundaries, and public-party narrative already served their purpose in the -Projector and are not replayed into extraction. It cannot restate existing -draft fields or unresolved decisions as new proposals. Stable schema-first -prefixes preserve provider cache reuse. Empty, malformed, schema-invalid, or -stale outputs cannot change the typed draft. If both same-snapshot attempts -fail, the kernel may append a fixed local DM notice to the conversation while -leaving contract, characters, decisions, boundaries, approvals, and model -receipts unchanged. - -Every player-triggered Session Zero model task enters the same live-inference -priority gate as campaign play. This includes opening and role suggestions, DM -turns, counter replacements, and world compilation. Entering the gate cancels -an in-flight strategic model wave before it can commit and prevents new -background inference from launching until the interactive task leaves. A quiet -campaign cannot consume provider concurrency while a player is waiting at the -table. - -One Interpreter turn has one owner per typed lane. A shared turn may directly -edit the draft contract or offer a contract decision, never both; a private turn -may directly edit the ordinary character draft or offer a character-patch -decision, never both. An extraordinary-permission bargain is a separate consent -lane, so it may accompany a direct mundane character patch without being -silently granted. The model-facing schema requests a same-snapshot correction for a -split-lane output, and the kernel repeats the invariant before mutation. - -Decision metadata is not part of the general Interpreter's ontology. Its -schema carries only the prompt, proposed resolution, and one or more typed -semantic payloads. The Director assigns a fresh durable decision ID, exact -private-channel owner (or shared ownership), material status, and clean -lifecycle state. Extraordinary-permission proposals similarly contain terms -only; Ghostlight assigns the permission ID and binds the exact entitled actor. -Model output cannot reuse a decision ID, target another actor, replace an -existing permission by guessing its ID, or claim evidence custody. Focused -counter replacement preserves the already committed permission identity while -allowing only its negotiated terms to change. - -Generated opening and role suggestions are non-material decisions: the player -may accept, counter, discuss, or ignore them without blocking a fully custom -draft. They are UI affordances, not implicit DM memory. On daemon load, the registry demotes pre-cut payloadless questions and -generated opening records whose old `material` flags would otherwise veto a -custom draft. A payloadless question cannot own compilation readiness because -it has no typed change to accept. This migration uses an exact CultCache -replacement and does not advance the Session Zero revision or shared epoch. -Material decisions preserve the distinction between discussion and consent. -Every acceptable decision carries at least one non-empty typed contract, -character, or extraordinary-permission payload. A question or a prose promise -without an exact state change remains DM speech or a suggested reply; it cannot -render an Accept control, advance the draft through acceptance, or claim that -the promised materialization occurred. The Interpreter schema enforces the -payload before correction/retry, and the kernel rejects any legacy payloadless -decision that reaches acceptance. -The actor-filtered Eve projection shows that exact payload beside the DM's -explanation before exposing Accept. Its private character ledger projects every -player-entitled draft field, including history, secrets, knowledge, equipment, -relationships, goals, and the complete terms of extraordinary permissions. -Prose explains a bargain; the visible typed payload is the state the player is -actually consenting to. -Character patches are reversible during negotiation. Every list supports exact -removals before additions, and relationship keys support exact removal before a -replacement is installed. This permits spelling, identity, and mistaken-ledger -corrections without duplicate private subjects or transcript replay. -Accept applies only the exact typed payload currently stored in the decision. -Counter preserves that payload as an inert, visible audit and replacement -basis, records the player's text in the decision's durable channel, marks the -unresolved decision as awaiting a DM replacement, and invalidates the affected -projection epoch. `pending_counter` removes the Accept surface and makes the -retired payload uncommittable. The DM response -must produce a fresh material decision against that same channel and component -epoch; installing it and retiring the pending counter is one kernel commit. -Until then the old decision has no Accept surface and forged acceptance fails. -Inference failure, an irrelevant response, or a stale response leaves the -counter unresolved and compilation blocked. -Retry relaunches the membrane from that already persisted counter and unchanged -Session Zero snapshot. It does not ask the player to retype the counter, append -a duplicate message, or advance revision merely to try inference again; only a -later kernel-validated replacement changes state. -The countered decision ID is also part of the model snapshot binding and -permitted turn context. A deterministic Ghostlight Projector renders that one -pending decision, its retired typed payload, exact counter, and aggregate safety -policy into the Persona's narrative stream. This exact projection needs no -model call or model receipt; the focused turn records only Persona and -Interpreter inference. The Interpreter separately receives the same bounded -typed basis. When the retired proposal still has one exact typed lane, the -Interpreter emits only that replacement payload: character patch, contract -patch, or permission terms. Ghostlight binds the fresh decision ID, owner, -materiality, evidence, prompt, and persisted counter locally. Permission IDs, -actor bindings, and evidence receipts are preserved from the retired proposal -and are absent from the model's output authority. The larger union Interpreter -remains only for ordinary conversation and pre-cut payloadless migration. -Conversation history, party -cards, the contract, unrelated decisions, and unrelated private character state -are not part of the focused retry. Pre-cut decisions whose typed payload was -erased receive one bounded current-state basis for migration only. The kernel -accepts exactly one same-lane replacement with stable extraordinary-permission -identity; direct patches or unrelated decisions cannot retire the counter. - -## Approval and publication - -The host locks the roster before compilation. Material unresolved decisions -block compilation. The kernel also refuses a conversation-only draft: the -typed contract must identify premise, canon horizon, start, pressure, goal, -tone, pacing, consequences, narrative focus, and DM style; every active -character must have a public premise, capability, goal, and at least one -obligation or vulnerability. Group drafts additionally require a party bond. -The compiler receives an `approved_campaign_brief.v1`, not -the transcript. Private character history and secrets are withheld from world -generation; after the grounded seed validates, Ghostlight locally replaces the -provisional compiler player with the exact approved actors at one shared start. -Approved relationships cross that membrane by identity, not by free-form map -key. A relationship naming another approved player resolves to that player's -exact actor ID. An otherwise unresolved named person receives a stable, -server-generated relationship-anchor actor ID; the compiler must materialize -that exact actor and name in the seed, but it never receives the private -relationship description and may not reveal the anchor in opening narration -merely because the private ledger requires their existence. The owning player -sees the compiled subject, placement, and relationship during private review. -Their final approval therefore covers the compiler's placement without -exposing it to the table. Actors may also hold directional relationships to an -exact institution, Gestalt, or named Gestalt member. Such a relationship grants -no knowledge, resource, membership, or collective authority. -If compilation fails before a preview is installed, the roster remains locked -and the typed brief remains authoritative. A host whose current brief still -passes the readiness gate receives the Compile action again; retrying uses the -new revision and never replays or accepts transcript prose. - -Evidence gaps return the draft to conversation with explicit questions. A -gap-bearing compiler result is retained as an exact non-canonical preview while -the session remains in `drafting`. The host may move that exact digest into -review, or the table may revise typed state and retire it before another -compile. Moving it to review is not approval. Every active player must approve -the current shared digest, their current private character digest, and the -exact world-preview digest containing topology, cast, institutions, -populations, clocks, evidence lanes, gaps, and branch-local assumptions. -Publication persists the approved preview digest and exact accepted gap and -assumption lists beside the campaign seed. Substituting any preview makes every -prior approval stale. Relevant edits retire the preview and invalidate the -affected approvals. The host has no override. - -Pre-cut Session Zero stores used one receipt list for both meanings. Registry -load migrates that list without advancing Session Zero revision or fictional -time: all entries become audit history, while an extant world-seed preview -receives the bounded final compiler transaction from its last -`custom_retrieval_plan` through `agency_compile` as its exact proof set. Later -conversation receipts and Contract Review previews are excluded. The migration -is an atomic CultCache replacement and is idempotent on restart. - -Accepted extraordinary bargains become typed permissions. Later assessment -receives their exact scope, prerequisites, costs, limits, exposure, evidence, -and effect ceiling. - -## Bounded co-op - -`campaign_membership.v1` binds authenticated account hashes to random member -IDs and exact actor IDs. HTTP admission derives the acting actor from this -record. Assessment confirmation includes that actor ID and cannot consume -another actor's assessment. - -The first co-op mode deliberately permits one shared scene and sequential -public actions. It rejects player-versus-player state mutation, movement that -would split the party, raw unilateral waits, and unilateral resolution-budget -changes. Time, group travel, and pooled Persona-cell budget changes use -revision-bound proposals; the final approval and campaign transition commit -atomically. Group travel revalidates the shared origin and exact route, moves -every assigned actor, and advances time in one world commit. - -Every human-controlled actor has a non-simulatable agency profile. Live NPC -appraisal, multiresolution cells, strategic outcomes, migration, scheduler -ticks, and away-time work all exclude those actors from Persona control and -direct mutation. Disconnection grants no proxy authority. - -Each active member contributes their entitlement-provided cell allowance. Test -accounts currently contribute eight. The campaign starts at the pooled total, -capped at 240; physical provider concurrency remains independent. - -## Realtime and interface - -Ghostlight publishes an actor-filtered Eve surface for each Session Zero member -and campaign member. Server-sent events contain revision notifications only. -The browser refetches the authoritative Eve document after a notice; the -transport owns no messages, drafts, ledgers, approvals, or world state. - -The browser exposes keyboard-operable shared/private channel tabs, live status, -public party cards, private ledgers and boundaries, unresolved decisions, -roster readiness, and explicit compile/review/approve/publish actions. The Eve -review tree visibly renders topology, non-private cast, institutions without -private goals or resources, populations, clocks, evidence-use rationales, -gaps, and branch assumptions. Relationship-anchor people remain absent from -the shared cast and appear only in their owner's private relationship card. -Privacy is labeled in text and never conveyed only by color. -The host may discard any non-canonical preview through a typed Session Zero -command and continue drafting without changing the contract, characters, or -fictional time. A retained preview never traps the table into reviewing it. - -Session Zero also remains the sole owner of every human-controlled character. -The shared compiler may use player-approved public names and premises as world -context, but those names are reserved: neither ordinary cast nor Gestalt member -output may materialize them. Its singular player document is only a provisional -starting-position marker. After compilation, Ghostlight removes that marker and -installs the approved typed characters. A candidate that duplicates a reserved -player identity is corrected against the same snapshot or rejected atomically. - -An approved unresolved relationship person crosses world compilation as a -server-owned identity anchor. The shared world compiler never receives that -person's name, identity handle, or relationship. After the public topology is -validated, a separate private stage receives the approved name and exact -available locations and must synthesize exactly one ordinary actor candidate. -It remains responsible for that person's location, capabilities, knowledge, -equipment, obligations, and goals, but cannot emit IDs, relationships, -narration, facts, gaps, assumptions, or public-world changes. The compiler then -attaches the opaque canonical ID locally and the approved relationship is added -only to its owner's actor. Omission, ambiguity, unknown placement, or ID -collision rejects the whole candidate. Shared output cannot leak private input -that its owning model never received. - -## Inline grounded suggestions - -Opening and role generation is no longer a browser-owned creation flow. On a -new draft, the compiler retrieves three distinct Vault-grounded opening -suggestions and installs them as shared typed decisions. Accepting one amends -the draft for further discussion; it does not publish a world. Ghostlight then -retrieves three grounded role suggestions and installs separate typed decisions -in each player's private channel. A custom premise uses the same conversation, -draft, approval, and compiler path. - -## Contract Review - -A launched campaign can enter a focused Contract Review backed by the same -Session Zero kernel and privacy projections. The review is bound to the exact -world revision at which it began. Any intervening world commit makes it stale. -Every active member approves the revised shared digest and their own character -digest before the host can publish. - -Publication updates the existing campaign, contract, membership permissions, -DM Persona, approved brief, governance epoch, actors' approved forward-looking -ledger fields, event, and receipt in one CultCache batch. It cannot change -membership custody, locations, topology, knowledge, memories, historical -events, Vault, canon horizon, or established starting geometry. Tightened -private boundaries publish immediately as an anonymous strictest campaign -policy; relaxation waits for unanimous review publication. Narration, action -assessment, resolution demand, cell Projectors, Interpreters, and semantic -verification receive the approved contract and aggregate policy. Actor Personas -still receive only lived narrative, not policy schemas or attributed safety -records. - -## Deferred governance - -Split parties, private in-play actions, simultaneous declarations, PvP, -delegation, late joining, permanent post-publication departure, group -fork/reset/export, and voice remain unsupported. diff --git a/docs/architecture/ghostlight-multiresolution-agency.md b/docs/architecture/ghostlight-multiresolution-agency.md deleted file mode 100644 index d91889d..0000000 --- a/docs/architecture/ghostlight-multiresolution-agency.md +++ /dev/null @@ -1,936 +0,0 @@ -# Ghostlight Multiresolution Agency Graph - -Status: teardown evidence. Describes the pre-rebuild resolution cover, -strategic waves, demand/deficit elaboration, and the wave-level outcome -resolver, all on the deletion line. The current vocabulary is -`docs/architecture/ghostlight-world-ontology.md`. It keeps the resumable -per-jurisdiction elaborator session, compact mutation drafts, the complete -deterministic mismatch set, the authored `WorldScaleIntent` and its -deterministically derived deficit, the budgeted connected cover with singleton -detail focus and grouped coarse cells, debt rotation, and deterministic clocks -that advance regardless of attention. Detail first, then the ten-percent choke, -is the operator's design and survives. It drops gestalt as identity: -`GestaltPersonaState`, member deltas, arena knowledge union, fission as a scale -loop, promotion and folding, and cover-completeness targets. - -## Objective - -Let a campaign contain the whole strategic setting without pretending every -person, faction, institution, and population can receive a separate model turn. -Ghostlight preserves canonical fine state and changes only the resolution at -which that state is simulated during a wave. - -This document is the authority map for the implemented multiresolution organ. -The wider runtime map remains `ghostlight-dungeon-mvp.md`. - -## Authority map - -- **Owner:** `WorldKernel` owns canonical subjects, world revision, resolution - controls, accepted fission, and atomic strategic-wave commits. -- **Inputs:** canonical actors, institutions, gestalt leaves, typed agency - profiles and relations, resolution pins, current pressure demand, committed - clocks/events, and the previous accepted cover. -- **Outputs:** a revision-bound `ResolutionCover`, its plan receipt, one - appraisal per selected cell, exact constituent-attributed proposals, and one - atomic strategic transition. -- **Derived state:** simulation cells, merge losses, content-addressed cell IDs, - detail focus, and the active cover. None owns a person, population, secret, - relationship, possession, or fictional fact. -- **Forbidden writers:** demand projection, graph construction, the partitioner, - Projectors, Personas, Interpreters, scheduler, browser, and operator inspector - cannot mutate canonical world state. -- **Shared paths:** scheduled ticks and return catch-up both compile the same - `AdvanceStrategicTick` command. Budget and pin changes use the campaign - mailbox at safe boundaries. Provider parallelism uses a separate - configuration epoch and does not repartition or advance fiction. -- **Cut line:** the old flat strategic-plan proposer is gone. No active runtime - path may tick a hand-picked list of factions outside the selected cover or - union arena knowledge into a synthetic actor. - -`ActorState`, `InstitutionState`, `GestaltPersonaState`, and durable gestalt -member deltas remain canonical owners. `AgencyProfile` and `AgencyRelation` are -typed partition inputs. `SimulationCell` is always disposable and rebuildable. - -## Latent-world scale and elaboration demand - -- **Owner:** consumer-authored `WorldScaleIntent` owns the desired active-cover - ratio. `ResolutionPolicy` continues to own only the active-cell entitlement. - A deterministic `WorldElaborationDemand` derivation owns the resulting target - and deficit; it owns no fictional content. -- **Inputs:** active-cell budget, target active-cover basis points, the current - count of simulation-eligible canonical subjects, and positive complexity - weights for admitted realm jurisdictions. -- **Outputs:** target actionable-subject count, exact current deficit, a bounded - round-effort budget, and deterministic per-realm target shares. At 240 cells - and 1,000 basis points, the target is 2,400 subjects. -- **Derived state:** demand, deficit, invocation schedule, and realm target - shares are resumable planning artifacts. They are not subjects, facts, - Personas, cells, or mutation permits. -- **Forbidden writers:** the elaboration scheduler, titled workers, Gestalt - compression, Nemesis, and provider concurrency cannot create or count a - proposed subject as canonical. Only admitted population, institution, or - actor operations committed through `WorldKernel` reduce the deficit. -- **Shared paths:** initial compilation, destination expansion, resumed - elaboration, and later consumer-requested scale changes use the same demand - derivation and canonical actionability count. Each titled worker proposes at - most one structural operation at a time; deterministic admission and kernel - commit remain unchanged. The current scale loop raises complexity through - grounded Gestalt fission or promotion of an individual into an active Actor - leaf, never through unelaborated census or roster rows. Institution admission - remains compiler-owned rather than being smuggled into this loop. -- **Cut line:** fixed elaboration-pass count is not a world-scale owner. It may - bound which jurisdictions are being worked in one run, but it cannot declare - the latent world sufficiently populated. Provider concurrency controls only - simultaneous calls and never changes the target or deficit. - -Realm complexity weights distribute the target; they do not increase it. Any -integer remainder is assigned deterministically so the realm shares sum exactly -to the world target. A rejected or conflicting proposal leaves the deficit -visible rather than being hidden behind an assumed model-call yield. - -The actionable count includes only active simulation-eligible agency leaves. -Dormant member records are useful latent identity, but do not pay down the -complexity deficit until grounded elaboration promotes them. Resolution may -still compress roughly 2,400 such leaves into at most 240 cells. - -The mutation budget is not a cold-prompt budget. Each titled elaborator owns a -resumable working session per realm jurisdiction containing its current frontier, unresolved leads, -recent admitted mutations, exact rejection findings, and title mandate. The -canonical world remains long-term memory. Bounded retrieval supplies older -relevant state. After each round, every title that committed work receives one -agentic compaction turn. It emits a typed checkpoint bound to the exact admitted -commit ancestry; raw conversation is never authority, and the next turn appends -from the checkpoint. This round boundary is the current bounded context policy. -Scheduler frequency remains proportional to slider share across sequential -turns. - -The scale workbench uses mutation drafts rather than asking a model to restate a -complete kernel command. A fission draft owns only new child identities, -partition values, and exact member/resource assignments. The deterministic tool -attaches campaign revision, parent, axis, approval fields, and inherited -capabilities, knowledge, goals, and pressures before running the ordinary -fission validator. An individuation draft owns only the new member delta; the -tool attaches the exact parent version and location. Unchanged world state is -therefore never paid for in model output and cannot drift while being copied. -The shared fission validator reports the complete deterministic mismatch set in -one observation, so an agent can repair the same compact draft without replaying -inference or guessing which invariant failed first. -The lane-specific action schema requires one entry for every exact frozen -resource and dormant-member ID and rejects extra keys. The elaborator still -chooses child custody; it cannot silently omit a scarce thing the kernel must -conserve. - -Round effort is proportional to unresolved pressure rather than presumed model -yield: `ceil(active_cell_budget * deficit / target)`, zero when the target is -satisfied. With 80 admitted leaves against the 2,400 target, the first round -funds 232 one-operation turns. After admission the deterministic owner recounts -active meaningful leaves and derives the next round afresh. A fission may add -several meaningful child leaves; a rejected proposal may add none. Neither case -changes the accounting rule or grants the scheduler fictional authority. - -## Canonical population resolution - -Known population detail is represented by non-overlapping active gestalt -leaves. A material split uses approval-gated `FissionGestalt`: - -1. the compiler retrieves exact Vault evidence and produces a fission preview; -2. every requested enumerated facet gets a child and one `other/unknown` - remainder is mandatory; -3. children inherit the parent baseline and own only later deltas; -4. every exact scarce resource is assigned to one child rather than copied as - an inheritable trait; -5. member deltas are assigned to one child without rewriting identity; -6. the parent remains as inactive lineage rather than being destroyed; -7. the kernel validates the preview, evidence, versions, assignments, and - residual child before one atomic commit. - -The commit is a canonical `WorldMutationBatch`: child admission establishes -identity and occupancy, the lineage mutation inherits non-scarce baseline -components, custody transfers partition resources, and membership transfers -move exact named people. Agency profiles, inherited partition facets, and the -discarded cover are resolution projections of that accepted transition; they -cannot create a second result. - -Reversible simulation aggregation never invokes fission and never deletes or -reverses this lineage. - -## Canonical individual migration - -Resolution aggregation and population membership are separate authorities. A -cell may temporarily contain many populations, but that never changes which -population baseline a durable person is composed from. `WorldKernel` owns one -explicit membership transition for that purpose. - -- **Owner:** `WorldKernel` owns a durable member's current active-leaf - `gestalt_id`. The member delta owns their identity, memories, relationships, - possessions, injuries, obligations, and personal departures from the current - baseline. `GestaltLineage` owns immutable fission ancestry. -- **Inputs:** one exact member-attributed proposal, the source and destination - active gestalt leaves, a typed migration relation, a reachable destination, - and the campaign/resolution snapshot already bound to the strategic wave. -- **Outputs:** the same member identity attached to the destination leaf, with - capability and knowledge deltas rebased so their effective personal state is - bit-for-bit unchanged; one attributed migration event is emitted. -- **Derived state:** simulation cells, arena membership, member prompt - selection, and rematerialized `ActorState` projections do not own population - membership. -- **Forbidden writers:** a source gestalt, destination gestalt, arena, demand - model, Projector, Persona prose, or migration relation cannot move a person. - Only an action attributed to that exact durable member may propose the - transition, and the kernel validates it. -- **Shared paths:** source and destination may be leaves at any depth under - unrelated lineage trees. The same rebase primitive handles crisis camps, - neighborhoods, departments, corporations, species populations, and later - refinements. -- **Cut line:** changing `GestaltMemberDelta.gestalt_id` directly is forbidden. - It would reinterpret the old delta against a different baseline and silently - alter the person's knowledge, capability, or default goals. - -A bounded set of salient dematerialized member exceptions may be projected -inside the cell containing their current gestalt. They remain separately -attributed people, not shared gestalt state. Selection favors unresolved -personal conditions, obligations, goals, and relationships to the player and -is capped so a large population does not dump its roster into the prompt. A -member may migrate only along an explicit active `migration` relation to a -reachable destination leaf. At any active leaf, the same member may instead -emit a `member_activity` from their exact location toward their current -population, an explicitly related subject, or another selected named person or -active subject at that exact location. Only the capped salient member -exceptions exposed to the cell may appear as named targets in its prompt; -canonical validation still checks the target's identity and current location. -Migration and ordinary activity share one per-member strategic action slot. -This lets a refugee who mattered during -a crisis choose to travel, offer work after settling, and later rematerialize -as the same person without forcing every refugee to consume an active Persona -cell or giving their agency to the destination Gestalt. - -The membrane distinguishes a chosen journey from preparation for one. When a -member commits to board, depart, travel, or join a supplied destination within -the strategic horizon, the Interpreter must emit `member_migration`; approaching -the queue is not allowed to erase that commitment into `member_activity`. -Preparing applies only while departure remains unchosen. The semantic verifier -checks both directions so neither consideration becomes travel nor chosen -travel disappears into local activity. - -Presence projection is location- and lineage-bounded. The planner sees only -active gestalt leaves at the player's location, dormant members whose exact -current location is there, and materialized members that might be eligible to -fold. Inactive ancestors and remote dormant rosters do not enter the prompt. -The kernel independently rejects individuation from an inactive leaf, -promotion outside the member's exact location, and automatic reconciliation -outside the player's active location. A direct internal command may preserve a -named offscreen actor, but model-driven presence reconciliation cannot teleport -one into view. Existing member deltas are preferred when their relationship, -memory, obligation, or goal makes an ordinary encounter a meaningful callback. -The player actor's reciprocal relationship to each nearby dormant member is -projected beside that member's exact delta. Presence planning is scene casting, -not roster cleanup: an earned local callback may surface without the player -asking for the person, while an incompatible event or absence of durable -callback evidence may still produce no promotion. The model only proposes the -cast; `WorldKernel` validates exact member, gestalt, location, and versions -before materialization. Live harnesses persist the private presence preflight -even when their acceptance assertion fails. - -The presence-planner schema enumerates promotion IDs only from the supplied -nearby dormant roster, demotion IDs only from supplied materialized actors, and -gestalt and location IDs only from the exact scene candidates. A structurally -valid plan that mismatches member, gestalt, location, or version receives one -same-snapshot semantic correction. When that correction succeeds, both the -rejected and accepted stage receipts remain durable; the rejected receipt is -marked `semantic_invalid` with the bounded local reason. - -## Canonical population migration - -Population fission and population movement are separate decisions. Fission -answers which non-overlapping cohort exists. Migration answers where one active -cohort goes. Simulation aggregation answers how much inference attention that -cohort receives after arrival. None of those operations is a canonical merge. - -- **Owner:** `WorldKernel` exclusively owns an active gestalt leaf's - `home_location_id` and the matching agency-profile location set. -- **Inputs:** one exact gestalt-attributed proposal, an active source leaf, an - explicit migration relation to an active destination population leaf, a - reachable destination, and the unchanged world and resolution revisions. -- **Outputs:** the source leaf and its agency profile move atomically, their - versions advance, and one attributed population-migration event records the - source and destination locations and populations. -- **Derived state:** the resolution cover may later place the migrant cohort - and destination population in one cohesive or arena cell. That cover does - not change either population's identity, knowledge, authority, or lineage. -- **Forbidden writers:** an arena, destination population, Projector, Persona, - Interpreter, scheduler, or relation cannot move a population. A population - move never carries named member deltas by implication; each named person's - exact location and membership remain unchanged until that person acts. -- **Shared paths:** every active leaf uses the same transition, whether it is a - root population or a child many levels below it. Approval-gated fission may - first create destination, stayer, and `other/unknown` cohorts; each resulting - leaf can then migrate independently. -- **Cut line:** collective departure is neither `prepare` nor - `member_migration`. The former loses the chosen journey; the latter gives a - population authority over a person. Canonical population merging remains - absent: arrival changes geography, while derived covers provide cheap local - aggregation. - -## Demand projection - -A flash-model structured stage converts the committed event or strategic -horizon into weights for geography, ideology, authority, economy role, -species/body, and information. Focal subjects must be chosen from supplied IDs. -Local semantic validation permits one same-snapshot correction. Failure falls -back to the last accepted demand; the initial fallback favors geography and -authority. - -Demand is relevance evidence. It cannot create profiles, pins, cells, or facts. - -## Agency graph - -Vertices are active canonical actors, institutions, and gestalt leaves. Edges -carry containment, command, membership, alliance, rivalry, trade, migration, -communication, coercion, and shared-location meaning. Subjects sharing a -location receive derived adjacency. Disconnected components receive a -resolution-only Steiner chain so the graph remains coarsenable; those bridge -edges assert no lore relation, common authority, proximity, or shared -knowledge. - -The compiler must profile every non-player actor, institution, and gestalt -exactly once across all six axes. It compiles a bounded local play region and a -global skeleton of major powers, coarse regions, institutions, information -channels, and strategic pressures. Runtime migration derives profiles for old -flat campaigns without changing their world revision, actors, institutions, -gestalts, or fictional time. - -## Budgeted connected cover - -The campaign selects an active Persona-cell budget from 1 through 240, default -8, bounded by its pooled entitlement. Provider parallelism is a separate -control capped at 32 concurrent cell pipelines. -The scale fixture covers 1,000 canonical subjects with 200 unique cells, then -dispatches every cell membrane in one wave while a seven-permit semaphore -bounds physical provider work. Wave width and provider pressure are therefore -separate authorities; all terminals still join, sort, validate, and commit as -one atomic resolution wave. -The partitioner: - -1. contracts valid `keep_together` pins; -2. forces focal, directly engaged, leased, initiative, targeted, and - `minimum_individual_detail` subjects into singleton cells; -3. respects `keep_separate` pins and reports mandatory effective-budget - overage rather than hiding a foreground subject; -4. starts at fine resolution and repeatedly merges the lowest-loss legal - graph-adjacent pair with deterministic tie-breaking; -5. performs one connected boundary-refinement pass and accepts a move only - when compression cost improves by at least five percent; -6. preserves a previous cover during its lease, or until a replacement improves - the weighted objective by at least ten percent, unless a forced split or - budget change applies; -7. validates complete unique coverage, connectedness, cell identity, mode, and - epoch before the cover can enter a wave. - -Compression cost is merge loss multiplied by the number of collapsed -trajectories. This prevents the objective from favoring one overloaded arena -merely because a singleton has zero local loss. - -The normalized merge loss is: - -```text -0.25 facet divergence -+ 0.20 hidden causal-boundary mass -+ 0.15 information-scope divergence -+ 0.15 spatial divergence -+ 0.10 clock/obligation divergence -+ 0.10 salience burial -+ 0.05 partition churn -``` - -Facet divergence is demand-weighted Jaccard distance. Spatial divergence uses -known locations, direct travel time, and the current strategic horizon. -Candidate scoring uses a deterministic mergeable representative sample for -bounded local work; exact authority, hostile relation, coverage, connectivity, -pins, and knowledge validation remain unsampled. - -Union-by-size owns constituent-set merges. This is not merely an optimization: -it keeps the 1,000-subject path from degenerating into quadratic copying while -leaving stable merge ordering unchanged. The release property test completes -the 1,000-subject, budget-8 partition in approximately 50 ms on the development -host, under the 100 ms contract. Setting `GHOSTLIGHT_PARTITION_TRACE` enables a -development-only phase timing probe. - -## Cell modes - -- **Cohesive:** all constituents share one actual collective authority, contain - no active hostile edge, and remain within information and behavioral - divergence thresholds. The cell may speak and act plurally. -- **Arena:** constituents remain distinct or opposed. The cell receives an - attributed polyphonic situation and may simulate interaction, but it has no - actor ID and cannot speak, know, decide, or act as a collective. - -Cross-faction aggregation is therefore an arena. Arena interpreters may emit at -most `min(4, 1 + ceil(log2(constituent_count)))` actions, each attributed to an -exact constituent. The kernel validates that subject's knowledge, information -channel, resources, authority, relationships, location, and reachable -destinations. Secrets are never unioned. - -## Strategic outcome authority - -A valid attributed attempt is not yet a world consequence. The Interpreter -owns the narrow claim that a constituent chose an admissible attempt; it does -not decide whether the attempt worked, what opposition did, or which durable -state changed. Treating the attempt event as a sufficient result made the -world busy in prose while its resources, relationships, knowledge, and -pressures mostly stood still. - -One wave-level strategic outcome resolver owns that missing decision. It runs -after priority and incompatibility selection but before the command enters the -kernel: - -1. Ghostlight content-addresses every selected `gestalt_activity`, - `actor_activity`, and `member_activity` proposal. The digest binds exact - source, intent, intended effect, targets, locations, state references, - channels, and typed activity. -2. A local context compiler supplies only those selected attempts and their - legal consequence handles: source capabilities and holdings, exact target - state, active incident relations, current pressures, eligible named-member - deltas, and source-discoverable canonical facts. -3. One cheap structured model call resolves the batch. It returns exactly one - success, mixed, or failure result for every digest and chooses one bounded - typed effect, including an explicit `no_material_change` when the attempt - cannot honestly alter canonical state. -4. Local validation recomputes every permission from the unchanged campaign - snapshot. It rejects invented owners, resources, relations, facts, pressure - resolutions, player mutation, missing outcomes, duplicate outcomes, and - conflicting effect targets. One same-snapshot correction is permitted. -5. `WorldKernel` requires the outcome-stage receipt bound to the complete - ordered digest set, then applies the plan and all outcomes to one private - campaign copy. A late invalid effect aborts the wave; no clock, activity, - outcome, detail debt, or world state reaches the committed campaign. - -The public `strategic_activity_outcome.v1` contract is a typed sum. Its MVP -effects are deliberately small: - -- create, spend, or give away a resource owned by the acting population or - named member; -- add or resolve pressure on the acting population or an exact targeted - population; -- shift one exact active agency relation incident to the source and a supplied - target by a bounded amount; -- add one memory, obligation, or relationship description to an exact named - member who owns that perspective; -- learn one exact canonical fact that was discoverable at the attempt location - or already known by an exact communication target; -- or record an explicit reason why no durable material change occurred. - -The provider boundary uses a flat JSON proposal rather than asking the model to -emit the public tagged sum directly. The private flat shape avoids fragile -`oneOf` generation; a local interpreter is the only component allowed to turn -it into the typed public effect. JSON remains a model-provider boundary. The -accepted outcome, its binding, and its receipt are persisted through the -campaign's CultCache path. - -Outcome resolution does not grant an arena collective authority. Every result -remains bound to the exact constituent proposal digest. A rival can suffer a -pressure or relation consequence, but cannot be made to speak, spend a -resource, reveal knowledge, or acquire a private relationship as though the -arena had chosen for it. Effects on the player are forbidden; accessible news -may later reveal a committed consequence, but the absent player is never -puppeted or directly harmed. - -The resolver is batched once per strategic wave rather than once per cell or -attempt. This keeps the stable rules and schema in one cacheable prompt prefix, -lets it compare simultaneous opposition, and spends completion tokens only on -the handful of attempts that survived selection. Provider concurrency still -controls the preceding Persona-cell wave and does not alter outcome authority. - -## Fairness and quiet-world agency - -Every active profile carries persistent non-fictional `detail_debt`. Aggregate -representation increases debt; singleton or explicit detail focus clears it. -Each strategic wave reserves focus for the highest-debt subject. At budget 1, -the root arena retains the global situation while explicitly appraising that -subject. Deterministic clocks and obligations advance regardless of focus, and -every cell must emit explicit action or inaction. - -With N subjects, deterministic debt rotation gives every subject direct -resolution attention within at most N strategic waves, absent a mandatory -foreground override. - -## Persona-cell wave - -Each selected cell runs one Ghostlight-owned -Projector → Persona → Interpreter membrane: - -- cohesive Projectors expose genuinely shared lived state plus attributed - exceptions; -- arena Projectors expose attributed constituent slices and no synthetic actor; -- Personas receive only the private lived narrative stream; -- Interpreters emit a typed appraisal and exact constituent effects; -- malformed or semantically invalid output gets one same-snapshot correction. - -An appraisal has two attributed lanes: `actions[]` for proposed transitions and -`inactions[]` for exact subjects that deliberately hold, wait, or continue an -already committed course. The old cell-wide inaction string is gone. This -matters in a mixed arena: one institution can act while two rivals hold without -the Interpreter manufacturing repeated posture transitions merely to preserve -their separately voiced decisions. Inaction IDs use the same constituent or -selected-member permission set, carry a bounded reason, cannot duplicate, and -cannot also appear in the action lane. They are audit/fairness evidence and -never mutate the world. A cell with no actions must still contain at least one -attributed inaction. - -An arena may contain simultaneous views from distant locations. The Projector -names each subject's actual location and keeps those views as separate scenes; -a graph relation or activity target grants permission to attempt contact, not -fictional co-presence. The Persona preserves those spatial boundaries unless -the lived stream explicitly establishes an exact shared location or -communication channel. Compression therefore cannot turn a regional arena -into one impossible meeting room. - -Perspective attribution is runtime-owned. The learned Projector emits bounded -`subject_id → narrative` segments, where the subject ID must be one exact -constituent or selected member exception from the permitted slice. Ghostlight -then lowers those private structured segments into one natural lived stream, -adding exact names and locations plus a deterministic scene-boundary block. The -Persona receives only that lowered prose. It never sees IDs or schemas. - -- **Owner:** the permitted cell slice owns which subjects may have an internal - perspective; the Projector owns only the lived language inside one bound - segment. -- **Inputs:** exact cell constituents, selected member exceptions, perceived - events, locations, private state slices, and the shared snapshot binding. -- **Outputs:** one to the cell action limit unique, non-empty narrative - segments, lowered in stable order with runtime-owned perspective labels. -- **Derived state:** headings, scene labels, and the combined lived stream are - disposable projections and own no canonical fact or decision. -- **Forbidden writers:** Projector prose cannot add a perspective owner by - inventing a heading, voicing a mentioned outsider, or speaking as an arena. -- **Shared paths:** cohesive and arena cells use the same segment binding; - their mode changes narration guidance, never perspective authority. -- **Cut line:** raw freeform cell Projector output is no longer appended - directly to the Persona stream. Only runtime-bound segments cross the - membrane. - -The deterministic block contains names and locations, not schemas or state -fields. A poetic omission therefore cannot erase geometry, and an invented -Markdown section cannot grant a subject agency before the Persona turn. - -Perspective ownership is equally strict. Only the cell's supplied constituents -and selected member exceptions may receive an internal viewpoint or make a -choice. A named person mentioned by a perceived event but owned by another cell -remains an external observation. Personas may seek an unknown role or office, -but cannot conjure it into available contact; target-requiring effects need one -of the exact supplied subject IDs. - -Physical provider concurrency batches these pipelines behind a separate -operator limit, default 8. Changing that limit increments only -`provider_configuration_epoch`; it preserves the selected cover, resolution -epoch, world revision, clocks, and fictional time. - -All cell results must bind the same campaign revision and resolution epoch. -The kernel requires a Projector, Persona, and Interpreter receipt for every -cell, validates every proposal, resolves incompatibilities deterministically, -caps committed consequences at `min(16, 2 × effective_budget)`, and commits the -entire wave once. One missing appraisal, stale receipt, malformed stage, -invalid cover, or invalid effect aborts the wave without partial mutation. - -Interpreter `intent` and `intended_effect` prose is proposal rationale only. It -never becomes canonical event narration. The kernel derives each committed -event summary from the exact admitted posture, pressure markers, route, or -membership transition after applying it. Strategic plans therefore carry no -model-authored summary field that can assert a consequence outside the typed -effect. - -Recent events are projected per constituent. A cell receives an event only for -subjects that participated in it, occupy one of its locations, or possess one -of its public channels; arena streams retain those viewer attributions. There -is no global recent-event recap that can quietly teach every population the -same fact. - -Interpreter prompts use a compact stable output contract plus an exact -per-subject permission table. The table names the only allowed effect kind, -state references, public channels, and destinations for each constituent or -member exception. Local validation repeats every slice-expressible constraint -before accepting the terminal appraisal, so a malformed pressure marker or -wrong subject/effect pairing receives the same-snapshot correction while the -kernel still performs the authoritative canonical check. Named-member -knowledge is never treated as an information channel; while dematerialized, -the member can publish only through channels owned by their current leaf -gestalt's agency profile. - -`subject_state_references` is the single derivation path for canonical -constituent references used by both prompt slicing and wave admission. For a -Gestalt it includes reachable destinations produced by active migration -relations, along with the destination population and location references. The -scheduler does not append a second opinion after the fact, so a reference -shown to the Interpreter cannot become invalid merely by reaching the wave -resolver. - -`subject_id` is the sole model-facing owner attribution. Nested effect owner -IDs are absent from the model contract: Ghostlight derives `institution_id`, -`gestalt_id`, `actor_id`, or the raw member ID during binding. The canonical -`CellActionProposal` still carries those IDs for downstream validation and -receipts, but a model cannot make two copies disagree. This also removes -repeated tokens and one class of correction calls from every actionful cell. - -Institution rows distinguish `current_posture` from unresolved `pressures`. -The committed posture is projected as already true and is the exact baseline -against which a new institutional commitment is validated. It is never hidden -in a generic pressure list, where a Projector could mistake a completed choice -for a dilemma still awaiting action. -Institution posture proposals are bounded to 240 characters in both the stable -Interpreter contract and local JSON Schema, matching the canonical validator. -The model sees the limit before generation instead of spending a semantic retry -on an otherwise valid but overlong commitment. - -A committed strategic effect must produce an exact canonical consequence. -Institutions cannot re-adopt their current posture. Population pressure effects -carry an explicit lifecycle: `pressure_resolutions` must name exact current -pressure markers, and `pressure_additions` must introduce genuinely new -unresolved constraints, threats, obligations, or conditions. Completed action -prose is not a pressure. - -Populations may instead propose a bounded `gestalt_activity`: prepare, -coordinate, investigate, recruit, obstruct, trade, or communicate. Its source -is an exact active gestalt leaf; its targets must be adjacent canonical agency -subjects through an explicit active relation or exact shared location. A -dormant named person is addressable as `member:` without becoming gestalt -state. Its locations and channels must belong to the source's permitted slice. -The effect commits only an attributed attempted-activity event. It does -not claim successful discovery, recruitment, persuasion, delivery, exchange, -obstruction, preparation, or target response. Event records carry exact -gestalt participant IDs so later demand and perception can attribute the -attempt without treating an arena as an actor. A later resolved outcome needs -its own admitted effect. - -Two local attempts may omit a canonical target while retaining the source's -exact current location. Targetless `investigate` seeks facts from the -environment or an unnamed ordinary role. Targetless `communicate` records the -source speaking, offering, requesting permission, or notifying such a role. -Neither form creates a listener, reply, acceptance, discovery, or target -agency. All other target-bearing activity uses exact canonical subject IDs. -Activities may include incidental motion around unnamed local features while -remaining inside the source's canonical location. This does not create -topology or establish arrival. Only a clear commitment to a different supplied -canonical location or population destination requires a movement effect. - -The shared validators run in the Interpreter membrane, wave resolver, and -kernel. One gestalt can contribute at most one selected pressure transition or -activity per tick; deterministic priority resolution cannot let two effect -forms bypass that limit. - -Named member exceptions use the same activity vocabulary through -`member_activity`. The event is attributed to `member:` and the current -leaf; the member's delta, the source Gestalt, and any target remain unchanged. -An arena cannot translate the person's attempt into a collective action, and -the destination population cannot claim the person's voice. `member_activity` -and `member_migration` resolve under one exact member key, so only the -higher-priority compatible choice can commit in a wave. - -Canonical non-player actors use `actor_activity` for preparation, -coordination, investigation, recruitment, obstruction, trade, and -communication. The action is bound to the actor's exact current location, -state references, information channels, and graph-adjacent or co-located -targets. `actor_move` and `actor_activity` share one actor action key, so a -cell cannot make the same person travel and act again in the same wave. -Human-controlled actors are inadmissible in both paths. An arena may carry the -actor's attributed proposal but cannot translate it into population speech, -member activity, or collective authority. - -The Interpreter maps natural attempts narrowly: speech, offers, requests, and -notices are communication; coordination requires an actual attempt to arrange -joint work; preparation is the source's own concrete work; investigation seeks -information; recruitment invites participation; trade offers exchange; and -obstruction attempts interference. `intended_effect` repeats the attempted act, -not the hoped-for outcome. This keeps the semantic verifier focused on agency -and consequence rather than guessing what a broad activity label meant. - -Semantic correction feedback names the exact failed boundary and current -value. A repeated institution posture receives its present posture; an invalid -population transition receives its exact current pressure set and the failed -transition reason. The correction model is not expected to reconstruct a -validator from a generic rejection. - -The WorldKernel resolves every strategic batch against one immutable campaign -snapshot. It applies validated transitions to a private working copy and swaps -that copy into the campaign only after the whole batch succeeds. Earlier -actions in the batch therefore cannot rewrite the spatial, relationship, or -knowledge permissions used by later actions. This matters when, for example, a -camp population signals refugees during the same strategic horizon in which -those refugees depart: both choices are judged from the shared starting world, -while the committed result still contains the migration. A late invalid action -discards the working copy and leaves the campaign untouched. - -An actionful cell has a fourth private stage after the Interpreter: the -`cell_effect_verifier`. This cheap structured reader compares the natural -Persona decision with each attributed typed effect. It rejects reversals, -subject swaps, omissions, wishful outcomes, or lossy mappings—for example, -mapping “Mira gives her berth to somebody else” into a migration of Mira -herself. The rejected appraisal and concise rationale return to one -same-snapshot Interpreter correction. Inaction cells skip the call. The kernel -requires a valid verifier receipt for every actionful cell; an invalid or -missing verifier cannot satisfy the wave receipt gate. The verifier receipt's -snapshot binding includes a MessagePack content hash of the ordered action -bundle. The kernel recomputes it, so a verdict for another proposal at the same -world revision and cell cannot be replayed as authority. - -Verification is per action, not a batch opinion. The model returns exactly one -ordered `action_index` and discriminated result for every candidate: `match`, -or `mismatch` with one enumerated mismatch class. -Ghostlight constrains the verdict count and index range in the stage schema, -rejects omissions, duplicates, reordering, and incoherent discriminators, and derives -the rejected set locally. This keeps one bad arena action from contaminating -independent constituents and prevents a global pass/fail field from -contradicting its own rejected-index list. - -## Public state and controls - -The schema catalog and CultCache stores publish: - -- `agency_profile.v1`, `agency_relation.v1`, `gestalt_lineage.v1`; -- `resolution_policy.v1`, `resolution_pin.v1`, `resolution_demand.v1`; -- `simulation_cell.v1`, `resolution_cover.v1`, - `resolution_plan_receipt.v1`, and `resolution_control_receipt.v1`; -- `cell_appraisal.v1`, `cell_action_proposal.v1`, and the internal atomic - `resolution_wave_commit.v1` bundle; -- `strategic_activity_outcome.v1`, persisted individually for inspection and - also bound inside the atomic resolution wave; -- `gestalt_migration.v1` and `member_migration.v1` as distinct collective and - individual movement contracts inside strategic plans; -- `gestalt_fission_preview.v1` and approval-gated `FissionGestalt`. - -The authenticated campaign laboratory exposes budget, effective overage, pins, -fission preview/approval, and a separate operator provider-parallelism control. -The Eve operator projection carries the agency graph, active cover, cell modes, -loss components, debt focus, pins, plan receipts, cell appraisals, and control -receipts. Browser and Eve surfaces use a composite interface version so -resolution-only and provider-only changes refresh without impersonating a world -revision. - -## Verification - -Property and golden tests cover budgets 1/4/8/32, complete unique connected -coverage, deterministic ties, mandatory overage, contradictory pins, fairness, -arena isolation, fission identity preservation, stale epochs, atomic waves, and -the 1,000-subject target. Pressure goldens preserve geography under blockade, -ideology under schism, workplace/economic role under strike, species/body and -transport under epidemic, and information boundaries under espionage. - -The live Gestalt-dynamics harness has two modes. Its golden mode traverses -budgets 1 → 4 → 8 → 4 and proves independent population/member migration plus -automatic rematerialization of the same durable person. Its fairness mode keeps -the whole 24-subject setting in one arena for 24 total strategic ticks. It -requires every runtime-selected detail focus within the bound, rejects inactive -lineage parents as simulation subjects, and repeats the identity/callback check -after sustained compression. Both migration endpoints must be active leaves at -lineage depth two or greater. - -Both modes distinguish selected attempts from resolved material consequences. -The harness counts direct typed transitions and non-`no_material_change` -activity outcomes separately, rejects a sustained run that never changes the -background world materially, and records every outcome in the private -preflight. A named member's dormant delta may now evolve offscreen, but any -change to memory, obligation, relationship, equipment, or knowledge must be -accounted for by an exact member-bound outcome before the return callback is -accepted. - -Fairness acceptance treats a rejected provider wave the same way the daemon's -scheduler does: the failed pulse records its private trace and commits nothing; -a later pulse may try the same still-current revision again. The harness permits -a bounded, operator-selected number of these fresh pulses per desired committed -tick and reports every rejection in the final result. This does not expand the -single stage's one-correction rule or rebase stale output. - -The exact-build `d044951` budget-8/provider-8 profile is the first complete live -proof of the attributed-inaction and immutable-batch machinery together. It ran -23 sustained waves over 24 active subjects in 742.435 seconds. Every subject -received direct resolution attention; 22 background subjects acted, while the -two without a committed action were represented by exact attributed inaction. -The wave plans selected 175 strategic effects: 85 population activities, 66 -institution postures, 22 named-member activities, one population migration, -and one population-pressure transition. The appraisals also retained 179 -attributed inactions, including 31 cells where some constituents acted while -others held. Ninety arena cells ran without an arena acquiring an actor ID or -collective voice. The eight-cell cover used only two partitions and preserved -the same boundaries across 21 of 22 wave transitions; its largest arena held -13 rivals. - -The same run preserved Mira Venn's effective capabilities, knowledge, -equipment, conditions, obligations, memories, and relationship after her -durable delta crossed the hierarchy. The presence planner later selected her -from `harbor-neighbors` without the player naming her, and the kernel -materialized the same person beside the player. The player remained unchanged. -The private witness is -`F:\GameCult\GhostlightDungeon\acceptance\gestalt-lease-b8p8-d044951-1`. - -The profile also names the next pressure point instead of laundering it into a -victory lap. Observed traffic used 1,988,812 prompt and 233,146 completion -tokens at a 66.64% prompt-cache hit rate. Nineteen rejected pulses consumed -807,304 prompt tokens—40.59% of observed prompt work. Eleven were caught by the -action-bound semantic verifier, three by Interpreter semantic validation, two -by JSON Schema, and three by transport failure. In that build, most population -effects were still attributed attempts recorded in event history rather than -resolved changes to resources, obligations, relationships, knowledge, or -pressures. The current candidate adds the separate strategic outcome resolver -described above without promoting the Interpreter into asserting success. A -revised live result is still required; the `d044951` profile is evidence for -cover, fairness, attribution, and atomic batch behavior, not evidence for -material activity outcomes. - -The callback and fairness claims are independently falsifiable. Strict live -mode requires Mira's Persona to choose resettlement and proves the later -callback without forcing that choice. Fairness mode may instead branch from the -exact committed campaign inside that strict golden's result, then spend all 24 -new provider-driven ticks on budget-one debt rotation. The baseline path and -SHA-256 are recorded in the result; no migration command or Persona decision is -fabricated during fairness setup. - -A deterministic diaspora test drives two durable people from the same -depth-two refugee leaf to two different depth-two destination branches in one -strategic plan. It proves exact effective capabilities, knowledge, goals, -memories, relationships, possessions, conditions, and obligations survive the -rebases; destination populations receive none of that private state. Only the -source and destination population version counters change. Each person can then -materialize from their new local baseline with the same name and private delta. - -### Live pressure results - -The 24-tick budget-one fairness run `gestalt-dynamics-fairness-a4ea28b-1` -covered all 24 canonical subjects with 24 distinct debt-selected foci. Its -accepted appraisals contained 77 attributed proposals: one population -migration, nine institution posture changes, 15 named-member activities, and 52 -Gestalt activities. Consequence capping committed 45 actions from 15 background -subjects. Four -bad scheduler pulses were rejected without revision movement; fresh pulses at -the same current state recovered. Mira retained her exact private and effective -state and was automatically rematerialized at the end. The run took 641.578 -seconds. Its committed baseline is bound by SHA-256 in the result. - -The 24-faction scale matrix produced: - -| Configured cells | Effective cells | Arenas | Committed actions | Seconds | Prompt tokens/action | -| ---: | ---: | ---: | ---: | ---: | ---: | -| 1 | 1 | 1 | 2 | 18.913 | 11,734.5 | -| 4 | 4 | 3 | 8 | 15.619 | 4,682.1 | -| 8 | 8 | 7 | 16 | 26.300 | 3,546.6 | -| 32 | 24 | 0 | 16 | 55.906 | 7,410.5 | - -Budget 4 is the latency sweet spot in this fixture. Budget 8 reaches the global -16-consequence cap with the best cognitive efficiency. Resolving every faction -individually doubles prompt cost and wall time relative to budget 8, adds no -committed consequences under the cap, and increases whole-wave tail-failure -risk. Budget 1 remains a valid emergency compression mode, not an efficient -default. - -Repeated fairness prompts reached a 47.07% aggregate provider cache-hit ratio; -Projector reached 75.45% and Persona 61.57%. Interpreter remained the dominant -cost at 247,578 prompt tokens and only 34.54% cache hits. Prompt/context work -should therefore target Interpreter permissions and stable-prefix layout before -shrinking the Persona stream. - -Resolution control is edge-triggered. `active_cell_budget` owns -`resolution_epoch`; provider parallelism owns only -`provider_configuration_epoch`. An unchanged control value is rejected without -persistence, epoch movement, or cover invalidation. Acceptance harnesses issue -either control only when its value actually differs, so repeated strategic -ticks preserve the previous cover, leases, and churn history. Stress runs may -select cell budget and provider parallelism independently. - -A lease preserves a cut, not invalid topology. Before reusing a previous cover, -the partitioner revalidates every multi-subject cell against the current agency -graph. Migration, relation changes, fission, or activation can therefore break -a leased cell and force replanning immediately. Cover validation reports empty, -duplicate, disconnected, content-ID, and false-cohesion failures separately. - -Fairness accounting uses the same definition as canonical detail debt: an -explicit aggregate `detail_focus_subject_id` and every singleton cell both -receive direct resolution attention. A named focus is not required for a -subject already receiving its own complete Persona pipeline. - -The lease-preserving budget-4 profile committed all 23 requested sustained -waves and recovered from 18 rejected provider pulses without partial mutation. -It then failed its separate callback assertion because the presence planner -returned an empty cast. This isolated a player-experience fault from the agency -invariants: Mira remained the same dormant person in the correct destination, -but continuity was not surfaced. The focused `gestalt-callback-6253f9f-1` run -then passed: after one fresh 24-subject arena wave, the planner promoted -`mira-venn` from `harbor-neighbors` without the player naming her, and the -kernel rematerialized the same private and effective state. The full run took -18.465 seconds. Its strategic membrane used 18,662 prompt and 1,096 completion -tokens; the additional presence decision used 2,504 prompt and 78 completion -tokens. - -Institution posture is projected as `already_committed_posture`. It is durable -state already in force, not a new pressure or decision. Projector, Persona, and -Interpreter contracts all treat continuing or restating it as explicit -inaction; only a materially different commitment may emit an institution -posture transition. Local validation remains strict rather than silently -dropping a no-op. - -The 31-wave budget-8 / provider-parallelism-4 profile -`gestalt-lease-b8p4-6253f9f-1` passed after 1,211.592 seconds. All 24 subjects -received direct attention. Its sustained appraisals made 199 accepted proposals -from 22 distinct subjects; consequence resolution committed 51 institution -postures, 110 Gestalt activities, one population migration, and 31 named-member -activities, plus the initial arena consequence. Fifteen rejected pulses left -the world unchanged and later recovered. The same Mira callback passed after -the full run. - -The profile used 1,468,039 strategic prompt tokens and 165,725 completion -tokens, reached a 60.69% cache-hit ratio, and spent 7,567 prompt tokens per -committed consequence. Interpreter remained the largest stage at 737,148 -prompt tokens but reached 67.18% cache hits; Projector reached 70.03%. The -presence decision added 2,606 prompt and 78 completion tokens. Live traces -showed that the remaining repeated-posture failures occurred when several -constituents in one arena held while others acted, motivating the attributed -inaction lane rather than another prompt-only prohibition. - -The first attributed-inaction/provider-parallelism-8 comparison committed nine -waves, then exhausted its bounded retries at wave 10. It proved the new lane in -mixed appraisals—across the first nine waves, 72 cells emitted 63 actions and 93 -attributed inactions, including 18 action-plus-inaction appraisals—but also -exposed an overprojection failure. The Interpreter invented roster-completion -inactions for subjects absent from the Persona turn, overflowing the -four-perspective limit, and once wrote a reason beyond the 240-character schema -bound. The contract now admits inaction only for a subject that explicitly -holds or waits in the Persona turn, forbids absence-as-inaction, and asks for a -reason of at most 160 characters while retaining the 240-character hard bound. - -The strategic outcome resolver closes the attempt/result authority gap. -Institution postures, population migration, clocks, and history remain kernel -state; selected Gestalt activities are digest-bound attempts. One batched -resolver receives only those attempts and deterministic admissible consequence -handles, then returns one typed result per attempt. The Interpreter cannot -declare its own hoped-for outcome. - -Local validation owns ordinary bounded preparations, pressure changes, and -discoverable knowledge. Effects with easy-to-hide private authority mistakes— -resource consumption or transfer, agency-relation shifts, and named-member -memory, obligation, or relationship deltas—also pass through an independent -same-snapshot semantic verifier. Its verdict is advisory to the resolver retry, -never a writer. Applying that verifier to every harmless preparation was both -expensive and over-strict, so the risk boundary is deliberately selective. - -The current provider-backed golden completed four waves across budgets -`1 -> 4 -> 8 -> 4` in 81.28 seconds in a debug build. It produced ten durable -consequences and seven typed material activity outcomes, with three explicit -no-material-change results, zero rejected pulses, exact member attribution, -the player unchanged, and the same Mira returning with her persistent delta. -It used 126,826 prompt tokens, 14,477 completion tokens, and a 58.34% prompt -cache-hit ratio. This proves the ordinary material-outcome path live. The -selective high-risk verifier was first covered locally, then forced through the -provider boundary below. - -That witness now exists at -`F:\GameCult\GhostlightDungeon\acceptance\forced-high-risk-outcome-contract-fixed-20260818`. -Dock Labor Guild explicitly transferred its exact `west winch rerouting plan` -to the colocated Harbor Neighbors. The Flash resolver emitted the exact custody -transition, the independent verifier accepted it against the same snapshot, -and the canonical input remained byte-identical. The first witness also caught -a prompt/schema naming mismatch: prose said `resource_recipient_id` while the -schema requires `other_subject_id`. Naming the input-to-output mapping directly -removed the correction call; the accepted rerun used exactly two first-attempt- -valid provider calls in 2.95 seconds. - -The Starfire deployment smoke ran a live provider-backed wave over three -eligible singleton cells, committed three offscreen events and three -channel-accessible news items in 19.55 seconds, and preserved the absent player. -That fixture proves deployed cell isolation and atomic admission. The -20-plus-faction budget matrix, not the singleton smoke, proves aggregation. diff --git a/docs/architecture/ghostlight-transition-algebra.md b/docs/architecture/ghostlight-transition-algebra.md deleted file mode 100644 index e4b354b..0000000 --- a/docs/architecture/ghostlight-transition-algebra.md +++ /dev/null @@ -1,616 +0,0 @@ -# Ghostlight World Transition Algebra - -Status: teardown evidence. This describes the pre-rebuild vocabulary — string -`SubjectRef` identifiers, two-phase `AdmitEntity`, flat permitted-mutation -batches, strategic cells, Gestalt fission, and compiler publication — all of -which are on the deletion line in -`docs/architecture/ghostlight-dungeon-mvp.md`. The current closed vocabulary is -`docs/architecture/ghostlight-world-ontology.md`. Read this file for why the old -shape failed, not for what to build. - -The one principle carried forward: different admission lanes share one mutation -vocabulary. A player and an institution transferring the same medicine use the -same custody mutation. - -## Objective - -Ghostlight needs one physical world. A player action, an NPC reaction, a -strategic institution, and a low-resolution Gestalt cell may use different -admission and resolution procedures, but a successful outcome must change the -same canonical components through the same kernel-owned commit primitive. - -The transition algebra exists so that: - -- freeform action remains possible without model-authored structural writes; -- impossible actions are absent from the available operation space; -- every committed change has exact subjects, authority, provenance, and - version bindings; -- foreground and background simulation cannot acquire asymmetric powers; -- new play scenarios compose existing semantic mutations instead of growing a - bespoke effect enum for every story beat. - -This design adapts the useful core of action-language and planning literature: -states are typed assignments, actions have explicit applicability conditions, -and transitions have bounded effects. It does not adopt PDDL, STRIPS, or a -general logic-programming runtime as Ghostlight's public ontology. BC+ provides -the causal-law distinction, STRIPS and PDDL provide the precondition/effect -discipline, and REBA provides the important reminder that coarse and fine -simulation must refine the same transition system rather than inventing two -worlds. See [BC+](https://academic.oup.com/logcom/article/30/4/899/2917837), -[PDDL2.1](https://arxiv.org/abs/1106.4561), and -[REBA](https://arxiv.org/abs/1508.03891). - -## Authority map - -### Owner - -The per-campaign `WorldKernel` owns one `WorldMutationBatch` validation and -commit primitive. It is the only subsystem allowed to change canonical world -components or advance fictional time. - -### Inputs - -The owner may read: - -- the exact canonical campaign revision; -- the exact resolution epoch when a strategic wave is involved; -- typed subjects and their component versions; -- an accepted action, reaction, lifecycle, governance, or strategic-outcome - receipt; -- a digest-bound `MutationAuthorityEnvelope` compiled from current state; -- a proposed batch containing only semantic mutations named by that envelope; -- exact evidence, permission, roll, and model-stage receipts required by the - originating procedure. - -### Outputs - -One successful commit produces, atomically: - -- the next canonical component state; -- append-only world events describing the observable means and outcome; -- a private exact `world_mutation_receipt.v1`; -- the command or strategic receipt that caused the transition; -- any knowledge-channel-aware news inputs derivable from committed events. - -Eve, CultMesh, story, and news projections refresh only after the commit. - -### Derived and demoted state - -- `WorldEffectDelta`, `ActorStateDelta`, `StrategicCellEffect`, and - `StrategicOutcomeEffect` are requirements evidence and migration inputs. They - are no longer allowed to own a production write after their resolver moves. -- `StrategicActivityKind` describes proposed means. It is not a mutation. -- An `ActionIntent` and its intended effect are proposals. They are not facts - and do not become true because a model narrated them. -- Simulation cells, covers, leases, salience, and detail debt choose inference - resolution. They are not fictional world components. -- The transcript contains exact committed speech and outcome prose. Eve lowers - it chronologically without a generative rewrite; display text cannot repair - or create state. -- Actor equipment lists, institution resource lists, and Gestalt resource sets - become projections over resource subjects plus custody. A resource does not - change ontology when its owner changes. -- A dormant named Gestalt member and its materialized foreground form are one - actor subject. Materialization changes simulation resolution, not identity or - physical existence. - -### Forbidden writers - -The migration is not complete while any of these can decide canonical state: - -- `apply_world_effect`; -- `apply_strategic_outcome_effect`; -- the direct private-delta loop in `ResolveReactionWave`; -- bespoke actor, Gestalt, or member movement and migration writers; -- any Gestalt folding code that unions private knowledge, possessions, or - pressure into a population; -- model output, browser payloads, story rendering, news generation, retrieval, or a - derived simulation cell. - -Bounded region expansion and in-place locality elaboration lower to the same -batch primitive through typed place, proposition, population, and institution -admission plus exact topology and political-relation changes. Locality -elaboration owns only additions beneath one exact canonical place; it cannot -replace that place or bypass approval. Either path may possess a broader -administrative authority envelope, but not another state-writing mechanism. -Approval-gated population fission likewise lowers to entity -admission, lineage, custody, and membership mutations; the fission projector -owns only the derived resolution profiles and cover epoch. Initial compiler -publication is not a transition over an existing world; its separate creation -authority is bounded below. - -### Shared paths - -All of these lower to `WorldMutationBatch` before state changes: - -- player `Attempt` confirmation; -- NPC initiative resolution; -- actor reactions and private appraisal consequences; -- strategic individual, institution, cohesive Gestalt, and arena-constituent - outcomes; -- travel, waits, and strategic time advancement; -- resource production, use, damage, repair, and exchange; -- named-person joining, leaving, and migrating between populations; -- population migration and approval-gated fission; -- contract amendments that are permitted to change forward-looking world - state; -- compiler-admitted entities added after publication, bounded region expansion, - and in-place locality elaboration. - -### Cut line - -The new validator applies a whole batch to an isolated transactional overlay, -checks local and cross-mutation invariants, and returns either one complete next -state or an error. Resolvers then emit the new mutation vocabulary directly. -When the last production caller moves, the old committing functions and their -model schemas are deleted. Persisted legacy receipts remain readable history; -they never re-enter a commit path. - -No repair loop, converter with independent policy, or post-commit reconciler is -allowed to preserve a second opinion about the result. - -## Transactions outside the mutation algebra - -Two operations change canonical storage without claiming to be fictional -world effects. They remain narrow because forcing them into `WorldMutation` -would lie about what happened. - -### Initial campaign publication - -There is no prior campaign state to mutate at revision zero. The -`CampaignRegistry` therefore owns discoverability of an approved seed, while -`CampaignStore` owns its atomic installation: - -- input is one validated `approved_campaign_brief.v1`, its exact evidence and - model receipts, membership, governance, DM state, and approval digest; -- every row is written to a fresh `.creating--` store through - one empty-store compare-and-swap batch; -- the staging directory becomes discoverable only through one atomic rename; -- retry is idempotent by campaign ID plus approved seed digest; -- a nonempty store, conflicting digest, failed row write, or failed rename - publishes nothing. - -The seed installer may establish initial subjects and components because no -world exists yet. It cannot target a published campaign, advance fictional -time, or serve imports, reloads, expansion, or later compiler output. The -legacy internal `CreateCampaign` message is initialization plumbing, not a -runtime action authority; public player ingress rejects it. Once the directory -is published, every fictional change belongs to the normal kernel path. - -### Named-person materialisation and folding - -A dormant `GestaltMemberDelta` and its foreground `ActorState` are two -resolutions of one persistent person. `WorldKernel` owns the resolution -transaction at a safe command boundary: - -- materialisation derives the foreground actor projection from the Gestalt - baseline plus the exact member delta; -- folding writes changed individual capabilities, knowledge, equipment, - conditions, obligations, relationships, goals, memories, and location back - to that member delta, then retires only the foreground projection; -- the transaction advances world revision so stale actor-bound commands and - surfaces fail, advances `resolution_epoch`, and clears the old derived cover; -- it does not advance fictional time, relocate the person, transfer custody, - communicate knowledge, change population pressure, or alter the Gestalt - baseline; -- one atomic world receipt plus materialisation receipt binds the member, - projection actor, baseline/member versions, world revision, and resolution - epoch. - -The removed `GestaltAggregateDelta` was an obsolete writer: direct demotion -could previously smuggle private knowledge, resources, and pressures into the -population while automatic demotion rejected the same payload. Those changes -now require explicit semantic mutations under their own authority. Presence -resolution has no vocabulary with which to perform them. - -## Canonical state model - -### Subjects - -Every durable entity has a stable typed `SubjectRef`: - -| Subject kind | Examples | Important rule | -| --- | --- | --- | -| `actor` | player, NPC, named refugee | Identity survives foreground materialization and Gestalt folding. | -| `population` | villagers, refugee convoy, corporation workforce | May own a cohesive Gestalt Persona baseline; never owns member secrets by implication. | -| `institution` | Zhestokost command, a clinic, a guild | Collective authority is explicit, not inferred from proximity. | -| `place` | room, settlement, route node, region | Persists independently of current observation. | -| `resource` | a key, medicine lot, ship, credits tranche | Has exact custody and resource state; it is not a string copied between owner lists. | -| `pressure` | blockade clock, debt deadline, epidemic load | Carries bounded progress and consequence semantics. | -| `proposition` | a source-grounded fact, a witnessed claim, a branch-local finding | Knowledge points to the proposition; prose duplication is not knowledge authority. | -| `channel` | courier route, broadcast, private conversation | Governs who can receive information without making it public. | - -Campaign time is a component of the campaign root. Relationships and topology -edges are keyed component records between subjects, not synthetic actors. - -IDs are opaque and stable. Prefixes may remain a debugging convention, but no -validator infers subject kind or authority from string shape. - -### Components - -The target store is component-oriented even when a compatibility migration -temporarily reads old aggregate rows: - -- `identity`: canonical identity plus adopted handles and their disclosure - state; -- `occupancy`: exact place anchors and travel state; -- `custody`: exact custodian of a resource or controlled subject; -- `resource_state`: type, quantity, integrity, qualities, and lifecycle; -- `capability`: supported abilities and their limits; -- `condition`: bodily, material, social, or environmental state; -- `knowledge`: proposition, epistemic status, source, channel, and revision; -- `memory`: private episodic record and provenance; -- `relationship`: directed subject-to-subject state; -- `commitment`: goals and obligations, including creditor or beneficiary; -- `pressure`: bounded progress, threshold, consequence, and status; -- `posture`: an agentive subject's current strategic stance; -- `population_membership`: exact member, population, role, and interval; -- `population_lineage`: refinement, fission, merge, and remainder ancestry; -- `topology`: containment and route edges with travel cost and availability; -- `lifecycle`: admitted, active, transformed, consumed, retired; -- `world_time`: the campaign's monotonic fictional coordinate. - -Components are sparse. A place does not need knowledge; a proposition does not -need occupancy. Component applicability is determined by subject kind and the -specific admitted entity, not by a universal bag of optional fields. - -Route keys are scoped to their owning origin location. Canonical route identity -is therefore the pair `(origin_location_id, local_route_id)`, never the bare -map key. The transition overlay encodes that pair into a collision-free edge -identity before validation and maps accepted edges back to the original local -keys. Surface projections use each route's exact `destination_id`; they do not -reinterpret a local route key as a destination or global edge ID. - -## The mutation vocabulary - -`WorldMutation` is a closed tagged union. Each variant owns one semantic -component family and names the invariants that family can enforce. There is no -`SetField`, arbitrary path, embedded patch, or model-authored component name. - -| Mutation | Canonical effect | Essential validation | -| --- | --- | --- | -| `Relocate` | Changes occupancy for an exact subject. | Origin matches, route/reach exists, mover has authority, group custody and travel approval hold. | -| `TransferCustody` | Moves an exact resource between custodians. | Source has custody, recipient exists and can receive it, quantity/identity is conserved. | -| `MutateResource` | Creates, transforms, consumes, damages, repairs, splits, or combines exact resources. | Recipe/capability, custody, conservation, lifecycle, quantity, and effect ceiling hold. | -| `ChangeCapability` | Grants, alters, suspends, or retires a supported capability. | Source of capability and duration are admitted; no narration-only expertise. | -| `ChangeCondition` | Applies, alters, or clears a condition. | Target is reachable, condition is compatible, opposition and outcome band permit it. | -| `ChangeCommitment` | Creates, alters, fulfills, defaults, or retires a goal or obligation. | Exact owner, counterparty, consent or coercive authority, and lifecycle hold. | -| `ChangeRelationship` | Creates, alters, or retires a directed relationship component. | Exact endpoints exist; one actor cannot author another's private appraisal without its own reaction authority. | -| `ChangePressure` | Creates, advances, reduces, resolves, or retires a bounded pressure. | Owner, bounds, current value, threshold, and consequence are exact. | -| `ChangeKnowledge` | Acquires, communicates, conceals, corrects, or invalidates a proposition for exact knowers. | Source knows or can observe it, channel and recipients are exact, concealment does not erase another mind. | -| `ChangeMemory` | Records, revises, or retires an exact private episodic memory. | Witness or authorized private appraisal exists; another actor cannot write it. | -| `ChangePosture` | Alters the posture of an exact agentive subject. | The acting authority can speak or decide for that subject; arenas cannot use it collectively. | -| `ChangePopulationMembership` | Joins, leaves, or transfers an exact actor between populations. | Member identity is stable, source membership exists, destination is compatible, no duplicate coverage. | -| `ChangePopulationLineage` | Records an admitted split, merge, or remainder relation. | Fission preview and approval exist; leaves remain non-overlapping and complete. | -| `ChangeIdentity` | Adopts, discloses, restricts, or retires an exact identity handle. | Self-authority or explicit custody exists; disclosure is separate from renaming. | -| `ChangeTopology` | Adds, alters, opens, closes, or retires a containment or route edge. | Evidence/branch admission, endpoint existence, reciprocal rules, and geometry invariants hold. | -| `CivicSystemSet` | Publishes the complete versioned civic apparatus for one jurisdiction. | The jurisdiction, institutions, resident populations, public civic propositions, political relations, version, and exact semantic-verifier receipt all exist in the accepted component overlay. | -| `AdmitEntity` | Creates an explicitly permitted non-resource subject and initial components. | Admission class, evidence or branch-local authority, collision freedom, and required components hold. | -| `RetireEntity` | Retires an exact subject without erasing history. | No dangling custody, occupancy, membership, topology, or active obligation remains. | -| `AdvanceWorldTime` | Advances campaign time by an exact duration. | Monotonicity, governance, no-puppeting, tick budget, and scheduled obligations hold. | - -`NoMaterialChange` is not a mutation. It is an outcome with an empty mutation -batch and an explicit explanation. Speech is an event in the means record; -persuasion, obligation, relationship, and knowledge consequences are separate -mutations. - -Governed time, travel, and resolution-budget proposals persist approvals before -their unanimous finalization. A fully approved but uncommitted proposal is a -retryable commit request: any already-approved active member may invoke its -advertised approval operation again, and the kernel revalidates the exact world -and governance boundary before attempting the same atomic finalization. A -duplicate vote on a proposal that is not unanimous is still rejected, and a -committed or stale proposal can never replay. - -Complex effects are batches, not new verbs. Giving half a medicine lot to a -clinic composes resource split, custody transfer, and perhaps an obligation. -Evacuating a named refugee composes relocation, population-membership transfer, -and accessible knowledge. Population fission composes entity admission, -lineage, exact member transfers, and one custody transfer per scarce resource -while preserving an `other/unknown` remainder. Capabilities, shared knowledge, -goals, and active pressures inherit through the lineage reducer. Resources do -not: every parent resource must be assigned to exactly one child in the -approved preview, so aggregation cannot mint a granary for every ideological -subgroup. - -### Within-horizon course ordering - -A strategic choice is one atomic endpoint transaction, but its observable -means may straddle one admitted relocation. `WorldKernel` derives the only -within-horizon ordering from exact occupancy and effect locations: - -1. activities at the subject's snapshot location occur before relocation; -2. the admitted relocation or population migration occurs next; -3. activities at the exact admitted destination occur after arrival. - -Distinct activity kinds inside one location phase remain an unordered atomic -set. Activities spanning several locations without one unambiguous phase also -remain simultaneous at the strategic resolution of that subject. The model -does not emit phase labels, sequence numbers, or prose-authored timing; effect -array and object field order are not authority. An unrelated activity location -still fails exact spatial validation. - -This derived order owns chronological event lowering only. The mutation batch -still owns one indivisible final state, and every permit is compiled from the -same pre-wave snapshot. A failed phase, outcome, or mutation therefore aborts -the complete wave rather than leaving a subject halfway through its course. -The old blanket assumption that every movement precedes every activity is not -an owner and must not survive in Projector, Interpreter, verifier, or kernel -guidance. - -Foreground assessment uses the same authority-shaped contract principle. Its -model schema contains only mutation lanes available in the current snapshot: -no route means no movement lane, no accessible undisclosed proposition means -no existing-fact acquisition lane, and absent clocks or institutions remove -their lanes. A separate observation lane is always structurally available to -the acting actor but is semantically admitted only when the exact local means -can directly perceive, measure, inspect, or test the proposed result. It lowers -to one branch-local proposition admission followed by exact knowledge -acquisition in the same batch. The effect ceiling, semantic verifier, current -location, acting actor, assessment receipt, and means digest bind that finding; -the lane cannot author remote events, hidden motives, unsupported identities, -or omniscient conclusions. Empty or unused maps may be omitted and deserialize -to no mutation. The closed dynamic schema rejects an unavailable lane even when -the model tries to emit it as `null`; provider formatting cannot manufacture -authority. - -## Means, intended effect, and committed mutation - -### Means - -`ActionMeans` records what is attempted and may become observable: - -- exact acting subject; -- bounded natural-language method; -- exact targets, instruments, resources, places, routes, and channels cited - from the actor's permitted slice; -- explicit speech, if any; -- state and evidence references supporting the method. - -The means taxonomy is intentionally open at the prose level. Ghostlight does -not need a rulebook verb for every clever action. The exact typed references -make reach, custody, knowledge, and capability testable. - -### Intended effect - -`MutationIntent` names desired component families, targets, and qualitative -direction. It is useful for assessment and cognitive focus, but it is not an -assertion that the change occurred. A player may intend to persuade a guard, -destroy a reactor, learn a route, or move a crowd without receiving any of -those mutations. - -### Committed mutation - -The admitted outcome procedure emits a concrete `WorldMutationBatch` bounded -by its authority envelope. The batch is the only one of the three objects that -can become state. A roll changes which digest-bound outcome plan is eligible; -it does not allow the resolver to invent a stronger mutation afterward. - -For Sable's self-presentation: - -- means: the refugee speaks an exact self-presentation to present listeners; -- intended effect: those listeners may address this person using `Sable`; -- committed mutations: `ChangeIdentity::AdoptHandle` only if the speaker is - choosing a new handle, followed by `ChangeIdentity::DiscloseHandle` or - `ChangeKnowledge::Communicate` to exact listeners; -- derived projection: each listener's Eve surface displays the best identity - handle that listener actually knows. - -The speech never authorizes a global actor rename, and a display label never -becomes identity authority. - -## Mutation authority envelopes - -An admission policy compiles `mutation_authority_envelope.v1` from the current -snapshot. It contains exact permits, not broad roles: - -- campaign revision and relevant component versions; -- originating subject and resolution procedure; -- permitted mutation kind and operation; -- exact subjects, routes, resources, propositions, channels, and relationships - available to that operation; -- numeric and cardinality bounds; -- extraordinary-permission or approval receipts; -- effect ceiling and outcome-band binding; -- expiry and digest. - -The envelope is capability-like but not transferable. It can authorize one -assessment outcome, one reaction appraisal, one strategic action, or one -administrative command. It cannot be rebased onto a new revision. - -### Action-specific model schemas - -The model never receives the complete world mutation schema. Ghostlight first -selects the component families relevant to the intended effect, then generates -a compact schema from the exact permits: - -- if no resource is transferable, no custody-transfer branch exists; -- if the actor cannot reach a target, that target does not appear; -- if the actor knows no communicable proposition, communication is absent; -- if an arena has no collective actor, collective posture and speech are - absent; -- if the outcome cannot create an entity, admission is absent; -- scalar fields carry local limits rather than universal ranges. - -Each generated branch carries an opaque permit ID. The kernel resolves that ID -back to the exact permit and revalidates it against the snapshot. Stable -instructions and mutation definitions precede the dynamic permit table so -provider caching remains useful; the dynamic prompt contains only the state -needed for this decision. - -Schema generation improves model ergonomics. It does not replace local -validation, and schema presence is not authority by itself. - -## Validation and atomic commit - -The commit primitive performs this sequence: - -1. Verify campaign revision, resolution epoch when present, originating receipt, - envelope digest, expiry, and idempotency. -2. Resolve every subject and component against the same snapshot. -3. Verify every mutation has a matching unused permit and remains inside its - exact IDs, operations, bounds, and effect ceiling. -4. Validate local semantics: reach, custody, knowledge provenance, authority, - component applicability, and lifecycle. -5. Validate batch semantics: no contradictory writes, no resource duplication, - no dangling entity retirement, no duplicate population membership, and no - hidden cross-actor private writes. -6. Apply the entire batch to an isolated in-memory overlay. -7. Re-run global topology, custody, population coverage, player-control, - knowledge, and temporal invariants on the overlay. -8. Persist component rows, events, mutation receipt, command receipt, and - required private proof records in one CultCache transaction. -9. Publish refreshed Eve/CultMesh projections after the transaction commits. - -Any error returns the original state byte-for-byte. A malformed model output -gets one same-snapshot correction and then aborts. No valid sibling mutation -survives an invalid batch member. - -## Admission policies are separate from physics - -The shared algebra does not make every actor equally powerful. Each lane has a -different authority compiler: - -- foreground fiction-first d20 assessment considers declared means, local - affordances, opposition, permissions, stakes, and effect ceiling; -- reaction appraisal can write only the reacting subject's private components - plus exact speech/action proposals; -- NPC initiative uses the same foreground assessment after initiative chooses - an eligible proposal; -- strategic cells use horizon, graph reach, institutional authority, resources, - and resolution-cell attribution; -- cohesive Gestalts may receive collective permits only from real collective - authority; -- arena cells receive constituent permits and cannot emit one arena-owned - mutation; -- compiler and approval commands may admit entities or topology only through - explicit evidence and branch-local gap policy. - -Different admission does not imply different mutations. A player and an -institution transferring the same medicine use the same custody mutation. - -## Migration from the empirical vocabularies - -The accumulated variants are test requirements, not discarded knowledge: - -| Existing behavior | Algebraic lowering | -| --- | --- | -| actor move / member migration / Gestalt migration | `Relocate` plus membership change when population affiliation changes | -| actor equipment / institution resources / Gestalt resources / member equipment | resource subjects plus `TransferCustody` and `MutateResource` | -| actor or member condition | `ChangeCondition` | -| actor goal / member obligation | `ChangeCommitment` | -| actor or member relationship | `ChangeRelationship` | -| world clock and Gestalt pressure | pressure subjects plus `ChangePressure` | -| actor knowledge / Gestalt shared knowledge / member knowledge | `ChangeKnowledge` with exact proposition and knower | -| member memory / reaction memory | `ChangeMemory` | -| institution posture / strategic posture | `ChangePosture` | -| Gestalt promotion and folding | resolution change over one stable actor plus explicit component mutations only | - -Migration order: - -1. Publish types, component applicability, permits, batch validation, receipts, - and property tests without changing live state. -2. Lower foreground assessment and NPC resolution directly to mutation batches; - delete `apply_world_effect`. -3. Lower reaction Interpreters to actor-private permits and mutation batches; - delete direct `ActorStateDelta` writes. -4. Lower strategic outcome generation to the same operations; delete - `apply_strategic_outcome_effect` and string-resource helpers. -5. Classify named-person materialisation as a resolution transaction, remove - aggregate mutation from folding, and invalidate the active cover. Complete. - Normalizing remaining legacy member fields into component rows remains. -6. Lower travel, waits, fission, and bounded expansion. Classify initial - publication as an empty-store creation transaction rather than a world - mutation. Complete. -7. Migrate persisted campaign rows transactionally, quarantine ambiguous legacy - resources or identities, and make the old campaign fields projection-only. -8. Remove legacy schemas from model boundaries. Retain schema readers solely - for historical receipt inspection. - -At every stage, the old and new writers cannot both be active for the migrated -lane. - -## Agency corpus - -Ghostlight does not declare the algebra complete from enum aesthetics. It owns -an inspectable `agency_attempt_case.v1` corpus compiled into a MessagePack -CultCache store. JSON Schema publishes the record shape; authored source may be -reviewed Markdown, but runtime and test fixtures load `.cc`. - -Each case records: - -- domain and scenario; -- minimal world fixture and exact subjects; -- means and intended effect; -- expected admission: admissible, impossible, or bargain-required; -- required mutation composition by outcome band; -- forbidden mutations and invariant witnesses; -- expected bargains for missing permission or affordance; -- whether foreground, NPC, strategic, and Gestalt resolutions should be - physically equivalent; -- reviewer status and any genuinely missing primitive. - -The initial target is at least 300 reviewed attempts: 25 each across social, -physical, investigative, economic, political, technological, extraordinary or -magical, collective, identity and privacy, population and migration, -infrastructure and logistics, and bodily or medical play. Cases include both -ordinary and adversarial attempts, partial successes, indirect means, consent -boundaries, rival actors inside arenas, and low-resolution background outcomes. - -Completeness gates: - -- every case maps compositionally, yields a comprehensible bargain, or names a - genuinely missing primitive; -- no case falls through to a generic patch or arbitrary component write; -- the same physical change uses the same mutation in foreground, NPC, member, - population, institution, and arena-constituent contexts; -- property tests prove atomicity, deterministic permit/schema generation, - resource conservation, stable identity, exact knowledge ownership, population - coverage, topology integrity, and no puppeting; -- the final 100 newly reviewed admissible cases require no new primitive. This - is a stability signal, not a mathematical proof of completeness. - -The Sable self-presentation and later rematerialization is a mandatory first -case. It must prove observer-relative identity projection without a global -rename or loss across Gestalt folding. - -## Public contracts - -Add: - -- `typed_subject.v1` -- `world_component_ref.v1` -- `action_means.v1` -- `mutation_intent.v1` -- `mutation_permit.v1` -- `mutation_authority_envelope.v1` -- `world_mutation.v1` -- `world_mutation_batch.v1` -- `world_mutation_receipt.v1` -- `agency_attempt_case.v1` - -JSON Schema is the catalog boundary. Canonical component rows, envelopes, -batches, receipts, and corpus fixtures use MessagePack-backed CultCache `.cc`. -JSON remains acceptable only at browser, MCP, and model-provider boundaries. - -## Acceptance - -The algebra cut is complete only when: - -- no production path calls a legacy effect writer; -- every effectful command persists an exact mutation receipt; -- malformed, stale, over-broad, contradictory, or partially valid batches leave - state, fictional time, and projections unchanged; -- background and foreground versions of the same action pass the same component - invariants; -- arena rivals cannot speak or mutate as one subject and cannot acquire one - another's knowledge; -- resource custody and quantity are conserved across transfers and failures; -- named people remain the same subjects through Gestalt merge, split, migration, - folding, and rematerialization; -- Sable's disclosed handle appears only to entitled observers and survives the - complete round trip; -- action-specific schemas omit impossible operations before inference; -- the agency corpus meets its coverage and stability gates; -- adversarial play through the typed Eve surface still proves the homepage - promises after migration. diff --git a/docs/architecture/illustrated-if-visual-pipeline.md b/docs/architecture/illustrated-if-visual-pipeline.md deleted file mode 100644 index e9e2801..0000000 --- a/docs/architecture/illustrated-if-visual-pipeline.md +++ /dev/null @@ -1,85 +0,0 @@ -# Illustrated IF Visual Pipeline - -Illustrated interactive-fiction fixtures can use image generation for mood, -presentation, and website replay. They should not treat image generation as the -source of spatial truth. - -## Role - -The visual pipeline has four separate jobs: - -1. Describe the playable visual beat in the Ink and `.visual.json` artifact. -2. Preserve the intended environment, character, and branch state as structured - visual data. -3. Provide image models with enough concrete visible detail to render the beat. -4. Keep generated art useful as presentation collateral without letting it - rewrite scene geometry. - -Visual artifacts are auxiliary replay and website value. They are not core -training targets for responder, appraiser, mutator, relationship, or social -state models. - -## Geometry Authority - -For scenes where spatial continuity matters across angles, branches, or later -callbacks, the authoritative visual source is a `scene_set` artifact, not a -generated image. - -A `scene_set` may be a hand-built 3D blockout, a procedural scene file, a -layout diagram, or another durable geometry asset. It should define: - -- Environment layout and scale. -- Named zones, routes, entrances, exits, and occluders. -- Fixed cameras or camera-slot names for replay beats. -- Character staging slots and allowed movement regions. -- Important props, access points, interfaces, and branch-visible state anchors. -- Which parts of the set are visible from each camera. - -Generated environment concept art can inspire the set, but it is not a reliable -layout contract. Image models routinely invent impossible joins, inconsistent -occlusion, false loops, and locally plausible machinery that cannot be staged -from a second angle. - -Agent-assisted set construction may live in a separate toolchain such as -VibeGeometry. Ghostlight only requires the resulting durable geometry input and -the metadata needed to connect it to fixture scenes. - -## Prompt Assembly - -Prompt assembly should use the geometry source appropriate to the fixture: - -- Mood concept only: text prompt may be enough. -- Single isolated illustration: a complete standalone prompt may be enough. -- Multi-scene illustrated IF: use `.visual.json` scene ids, character refs, and - branch modifiers. -- Multi-angle or branch-consistent illustrated IF: use a `scene_set` render or - blockout for each camera angle, then apply the scene prompt as painterly - direction. - -For the multi-angle path, the image model acts as a painter and material -interpreter. It does not decide the room shape. - -## Base Images And Modifiers - -Base prompts describe a complete visible frame. Modification prompts describe -only the branch or state delta, but the edit call must receive the base image or -the camera-specific blockout as visual input. - -Do not rely on phrases such as "same room" or "as before" unless the edit input -actually supplies the same room. If the image model only receives text, restate -the visible geometry. If it receives a blockout, the prompt should still name -the visible anchors it must preserve. - -## Reviewer Expectations - -The visual reviewer should ask whether the current fixture needs a `scene_set`. -It should require one when: - -- The story returns to the same room from multiple angles. -- Branches move characters around a shared environment. -- Sightlines, occlusion, route access, or body affordances affect choices. -- The same space needs website imagery across several beats. -- A generated concept image is being used as if it were a durable floor plan. - -When a `scene_set` is required but missing, the fixture can still be accepted as -prose or IF scaffold, but not as replay-ready illustrated IF. diff --git a/docs/architecture/ink-branching-scenes.md b/docs/architecture/ink-branching-scenes.md deleted file mode 100644 index 5154830..0000000 --- a/docs/architecture/ink-branching-scenes.md +++ /dev/null @@ -1,498 +0,0 @@ -# Ink Branching Scenes - -Ink is the branching scene format. - -Ghostlight should not invent a parallel dialogue-tree language unless Ink -fails a concrete requirement. Ink already gives us readable interactive fiction, -choices, knots, stitches, variables, compiled JSON, and a format writers -can inspect without needing to wear a compiler helmet indoors. - -Ghostlight's job is the machinery around Ink: - -- build actor-local awareness from agent state and scene state -- project plausible speech and non-speech choices -- save generation receipts when a model proposes branches -- annotate why those choices make sense -- preserve listener interpretation as separate from actor intent -- record consequence surfaces for later state mutation -- keep fuzzy social updates reviewed until there is training data -- compile Ink into game-consumable JSON - -Ink owns the playable branch structure. Ghostlight owns the psychological, -cultural, memory, relationship, and consequence rationale. - -## Runtime Shape - -The artifact flow is: - -```text -agent state + scene state + lore grounding - -> local awareness - -> projected branch choices for the acting character - -> selected branch as observable action - -> event resolution from selected observable action - -> participant appraisals and reviewed state mutation - -> next actor local awareness from updated state - -> next actor action - -> Ink scene - -> compiled Ink JSON - -> reviewed training annotations - -> selected branch consequences - -> state, memory, belief, and relationship updates -``` - -The Ink file should be readable as Aetheria content on its own. The sidecar -training annotation should explain which Ghostlight state produced each branch -and which consequences are automatic, reviewed, or deferred. - -Each character turn must be generated from that character's local awareness. -The protagonist-choice generator should not receive the responder's private -state. The responder generator should not receive the protagonist's private -intent except as an observable action, spoken text, gesture, object use, -silence, or other perceivable cue. A listener is allowed to misunderstand. - -Participant appraisal is symmetrical. If an action hurts, threatens, reassures, -humiliates, obligates, or overloads anyone present, that change is consolidated -for the affected character before the next actor is selected. The next actor may -reply, walk away, comply, escalate, or end the interaction. A branch artifact can -still display this as `choice -> reaction`, but Ghostlight should model it as -turns over updated state, not as a mandatory paired response. - -One-shot generation of both sides is allowed only as bootstrap scaffolding, and -must be marked as such in the capture review. It is not the target runtime -shape. - -The current target path is source-grounded coordinator state, projected local -context, reviewed character turns, branch compiler materialization, and IF -artifact review. - -## Ink Comments - -Use Ink comments for lightweight traceability in writer-facing drafts: - -- `ghostlight.scene` -- `ghostlight.fixture` -- `ghostlight.branch` -- `ghostlight.action` -- `ghostlight.intent` -- `ghostlight.npc_response` -- `ghostlight.consequence` -- `ghostlight.training_hook` -- `aetheria.flashpoint` - -Use `//`, not Ink tags (`#`), for this metadata in drafts. Inky exposes tags in -preview, which makes Ghostlight state leak into the readable scene. The -sidecar remains the machine-readable receipt; comments are only local handles -for humans and simple tools. - -## Sidecar Annotations - -Each Ink scene should have a `.training.json` sidecar with: - -- source fixture reference -- protagonist and NPC ids -- actor-local awareness summary -- projection controls -- branch ids and Ink knot paths -- action type and actor intent -- state basis -- reviewed consequences -- training hooks -- mutation policy - -This sidecar is intentionally not a new branching format. It is a receipt. Ink -remains the scene tree; the sidecar says why the tree grew that way and which -state changes a reviewer accepted. - -Visual planning should live beside the sidecar, not inside it. Use a separate -`.visual.json` artifact for illustrated replay data: style cue, visual scene -anchors, image prompts, character refs, prompt assembly rules, and visual -modifiers. The training annotation may reference that file with -`visual_plan_ref`, but it should remain focused on branch semantics and -mutation surfaces. - -## Mutation Policy - -Ink variables can record local playthrough outcomes. They should not silently -become canonical Ghostlight state. - -Automatic: - -- Ink compilation -- branch id and knot validation -- local variables for the current playthrough -- mechanical comment handles and training hook checks - -Manual reviewed until trained: - -- relationship deltas -- belief updates -- memory writes -- listener misread classification -- activation changes -- promotion from branch outcome into durable Aetheria lore - -The current accepted-as-draft scaffold lives in -`examples/ink/pallas-species-strikes.branch-and-fold.v0.ink`. - -## Cross-Scene Consequence Carryover - -Ghostlight branching scenes should not behave like disconnected dialogue samples. -Interactive fiction needs consequences that survive the scene boundary. A branch -choice should write durable effects into later context: relationship stance, -perceived motives, resource costs, authority flags, object custody, active -constraints, unresolved hooks, and available future options. - -For training data, every material branch should preserve: - -- the player/NPC-visible choice or action -- the immediate responder output -- accepted world-state, resource, memory, and relationship deltas -- branch flags that later scenes must read -- deferred consequences that should surface later rather than immediately -- scene text showing how the consequence changes the feel of the next beat - -The coordinator owns this continuity for now. Later, the trainable coordinator -model should learn to carry these consequences forward without flattening them -into cosmetic callbacks. If a choice does not change later affordances, trust, -resources, risk, or interpretation, it is probably not a meaningful branch. - -A complete interactive fixture needs an ordinary-world opening, consequential -branches before the crisis peak, and a resolution that visibly reflects earlier -choices. A single tense exchange can prove a seam; it is not enough to prove the -story machine. - -## Branch And Fold - -Do not model every choice as an indefinitely isolated authored subtree. Strict -worldline splitting creates a combinatoric writing burden after a handful of -choices, which interactive fiction authors have been discovering the painful -way since approximately the first time someone let a player open a second door. - -Ghostlight should branch locally and fold structurally: - -```text -choice - -> consequence packet - -> normalized state deltas - -> shared later scene reads compact variables - -> conditional options, callbacks, imagery, and relationship texture - -> major route split only when convergence would be false -``` - -Most branches should converge onto shared later scenes. The consequences should -survive as compact variables, bands, and flags rather than bespoke scenes for -every exact history. - -Good consequence state looks like this: - -- `sella_trust_maer: wary` -- `ledger_debt_level: high` -- `clinic_staff_exhaustion: true` -- `veyr_evidence_disclosed: partial` -- `isdra_reads_maer_as: procedurally_dangerous` -- `route_authority_pressure: escalated` - -Those variables should alter later scenes by changing available options, -relationship posture, timing pressure, resource costs, callback prose, visual -state modifiers, and participant appraisals. They should not usually require a -fully separate scene route. - -Use coarse bands instead of fake precision. `blocked`, `wary`, `conditional`, -`cooperative`, and `personally_invested` are more useful than pretending the -story can meaningfully maintain 37 decimals of trust. The same applies to heat -debt, legal exposure, institutional pressure, staff exhaustion, reputation, and -social suspicion. - -Major route splits are allowed when a consequence changes the playable world so -much that folding would lie. Examples: - -- a character dies, leaves, defects, or becomes unavailable -- a location is destroyed, locked, opened, or politically inaccessible -- a faction becomes hostile, allied, exposed, or legally empowered -- a key object is destroyed, stolen, transferred, or transformed -- the protagonist loses or gains institutional authority -- a quest route, rescue path, market, technology, or branch-local future opens - or closes entirely - -The coordinator owns the fold decision for now. Every material branch should -record whether it folds into an existing later scene, opens a conditional -variant inside that scene, or creates a justified route split. If a route split -is created, the artifact should name the reason and the expected future writing -debt. Trees are cheap to grow and expensive to prune. The machine should not -act surprised by botany. - -## Branch Compiler - -The Branch Compiler is the organ that turns Ghostlight scene intent into a -playable Ink artifact. It is not the character agent, the responder, the -appraiser, or the final reviewer. It assembles branch structure from already -available scene state, projected actor affordances, proposed actions, accepted -consequence packets, and coordinator constraints. - -The Branch Compiler receives: - -- fixture brief and scene spine -- source-grounded lore digest -- current world, scene, resource, relationship, and branch state -- actor-local branch candidates, including speech and non-speech actions -- responder outputs or coordinator-authored placeholder reactions -- consequence packets from reviewed turns -- branch-and-fold plan -- visual continuity requirements -- schema and Ink formatting constraints - -The Branch Compiler emits: - -- readable `.ink` scene content -- Ink variables, knots, stitches, choices, gathers, and conditionals -- a `.training.json` sidecar tying each branch to state basis, action intent, - consequence surfaces, and later callbacks -- compiler notes for fold decisions, route-split decisions, and known review - risks -- image prompt anchors and branch/state modification handles when the fixture is - meant for illustrated output - -The Branch Compiler may propose structure. It must not invent hidden character -truth, private motivations, or durable social mutations as if compilation made -them real. Character behavior comes from projected local context and responder -or coordinator-authored action proposals. Social interpretation and memory -changes come from appraiser/mutator review. The compiler's job is to make the -branching artifact playable, legible, and traceable. - -The compiler should prefer compact state variables, bands, and flags over -runaway branch trees. It should create major route splits only when the -coordinator or reviewed consequence packet says folding would falsify the -world. When it folds branches, it must preserve the variables and callbacks that -make the fold honest. - -The Branch Compiler output is draft until the IF Artifact Reviewer accepts it. -That separation matters. A compiler can make a scene valid Ink while still -producing cosmetic choices, fake folds, unused variables, or endings that ignore -the whole moral machinery. Valid syntax is not wisdom. It is barely hygiene. - -## IF Artifact Review - -Branching fixtures need an independent review pass before acceptance. The -coordinator should not be the only thing grading its own Ink, sidecar, and -branch logic. That is how a scene ends up proudly tracking variables that do -nothing except sit there in a tiny uniform. - -The reviewer may start as a prompted specialist sub-agent. Later it should -become evaluator/classifier training data and eventually a trainable review -organ. Its job is not prose polish. Its job is to catch false consequence. - -The reviewer receives: - -- the Ink file -- the `.training.json` sidecar -- the coordinator artifact -- the intended branch plan, when available -- the declared state variables, flags, bands, resources, risks, and visual - modifiers -- any compiled Ink or validation output available for the fixture - -The reviewer emits: - -- `accepted`, `needs_revision`, or `rejected` -- severity-ranked findings -- a fake-variable audit -- a choice-consequence audit -- a fold/callback audit -- a state-gated prose audit -- a visual-continuity audit -- major-route-split justification notes -- specific required fixes - -Acceptance requires every material choice to change at least one later surface: - -- available options -- scene route or justified route split -- relationship, trust, appraisal, or social standing -- resource cost, time pressure, legal exposure, authority pressure, heat burden, - exhaustion, or other risk -- object custody, evidence quality, access, or technology state -- later callback prose implemented as an actual conditional -- ending texture or outcome band -- visual state modifier tied to a real branch flag or state variable - -Every declared variable must either be read later or be marked as telemetry-only -in the sidecar. Ominous variables need threshold behavior. If a variable named -`authority_pressure` rises and nobody with authority ever reacts, the artifact -fails review. If `heat_time` counts down and no route, ending, resource cost, or -staff condition changes, the artifact fails review. The name is allowed to be -dramatic only if the machinery has teeth. - -Any prose that says "if X happened" must be implemented as an actual conditional -or moved into reviewer/coordinator notes. Writer-facing text should not name a -branch possibility while dodging the state check that proves which version of -history occurred. - -Common failure labels: - -- `potemkin_state`: a tracked variable never materially changes the artifact -- `cosmetic_choice`: a choice changes wording but not affordance, cost, risk, - appraisal, callback, visual state, or outcome -- `missing_state_read`: a set variable is never read by later Ink, sidecar, or - coordinator consequence logic -- `fake_fold`: branches claim to fold, but the folded scene ignores their state -- `unearned_convergence`: branches converge despite consequences that should - make convergence false -- `unjustified_route_split`: a separate route exists without enough world or - story consequence to justify the writing debt -- `state_named_instead_of_checked`: prose mentions alternate branch states - instead of checking variables -- `visual_callback_missing`: image modifiers or visual prose ignore branch - consequences that should be visible -- `authority_without_consequence`: institutional pressure rises but never bites -- `resource_without_cost`: ledgers, heat, staff time, supplies, or access are - invoked without affecting later choices or outcomes -- `ending_ignores_major_state`: the ending does not respond to major variables - established earlier - -Early branch-and-fold review exposed this exact class of failure: variables can -look important while doing nothing. Review must force important variables to -alter gates, callbacks, visuals, appraisals, or outcomes before a fixture enters -the accepted corpus. - -## Scene Imagery - -Ghostlight scenes are also website content. A complete fixture should emit a -visual plan artifact alongside prose and training receipts so story branches can -be illustrated without a later model guessing what the room looked like. - -Interactive fiction replay also needs screen rhythm. A narrative scene may move -through several visual sections: establishing shot, workstation, break table, -object closeup, alarm state, crowd line, supervisor arrival, aftermath. These -should be segmented so an InkJS replay can click through the scene at the pace -the story needs. A pivotal beat may be a single sentence on its own screen when -the point is to let the image and silence do the work. - -Each distinct visual section should preserve an art-direction block with: - -- global style cue: the fixture-level visual language when the art direction - depends on a specific non-default look -- establishing shot: location, scale, camera distance, and dominant geometry -- light and color: practical light sources, palette, exposure, haze, glare, - reflection, water, vacuum, screen glow, or other atmosphere -- bodies and interfaces: how each relevant body occupies the space, including - nonhuman access, assistive infrastructure, suits, avatars, wet/dry boundaries, - displays, tools, and machinery -- material evidence: objects, damage, records, ledgers, cargo, alarms, clothing, - stains, frost, heat shimmer, or other concrete traces of what has happened -- branch marks: visible changes caused by earlier choices, such as a sealed - hatch, an exhausted staffer, a live debt ledger, missing equipment, guarded - posture, or a route marker left blinking -- base image prompt: one stable prompt for the unbranched scene, suitable for - generating the reusable background or canonical key frame -- branch modification prompts: additive edit prompts for visible consequences, - changed character positions, opened or sealed routes, damaged objects, - lighting changes, emotional posture, crowd pressure, or other scene states - -Named characters need stable visual references. An image model does not know -what Lio Vale looks like because the prose named Lio Vale. Each illustrated -fixture should define `visual_character_refs` for recurring named characters: -body type, apparent age range if relevant, face/hair/skin or equivalent visual -identity, clothing and equipment, silhouette, posture language, and -`do_not_change` continuity details. Scene prompts may then reference those -character refs instead of repeating the whole description every time. - -Prompts must be imagegen-ready. Do not rely on unexplained Aetheria jargon as -if the image model knows the lore. If the prompt says "wet-service cradle" or -"dry-operation harness," it should also describe the visible thing according to -the faction, location, and labor regime. A Navigator comfort habitat and an AU -industrial yard should not quietly become the same room. If a scene uses a -biodrone limiter interface, cavity seal assembly, or life-support bypass kit, -describe the shape, scale, materials, lights, cables, seals, or displays that -make it drawable. - -The same rule applies to environments. "Manifold line," "cavity yard," -"supervisor glass," and "anchor rail" are not images by themselves. A base -prompt should describe the physical space a general image model can draw: -corridor shape, wall/ceiling/floor geometry, pipe runs, cable bundles, panels, -screens, rails, doors, windows, gauges, warning lights, materials, scale, and -where bodies stand inside that geometry. - -Image prompts should be affirmative. Describe the desired geometry, material, -composition, lighting, bodies, tools, and state. Negative prompt constructions -such as "do not draw X," "without X," or "rather than X" tend to feed the image -model the wrong object and then hope it obeys the minus sign. That is weak -magic. Put the target in the prompt, and keep forbidden assumptions in reviewer -notes or validation errors. - -For Aetheria Bloom habitats, prompt the engineered object directly: rotating -cavity-shell infrastructure, consolidated asteroid rubble/debris, TCS -substrate, shell plating, ribbed supports, seals, hub/spoke interfaces, -manifolds, and service systems. Source-specific exceptions should be represented -as their own positive visible description. - -Every visual section should identify: - -- `visual_scene_id`: stable handle for the screen or key frame -- `ink_anchor`: knot, stitch, or comment handle where the visual applies -- `base_image_prompt`: durable scene prompt for the unmodified frame -- `visible_characters`: characters allowed in the frame and their default - position or stance, plus a `visual_ref` when the character is named -- `state_image_modifiers`: additive prompts tied to explicit variables, - thresholds, or route flags -- `branch_image_modifiers`: additive prompts tied to specific branch ids -- `visual_continuity_notes`: facts that must remain stable across edits - -Prompt assembly for illustrated replay should combine: - -```text -global style cue - + visual_character_refs for named characters actually visible in this rendered frame - + visual section base_image_prompt - + triggered state or branch image modifiers -``` - -The base image prompt is allowed to focus on the room and staging only if the -assembled prompt includes the relevant character refs. If a tool sends the base -prompt alone to imagegen, the base prompt must carry enough character detail by -itself. The same applies to visual style: if a fixture depends on a specific -look, the assembled prompt must carry that style cue every time. Names are -handles, not faces. - -Keep `visual_continuity_notes` out of assembled image prompts. They are tooling -and review constraints for keeping repeated generations coherent. If a -continuity fact needs to reach the image model, rewrite it as affirmative, -concrete visible prompt text in the base prompt, a character ref, or a -branch/state modifier. -The image generator only sees the prompt you send it. It does not remember the -previous scene unless a real image-editing workflow supplies that image as -input. - -The coordinator owns this surface for now. The responder should not receive -omniscient visual art direction unless the character can observe it. Character -packets may receive the local visible subset: what this actor can see, hear, -touch, smell, monitor, or infer from their interface. - -Visual continuity is part of consequence carryover. If an earlier branch cost -heat, trust, time, equipment, or social standing, the later scene should show -that cost somewhere on the page or in the frame. Otherwise the choice may be -mechanically recorded while still feeling fake, which is the stupid little -trapdoor interactive fiction keeps setting for itself. - -When continuity matters, use one durable base visual prompt and branch/state -modification prompts that describe only what changed. The base prompt owns the -room, palette, dominant geometry, key props, bodies, and interface layout. A -modification prompt owns the delta: Sella moves from the dryside console to the -decon sleeve, the route marker flips from amber to white, a wet access hatch -seals, an exhausted staffer appears behind the glass, Maer's ledger panel gains -a live debt line. - -Keep these prompts separate from canonical prose: - -- `base_image_prompt`: stable scene anchor -- `state_image_modifiers`: reusable prompts for common scene states -- `branch_image_modifiers`: prompts tied to specific branch ids -- `visual_continuity_notes`: non-prompt reminders about what must remain stable - -Image edits are allowed to stylize, compose, and beautify. They are not allowed -to silently change canonical facts. If an edit introduces a new visible object, -body affordance, damage mark, or faction symbol that was not in the scene state, -the coordinator must either reject it, mark it as noncanonical illustration -noise, or promote it through the normal reviewed lore/state path. The picture -does not get to smuggle a gun onto the mantel just because it had a strong -personal brand that morning. diff --git a/docs/architecture/lore-grounding-digest-format.md b/docs/architecture/lore-grounding-digest-format.md deleted file mode 100644 index 73e99d9..0000000 --- a/docs/architecture/lore-grounding-digest-format.md +++ /dev/null @@ -1,264 +0,0 @@ -# Lore Grounding Digest Format - -The lore grounding digest is the bridge between authored Aetheria history and -Ghostlight projection training. - -It distills a specific historical flashpoint into the cultural, institutional, -material, and factional pressures needed to build agent-state fixtures and -speaker-local projection prompts. - -It is not a lore replacement. It is a working slice. Do not ask every prompt to -carry the whole vault in its teeth like an exhausted dog. - -## Files - -The schema lives at: - -- `schemas/lore-grounding-digest.schema.json` - -The starter template lives at: - -- `examples/lore-grounding/historical-flashpoint.template.json` - -Use the template for the first authored historical flashpoint, then save real -digests under `examples/lore-grounding/` with names tied to the flashpoint. - -## Purpose - -A digest should answer: - -- What authored source material grounds this flashpoint? -- What history, institutions, factions, classes, roles, and material pressures - shape the scene? -- What cultural priors should affect how characters appraise events? -- What does each faction or class reward, shame, taboo, admire, and misread? -- What should each speaker know, believe, misread, or not know? -- What pressure should appear in `prompt_text`, and what should remain - author-only? - -## Main Sections - -### Source Refs - -Use `source_refs` to cite the lore archive slices that constrain the digest. -References should be specific enough that a later reviewer can find the source -without spelunking through the entire vault with a dim headlamp and a worsening -personality. - -### Historical Context - -This section describes the time, place, public facts, and ambient pressures of -the flashpoint. - -Good context is small and hard-edged: - -- a clinic policy dispute -- a contract negotiation -- an upload continuity hearing -- an unsafe FTL signoff -- a workplace discipline meeting -- a factional aid intervention - -Do not start with "the whole setting." Start with one room where history has -hands. - -### Groups - -`groups` describes factions, institutions, classes, professions, movements, or -subcultures active in the scene. - -The group profile is where broad lore becomes usable social pressure: - -- `institutional_logic`: what the group exists to preserve, control, repair, or - extract -- `material_incentives`: what the system rewards the group for doing -- `internal_virtues`: what insiders admire -- `internal_shames`: what insiders experience as disgrace -- `prestige_markers`: what reads as competence, status, holiness, care, or - discipline -- `taboo_triggers`: what provokes disgust, sanction, fear, or exclusion -- `emotional_display_norms`: what feelings can be shown, hidden, ritualized, or - punished -- `trust_defaults`: who the group tends to trust, distrust, pity, envy, use, or - fear -- `speech_register_cues`: how role and culture shape language - -This is where "Dominion types read as cold" becomes something more useful than -a hat with a sneer glued to it. - -### Cultural Pressure Fields - -`cultural_pressure_fields` are reusable pressure atoms derived from lore. - -They should not say: - -```text -Dominion people are cold. -``` - -They should say something closer to: - -```text -In this Dominion-coded role, visible personal need reads as loss of command. -Under status threat, the speaker is likely to compress emotion into procedure. -``` - -Pressure fields can represent: - -- virtue -- shame -- prestige -- taboo -- threat model -- trust default -- speech norm -- status trigger -- material incentive -- outsider stereotype - -### Factional Misread Matrix - -The misread matrix models how groups translate each other's virtues into -insults. - -Example shape: - -```text -Observer: Dominion-coded institution -Target: Aya-coded care network -Observer read: sentimental, porous, slow to impose hard necessity -Target self-read: durable care infrastructure, consent discipline, refusal to -turn people into convenient losses -Projection use: Under conflict, Dominion-coded speakers may frame Aya restraint -as weakness; Aya-coded speakers may frame Dominion decisiveness as moral -amputation. -``` - -The point is not to canonize every stereotype as true. The point is to make -misperception available as social fuel. - -### Role Pressure Fields - -Roles are not the same as factions. A Dominion auditor, a Dominion heir, and a -Dominion maintenance officer may share cultural priors while facing different -obligations and failure modes. - -Role fields should describe: - -- obligations -- available masks -- failure modes -- what authority looks like -- what disgrace looks like -- what compromises the role can justify - -### Speaker Lore Boundaries - -This section controls leakage. - -For each speaker, define: - -- known context -- beliefs -- misreads -- must-not-know facts - -If a speaker would not know a fact, it does not enter their prompt text. If a -speaker suspects something, encode it as a belief or misread with source -grounding. No little omniscient narrator gremlin in the vents. - -### Author-Only Boundaries - -Author-only boundaries constrain the fixture or future continuity but do not -enter speaker prompts. - -Examples: - -- future outcomes -- hidden institutional motives -- another speaker's private state -- facts known only to the author or simulation supervisor -- Elysium branch outcomes not yet promoted - -### Open Questions - -If the lore source is too thin, say so. Mark whether the question blocks -training. - -Do not generate training data to cover a hole that should be filled by lore -elaboration. That is not creativity; that is drywall over a load-bearing ghost. - -## Dominion And Aya Pressure Examples - -These are examples of digest structure, not final faction doctrine. - -### Dominion-Coded Pressure - -Likely ingredients to verify against source: - -- administrative continuity -- hierarchy -- AGI governance -- industrial planning -- duty under collapse -- controlled emotional display -- legitimacy through competence and command - -Projection shape: - -```text -The speaker is Dominion-coded and under status threat. They are likely to turn -distress into procedural language because visible need reads as command leakage. -They may experience compassion as legitimate only when subordinated to duty, -continuity, or strategic necessity. -``` - -Outsider misreads: - -- cold -- arrogant -- authoritarian -- morally vacant -- inhumanly procedural - -### Aya-Coded Pressure - -Likely ingredients to verify against source: - -- care as material politics -- sanctuary -- maintenance -- consent discipline -- expansive personhood -- refusal to solve suffering by writing people out of the ledger - -Projection shape: - -```text -The speaker is Aya-coded and facing coercive efficiency. They may treat care as -infrastructure rather than sentiment. They are likely to resist decisions that -make personhood conditional on convenience, even when outsiders frame that -resistance as softness. -``` - -Outsider misreads: - -- weak-hearted -- sentimental -- indecisive -- inefficient -- unable to do what reality demands - -## Promotion Rule - -A digest becomes usable for grounded training when: - -- source refs are specific -- major cultural pressure fields are filled -- factional misreads are explicit -- speaker knowledge boundaries are clear -- open questions do not block the scene -- a reviewer agrees the digest reflects authored lore rather than attractive - fog - -Only then should it feed an agent-state fixture or projection example. diff --git a/docs/architecture/persistence-spine.md b/docs/architecture/persistence-spine.md deleted file mode 100644 index c15e615..0000000 --- a/docs/architecture/persistence-spine.md +++ /dev/null @@ -1,64 +0,0 @@ -# Persistence Spine - -Ghostlight's machine-managed state is moving behind a small CultCache-style -persistence layer instead of letting every tool paw raw files directly. - -The Python port is `cultcache-py`, published by CultLib to PyPI and pinned in -`tools/requirements.txt`. It used to be vendored as the `vendor/cultcache-py` -git submodule against the now-retired standalone `GameCult/cultcache-py` -repository; PyPI distribution replaced that fork. - -## Current Store - -- Cache store: `state/ghostlight-state.cultcache.jsonl` -- Ghostlight seam: `tools/ghostlight_state_store.py` -- Library dependency: pinned `cultcache-py==0.2.0`, declared in - `tools/requirements.txt` and installed by `npm run state:bootstrap` - (an idempotent `pip install -r tools/requirements.txt`, wired as a `pre*` - hook ahead of `state:status` and `state:prepare-compaction`) -- Readable exports: `state/branches.json`, `state/evidence.jsonl` - -The JSONL store is deliberate bootstrap plumbing. The package also exposes a -MessagePack store for environments that install the optional `msgpack` -dependency, but Ghostlight's state CLI must run on the bundled Python runtime -without global package assumptions. - -For cross-runtime `DatabaseEntry` payloads, use `cultcache-py`'s -`define_database_entry_type(...)` formatter. It writes MessagePack arrays by -explicit slot key, preserves nil gaps for deleted/reserved fields, and uses -defaults for missing older slots. That is the wire-compatibility contract shared -with `cultcache-rs` and the updated CultLib MessagePack generator. - -## Live Rule - -New machine-managed state should go through registered document definitions in -`tools/ghostlight_state_store.py` or a successor module. Direct writes to -`state/branches.json` and `state/evidence.jsonl` are compatibility debt. - -Human-readable exports remain useful because git diffs, handoff review, and -emergency recovery should not require decoding a cache file while the house is -on fire. - -## Migrated Documents - -- `ghostlight.branches.v0` - - global document - - exported to `state/branches.json` -- `ghostlight.evidence_record.v0` - - one record per evidence entry - - indexed by `type`, `status`, and `branch` - - exported to `state/evidence.jsonl` - -## Expansion Path - -Move compact control-plane state next: - -- corpus coverage ledger metadata -- active fixture run manifests -- persistent reviewer receipt indexes -- compaction scratch registration -- branch and initiative run ledgers - -Keep large corpora, generated artifacts, images, and full story payloads outside -the single state store unless they are represented by compact refs. A cache -file is not a warehouse just because it has pockets. diff --git a/docs/architecture/projected-local-context.md b/docs/architecture/projected-local-context.md deleted file mode 100644 index f57186d..0000000 --- a/docs/architecture/projected-local-context.md +++ /dev/null @@ -1,163 +0,0 @@ -# Projected Local Context - -The projected local context is the missing seam between canonical Ghostlight -state and a character agent. - -Canonical state is storage. It can contain means, plasticity, activation, -relationship stance, memories, culture, goals, and author-facing source paths. -A character response model should not have to interpret that machinery. It -should receive a compact operating context: what this character knows, wants, -misreads, can do, sounds like, and must not resolve. - -## Contract - -Pipeline: - -```text -canonical state + scene + reviewed annotation - -> projector/state interpreter - -> ghostlight.projected_local_context.v0 - -> response-model prompt - -> generated action proposal -``` - -The projected context may retain source references for audit. The rendered -prompt text must not expose raw state internals such as `current_activation`, -`plasticity`, means, or selected numeric dimensions. - -## Artifact Shape - -Schema: `schemas/projected-local-context.schema.json` - -Validator: `tools/validate_projected_contexts.py` - -Renderer: future projector/state-interpreter implementations should emit this -schema before any character responder sees the scene. Historical prototype -renderers have been removed from the live workspace after their lessons were -folded into this contract. - -The context contains: - -- speaker identity and setting -- known facts and speaker beliefs -- current stakes -- embodiment and interface affordances -- active inner pressures rendered as ordinary language -- relationship read and known biases -- tensions -- runtime retrieval requirements -- latent pressure requirements -- action affordances -- projection controls -- voice surface -- likely response moves -- do-not-invent boundaries -- rendered prompt text - -## Retrieval And Latent Pressure - -The projector now emits two explicit requirement lists before the responder -packet is built. - -`runtime_retrieval_requirements` are compact lore facts the runtime should -include when their trigger is scene-relevant. They are not a license for a -responder to browse the lore archive. They are coordinator or retriever outputs -with source refs and a prompt role. A Pallas labor scene might require AU -claimshare hierarchy, uplift liability framing, species affordances, Bloom -service-ring geometry, and strike-law pressure before a responder can act -without drifting into generic sci-fi wallpaper. - -`latent_pressure_requirements` are character-local history or emotional pressure -that must remain visible to the responder because it can shape behavior. They -are not dialogue requirements. Sella's memory of a sanctuary overpromising -safety should bias her toward capacity suspicion, condition-setting, and hard -triage boundaries. It should not make her announce the memory in the middle of -a mission-critical exchange unless the scene genuinely asks for that. - -The rendered prompt includes these as: - -- `Retrieved Lore To Keep In View` -- `Latent Pressure Handling` - -The responder packet also copies source-excerpt retrieval requirements into its -`source_excerpts`, so packet-only tests can evaluate the same bounded context a -runtime responder would receive. - -## Runtime Boundary - -The character model receives local operating context, not omniscient truth. If -Maer acts, Sella's next pass receives only the observable event and Sella's own -local context. Maer's private intent is not included. - -The sequential runtime still owns: - -- tool contracts -- action enums -- event proposal capture -- participant appraisal -- reviewed mutation -- branch compiler / Ink materialization - -The projector owns the translation from Ghostlight's internal state language to -character-local operating prose. - -## Character Cognitive Ceiling - -The response model may be very capable. The character should not inherit that -capability by default. - -Projection must carry a character-local cognitive ceiling: how quickly the -character infers, how much social indirection they notice, how well they -manipulate attention, how abstractly they reason under stress, what education or -culture has trained them to see, and where their blind spots live. A Lucent -crisis professional may operate with alarming metacognitive precision because -that is part of the institution's ecology. A tired dock worker, sheltered child, -panic-struck survivor, credulous fan, or blunt military specialist should not -suddenly perform the same level of social chess just because the underlying -model can. - -The projector should therefore render: - -- strategic acuity and social-reading ability -- education, professional training, and cultural scripts -- stress effects on reasoning -- blind spots, taboos, and habitual misreads -- whether the character can explain their own tactic, only feel toward it, or - act it out without understanding it - -This is separate from narrator intelligence. A coordinator or narrator can help -the reader understand a maneuver after it happens. That explanatory prose must -not be smuggled into the character's private state or future action capacity -unless reviewed mutation says the character actually learned it. - -## Current Limit - -The first projector is deterministic and deliberately simple. It uses threshold -language like "dominant", "strong", "present", and "background" rather than -numeric scores. This is enough to remove raw state soup from responder prompts and -create inspectable training artifacts. - -Later versions can become smarter, but they should still preserve this boundary: -response models act from projected local context; they do not become ad hoc -interpreters of the canonical schema. - -## Embodiment Boundary - -Embodiment is part of the prompt surface, not flavor garnish. If a character is -a cetacean Navigator, the response model must know what kind of body is acting -and what infrastructure surrounds it. - -For Aetheria factions, project faction-specific affordances only after checking -the lore source. The current Navigator projection is grounded in: - -- `E:\Projects\AetheriaLore\Aetheria\Worldbuilding\Pre-Elysium\Factions\Powers\Major\Cetacean Navigators.md` -- `E:\Projects\AetheriaLore\Aetheria\Worldbuilding\Pre-Elysium\Technology\Uplift.md` - -Those sources support fluid architecture, acoustic signaling, soft navigation -light, layered water motifs, communal orientation chambers, mixed-species -translation/coexistence, specialized environments for cetacean physiology, and -mixed wet/dry interface ergonomics for Navigator-adjacent habitats. - -Do not let the model default to hands, pockets, standing, walking, leaning, or -doorway blocking unless the fixture explicitly establishes that visible -interface. Do not patch over missing lore with confident furniture. diff --git a/docs/architecture/projection-distillation-plan.md b/docs/architecture/projection-distillation-plan.md deleted file mode 100644 index a536f15..0000000 --- a/docs/architecture/projection-distillation-plan.md +++ /dev/null @@ -1,230 +0,0 @@ -# Projection Distillation Plan - -Ghostlight should treat prompt projection as a specialist skill. A large teacher -model can produce reviewed projection artifacts from structured state; a smaller -student model can later learn that projection task once the artifact format is -stable. - -This is a staged plan, not an immediate fine-tune order. - -This plan covers the projector specifically. The broader rule for soft -judgments lives in `docs/architecture/soft-model-training-artifacts.md`. -Projection is one student organ, not the whole animal. - -## Goal - -Train or adapt a smaller projection model that can turn structured Ghostlight -state into compact character-local pressure artifacts. - -Input: - -- agent-state fixture -- scene id -- speaker id -- listener ids -- optional projection mode - -Output: - -- selected speaker-local facts -- active pressures -- tensions -- response affordances -- physical or action affordances when relevant -- voice surface -- rendered prompt text -- audit notes or trace linking outputs back to state - -The student projector should not generate final prose. Its job is to build the -pressure model that a response model can write from. The response may be -dialogue, action, silence, withdrawal, violence, or a mixed beat. - -## Aetheria Training Boundary - -For Aetheria, grounded projection training should come primarily from authored -historical lore rather than from Elysium gameplay-era scenes. - -Elysium gameplay content is intentionally malleable: the games discover and -generate what happens there. Projection examples set inside Elysium should be -marked as procedural branch material unless their branch facts have been -explicitly promoted. - -Use `docs/architecture/aetheria-lore-grounding-architecture.md` for the -grounding plan. In short: - -- train from historical flashpoints with strong lore grounding -- use Elysium fixtures like Cat/Oz to test projection mechanics and procedural - branch generation -- preserve Elysium branch lineage so conditional futures do not get flattened - into global facts shared by sibling histories - -## Roles - -### Teacher Projector - -A frontier model produces first-pass projection artifacts from the schema and -scene context. It should explain why each pressure, tension, or affordance is -active. - -Teacher outputs are not trusted automatically. They enter review. - -### Reviewer - -A human or separate model checks whether the projection: - -- uses only speaker-local context -- cites state interactions instead of unsupported vibes -- preserves the distinction between canonical state, perceived state, and prompt - projection -- derives target emergent behaviors from state intersections -- avoids hard-coding defensive behaviors as instructions when pressure prose is - enough -- stays compact enough to be useful as a runtime prompt surface - -Rejected examples are useful as negative cases if the failure mode is clear. - -### Student Projector - -A smaller model learns the reviewed projection task. It receives structured -state and emits the projection artifact. It should be optimized for consistency, -latency, and cost, not for final prose quality. - -### Aetheria-Tuned Agent Model - -The character agent or responder is a separate training target. It may be -adapted on a corpus of strong source-grounded Aetheria responses and reviewed -Ghostlight action/dialogue receipts spread throughout the timeline. The point is -for setting priors, tone, factional preconceptions, institutional assumptions, -species affordances, and recurring social failure patterns to live in the -responder model rather than in a giant prompt sack. - -That model still receives only character-local context at runtime. Fine-tuning -should teach it Aetheria's pressure ecology, not grant it author vision, -mutation authority, or access to private state. - -## Dataset Shape - -The first schema lives in: - -- `schemas/projection-example.schema.json` - -The first reviewed examples live in: - -- `examples/projections/call-of-the-void.scene-broken-taxi-oz.jsonl` -- `examples/projections/call-of-the-void.scene-broken-taxi-oz.pretty.json` - -Use a JSONL dataset with one projection example per speaker-scene turn. -The JSONL file is the machine artifact. The pretty JSON file is the readable -mirror for inspection, review, and discussion. - -```json -{ - "example_id": "call-void.scene-broken-taxi-oz.cat.v1", - "schema_version": "ghostlight.projection_example.v0", - "input": { - "fixture_ref": "examples/agent-state.call-of-the-void.json", - "scene_id": "scene-broken-taxi-oz", - "speaker_agent_id": "cat_marrigan", - "listener_ids": ["oz_operator"], - "projection_mode": "response_turn" - }, - "output": { - "known_facts": [], - "active_pressures": [], - "tensions": [], - "response_affordances": [], - "voice_surface": [], - "prompt_text": "..." - }, - "audit": { - "teacher_model": "frontier-teacher", - "review_status": "accepted", - "review_notes": [], - "target_emergent_behaviors": [] - } -} -``` - -Store training examples separately from the canonical fixture. The fixture is -world state. The projection dataset is supervised behavior for a projector. - -## Data Generation Loop - -1. Choose a scene and speaker from a fixture. -2. Build the speaker-local input slice deterministically. -3. Ask the teacher model to produce the projection artifact. -4. Ask the teacher or a second model to self-audit against the contract. -5. Review or edit the artifact. -6. Save accepted artifacts as positive training examples. -7. Save rejected artifacts with failure labels when the rejection teaches a - useful boundary. -8. Periodically run a small evaluation set before adding more examples. - -The Cat/Oz Call of the Void fixture remains useful as the first projection -mechanics fixture because it already has reciprocal relationship stance, -perceived overlays, hidden stakes, and speaker-local dialogue packs. It should -not be treated as the first grounded Aetheria lore-training fixture. - -The first grounded training loop should use a historical Aetheria flashpoint -from the authored lore archive. - -## Evaluation Gates - -Do not fine-tune until these gates are met: - -- projection artifact schema is stable enough for at least one complete fixture -- at least one deterministic input-slice builder exists -- examples include both Cat and Oz directions -- examples include secrets known by the speaker and secrets absent from the - speaker context -- examples include at least the target emergent behaviors: - - sarcastic deflection - - sincerity evasion - - emotional evasion - - banter-as-boundary - - verbal aggression -- evaluation checks can identify whether a projected behavior was justified by - state interactions -- rejected examples have clear failure labels - -## Evaluation Questions - -For each projection, check: - -- Did it include only facts available to the speaker? -- Did it select the highest-impact pressures instead of dumping the whole - schema? -- Did it name tensions that follow from goals, relationships, memories, and - scene pressure? -- Did response affordances emerge from state intersections? -- Did voice surface stay separate from defensive behavior? -- Did the projection allow nonverbal or physical action when the state and scene - made speech less likely than movement? -- Did known secrets become guarded pressure rather than forbidden context? -- Did the rendered prompt give the response model enough slope to produce the - target behavior without commanding the exact behavior label? - -## Fine-Tune Readiness - -A student projector becomes worth training when the reviewed dataset is large -enough that mistakes are repetitive rather than mysterious. Before that, use the -teacher model directly and save artifacts. - -Minimum useful milestone: - -- 50 accepted projection examples across multiple speakers and scenes -- 20 rejected examples with labeled failure modes -- stable projection output schema -- deterministic input-slice builder -- evaluator prompt or script that catches the known failure modes - -## Boundaries - -The student projector is not the character. It is not the dialogue writer. It is -not the action choreographer. It is not the evaluator. It is a compiler from -structured social state to compact character-local pressure. Keep those -responsibilities separate. - -Likewise, an Aetheria-tuned character model is not the resolver, not the state -store, and not the canon oracle. It proposes local action from local context. -Code and reviewed mutation authority decide what becomes world state. diff --git a/docs/architecture/prompt-projection-contract.md b/docs/architecture/prompt-projection-contract.md deleted file mode 100644 index f7eb9aa..0000000 --- a/docs/architecture/prompt-projection-contract.md +++ /dev/null @@ -1,297 +0,0 @@ -# Prompt Projection Contract - -Ghostlight should not prompt a response model with the full schema. The schema is -state storage. A prompt is a temporary scene instrument. - -Projection is not the whole Ghostlight runtime. It is the local lens used by a -sequential agent loop. The larger machine gives a character awareness of its -surroundings, options, goals, and constraints; lets it act; resolves the action; -mutates state; and then moves to the next agent. - -The projection layer turns durable state into a compact character-local pressure -model, then into prompt prose. The prose should describe what the character -knows, wants, fears, protects, misreads, can physically do, and sounds like right -now. It should not recite taxonomy labels unless a debugging mode explicitly asks -for them. - -For the sequential runtime target, see -`docs/architecture/sequential-agent-runtime.md`. - -## Projection Pipeline - -### 1. Select Speaker-Local Inputs - -For one acting character in one scene, gather only the state that can affect this -turn: - -- character identity and public role -- character canonical state -- character goals and protected values -- character memories selected by scene, relationship, and active pressure -- character perceived overlay of the listener or target -- character-to-listener relationship stance -- listener-to-character relationship stance only if the character has reason to infer it -- scene public facts -- scene hidden facts known to the character -- active public and private stakes -- culture, faction, or institution priors relevant to the scene -- physical affordances, constraints, distance, tools, weapons, bodies, access, - and social permissions relevant to possible action - -Unknown or author-only material is omitted. Known secrets are included only as -character-local pressure: what the character is guarding, why it matters, and -what would happen if it leaked. - -### 2. Compute Active Pressure - -For each candidate variable, compute an effective scene activation from: - -- canonical `current_activation` -- active scene pressures -- relationship stance toward the listener -- perceived state overlays -- salient memories -- active goals and protected values -- cultural or institutional scripts - -The first implementation can use simple weighted rules. The important contract -is not the exact formula. The important contract is that the projection explains -why a variable matters in this scene. - -Example: - -```text -Cat has high shame sensitivity, mask rigidity, distance seeking, suspicion, -ironic distance, and acute shame. Oz is useful but opaque. The scene pressures -Cat to accept help while not looking dependent. -``` - -That intermediate pressure statement is more useful than a dump of numbers. - -### 3. Detect Tensions - -A good dialogue prompt needs contradictions, not just traits. - -Derive scene tensions such as: - -- wants help but resents needing it -- wants closeness but treats closeness as leverage against them -- wants to protect a secret while needing cooperation -- wants status while feeling exposed -- wants to be honest but expects honesty to be punished -- wants to soothe the listener without becoming available for inspection - -Tensions are where verbal behavior starts to move. - -### 4. Derive Response Affordances - -Do not store defensive speech moves or action moves as canonical traits. Derive -likely response affordances from state intersections. - -Responses can be: - -- speech -- action -- silence -- withdrawal -- violence -- mixed speech and action - -The renderer must not assume a line of dialogue is the right output. Sometimes -the right next move is leaving the room, taking someone's wrist off a console, -opening the airlock interlock, refusing to answer, or slapping someone in the -face because the relationship, status threat, bodily proximity, and inhibition -profile finally made language too slow. - -Examples: - -| Target behavior | State interaction that can produce it | -| --- | --- | -| Sarcastic deflection | Shame sensitivity + ironic distance + suspicion + exposure pressure + dry or pointed voice. | -| Sincerity evasion | Mask rigidity + low authenticity tolerance + strategic opacity + low emotional explicitness. | -| Emotional evasion | Distance seeking + withdrawal + acute shame or control pressure + low self-disclosure. | -| Banter as boundary | Humor + ironic distance + attachment pressure + distance seeking. | -| Verbal aggression | Hostility + grievance activation + perceived status threat + abrasive boundary. | -| Physical withdrawal | Threat sensitivity + distance seeking + low trust + available exit + low obligation to stay. | -| Coercive interruption | Control pressure + urgency + authority role + high stakes + reachable control surface. | -| Slap or shove | Acute shame or moral disgust + proximity + low inhibition + perceived violation + limited verbal trust. | - -These are test targets, not prompt commands. The rendered prompt should describe -the pressure in ordinary language: - -```text -If Oz presses too close to the real fear, Cat is likely to answer the useful -part of the question while making the emotional part sound ridiculous. -``` - -That gives the model a behavioral slope without saying `use sarcastic_deflection`. - -For action, use the same rule: - -```text -If Veyr calmly describes a possible person as a diagnostic residue while Sella -is close enough to touch him, Sella may stop negotiating and physically break -the rhythm of the room. This should be rare, costly, and grounded in her care -ethic under overload, not random spice. -``` - -### 5. Compile Projection Controls - -Some failures are not fixed by louder prompt scolding. If the response model -keeps adopting the wrong moral frame, inverting who holds an object, giving a -character authority they do not have, or resolving a hidden fact too early, the -projection artifact is missing control structure. - -Before rendering prompt prose, compile explicit controls for: - -- `frame_controls`: whose language and moral frame the speaker should or should - not adopt -- `authority_boundaries`: what the speaker can order, request, propose, refuse, - or only witness -- `object_custody`: who currently holds the flag, weapon, terminal, document, - body, door, feed, or other consequential surface -- `required_semantics`: compromise meanings that must survive compression, such - as "hold remains but review starts now" -- `forbidden_resolutions`: unresolved facts or moral categories the turn must - not settle - -These controls are still speaker-local. They are not author omniscience handed -to the response model; they are the projection layer preserving what the -speaker's current state, scene position, and institutional role allow. - -Prototype story labs exposed the need for this layer. Projection controls catch -cases where a responder adopts the wrong moral frame, assumes authority it does -not hold, moves an object it cannot access, or resolves a disputed category too -early. In the current Pallas fixture, that means controls for who can certify a -strike, who can touch Kappa service ports, what evidence counts as sentience -rather than mere coordination, and which AU liability phrases are character -speech versus institutional pressure. - -### 6. Render Prompt Sections - -A response prompt should be compact and scene-bound. - -Recommended sections: - -- `Speaker`: who they are in this scene -- `Setting`: where and when the scene is happening, including only historical - or cultural context the speaker should have -- `Background`: speaker-local origin, role, class, culture, or embodiment - context needed to write the turn -- `Known Facts`: only speaker-local facts -- `Current Stakes`: what changes if this goes well or badly -- `Active Inner Pressures`: the strongest motives, fears, wounds, and needs -- `Relationship Read`: how the speaker currently interprets the listener -- `Tensions`: contradictions the speaker is managing -- `Action Affordances`: what the speaker can physically do and what it would - cost -- `Projection Controls`: frame, authority, object-custody, required semantic, - and forbidden-resolution constraints that must survive rendering -- `Voice Surface`: baseline speech texture for this moment -- `Likely Response Moves`: ordinary-language pressure outcomes, not schema labels -- `Do Not Invent`: boundaries about facts absent from the pack -- `Task`: the narrow generation request - -`Do Not Invent` is not a replacement for positive context. It only tells the -model not to create new facts beyond the pack. It should not list author-only -secrets. If the dialogue model needs setting, historical, cultural, -socioeconomic, or embodiment context to write the line, put that context in the -positive prompt text instead of hoping the model infers it from source refs it -will not receive. - -### 7. Generate, Then Evaluate - -Generation and evaluation are separate passes. - -The response model receives the rendered prompt and writes from the character's -local pressure model. A later evaluator can check whether target emergent -behaviors appeared when the state predicted them. The output may be dialogue, -action, silence, or a beat combining them. - -Evaluation questions can include: - -- Did the line protect the speaker's known secret without naming unknown facts? -- Did the line reflect the active relationship stance? -- Did the line preserve the voice surface without flattening into a generic bit? -- Did the spoken text sound like something the character would actually say, - rather than the prompt contract reciting itself? -- Did operational, legal, and safety constraints stay mostly in action/state - fields unless the character has an in-scene reason to say them aloud? -- If the output used action, was the action justified by physical affordances, - relationship pressure, inhibition, and stakes? -- If the output avoided speech, was silence or movement more plausible than - another line? -- Did a target defensive behavior appear when the pressure profile called for it? -- Did the response avoid a target behavior when the pressure profile did not call for it? - -The evaluator should cite the state interactions that justify its read. - -## Example Projection: Cat To Oz - -Input pressures: - -- Cat needs Oz's help with the taxi. -- Cat suspects Oz is a mask for a person. -- Cat has high suspicion, distance seeking, shame sensitivity, mask rigidity, - abrasive boundary, ironic distance, dry voice, pointedness, and profanity. -- Cat's relationship stance toward Oz includes low trust, moderate respect, - high fascination, and active expectation of betrayal. -- The scene makes Cat look dependent if she accepts help too openly. - -Rendered pressure prose: - -```text -Cat wants the repair, but accepting help makes her feel handled. Oz is useful, -which makes the secrecy more irritating, not less. Cat should probe for the -person behind the drone while pretending she is only annoyed about the repair. -If Oz gets too close to her fear of dependency, Cat is likely to answer the -practical issue and make the emotional issue sound stupid. - -Voice for this turn: dry, quick, pointed, plainspoken, low verbal warmth, low -emotional explicitness, some profanity. Humor can appear as a boundary, not as -friendliness. -``` - -Possible generated behavior: - -```text -"Sure, let the mystery box fix my relay. That's never how the paperwork starts." -``` - -That line is produced from the interaction between need, suspicion, shame -pressure, and dry pointed voice in the same scene. - -## Example Projection: Oz To Cat - -Input pressures: - -- Oz wants to help without exposing the operator. -- Oz reads Cat as suspicious, dangerous, and potentially protective. -- Oz has high mask rigidity, strategic opacity, withdrawal, hedging, coded - politeness, register switching, listening responsiveness, and low profanity. -- Oz's relationship stance toward Cat includes respect, fear, fascination, - moderate expectation of care, and moderate expectation of betrayal. -- The scene rewards usefulness but punishes exposure. - -Rendered pressure prose: - -```text -Oz wants Cat to accept the repair and stop inspecting the mask. Cat's suspicion -is dangerous because it is accurate enough to matter. Oz should stay useful, -slightly warm, and evasive. If Cat asks directly about the operator, Oz should -redirect toward the immediate repair or answer in a way that preserves the mask -without making the evasion look like panic. - -Voice for this turn: controlled, concise, technically precise, gently polite, -low emotional explicitness, careful verbal warmth, frequent hedging when the -subject approaches the operator. -``` - -Possible generated behavior: - -```text -"The relay first. Biography after we stop your meter from eating itself, maybe." -``` - -The line withholds the secret because Oz's goals, mask rigidity, relationship -fear, and scene stakes converge. diff --git a/docs/architecture/sandboxed-responder-packets.md b/docs/architecture/sandboxed-responder-packets.md deleted file mode 100644 index 8255c86..0000000 --- a/docs/architecture/sandboxed-responder-packets.md +++ /dev/null @@ -1,209 +0,0 @@ -# Sandboxed Responder Packets - -Responder packets are the handoff surface between the omniscient coordinator and -a character-local responder model or one-turn worker. - -The coordinator is allowed to know the scene, the branch, hidden state, source -material, pending hooks, and author intent. The responder is not. The responder -gets one packet, acts as one character, and returns a visible action plus any -private interpretation it can justify from that packet. - -No clairvoyance. No undeclared repo spelunking. No "I accidentally remembered -the whole chat" aristocratic nonsense. - -## Generation Lanes - -Responder examples have two valid lanes. - -`packet_only` is the runtime-parity lane. The responder sees the packet, -including any curated source excerpts the coordinator or lore retriever placed -there. It does not search the lore archive. Use this lane to test whether a -future game-runtime responder can act from bounded scene context. - -`retrieval_augmented` is the lore-absorption lane. The coordinator or a -dedicated retrieval worker searches a declared AetheriaLore scope, then builds a -visible packet from the selected refs. The responder still answers only from the -packet it receives. Use this lane to generate stronger Aetheria-native final -responses and to bake setting assumptions, faction pressures, species -affordances, and tone into later fine-tuning data without pretending the -character model did autonomous scholarship in the walls. - -There are two retrieval-augmented modes: - -- `coordinator_scoped_retrieval`: the coordinator or retriever consults lore, - then hands the responder a bounded packet. The responder has no repo access. -- `responder_scoped_repository_search`: the responder itself is explicitly - allowed to inspect the declared lore scope before answering. This is the - research-enabled lane. The packet must include a `Required Lore Research` - section, `allowed_scope`, and `research_instructions`. - -In `responder_scoped_repository_search`, the responder must consult the seed -docs before answering and may follow relevant links inside the traversal policy. -It should use retrieved lore to constrain behavior, affordances, institutions, -vocabulary, material stakes, territory, social movements, and local assumptions. -It must not use research access to infer hidden state, author-only answers, -future branches, or private motives outside the packet. The output capture must -preserve consulted seed refs, followed refs, a research trace, and a brief -research summary. No consulted refs means the research-enabled response failed -at the first hurdle, tragic but at least easy to grade. - -`research_trace` is the receipt surface. Each entry records the query or lookup, -source ref, source path, chunk index, line range, extracted constraint, and how -that constraint shaped the response. Trace status matters: - -- `runner_captured`: the runner or retrieval worker captured the lookup as it happened. This is required for accepted gold research-enabled captures. -- `coordinator_reconstructed`: the coordinator rebuilt the trace after the fact from source search and review. Useful draft data, not proof of the responder's actual research path. -- `responder_reported`: the responder claimed the trace directly. This is texture, not audit. - -Training-time research scope should be materially wider than runtime context. -The point is not to feed every responder a lore pantry forever. The point is to -let high-quality training samples absorb the world: PSC risk language, Jovian -territorial texture, resident factions, linked social movements, technology -constraints, and the odd little institutional grudges that make the universe -smell lived in. Runtime can later feed compact retrieval. Fine-tuning should -have already eaten its vegetables. - -Do not mix these silently. Retrieval-augmented output can be excellent training -material for an Aetheria-tuned responder, but it does not prove packet-only -runtime competence. Packet-only failures are also useful because they reveal -which lore facts the retriever or projector needs to feed at runtime. - -## Current Artifact - -The packet seam is: - -- `schemas/responder-packet.schema.json` -- `tools/validate_responder_packets.py` -- `npm run responder-packets:validate` -- `schemas/responder-output.schema.json` -- `tools/validate_responder_outputs.py` -- `npm run responder-outputs:validate` - -Current live fixtures may not include responder packet examples at all times. -That is acceptable. The contract remains live; obsolete prototype captures do -not need to stay in the working tree once their lessons are distilled. - -## Packet Contents - -A packet contains: - -- `generation_lane`: `packet_only` or `retrieval_augmented` -- `lore_access`: curated excerpts, coordinator-scoped retrieval, or - responder-scoped repository search -- `traversal_policy`: for responder-scoped research, the permitted link depth, - allowed repo prefixes, required seed refs, link classes to follow, and stop - conditions -- `local_context_prompt`: the projected character-local context -- `observed_event`: what the character can see or hear from the prior action -- `allowed_action_labels`: concrete action labels, including speech and non-speech moves -- `source_excerpts`: short source-backed facts the responder may use, copied - from active runtime retrieval requirements plus local packet invariants -- `output_contract`: the required JSON response shape and rules -- `hidden_context_audit`: refs and inference classes deliberately omitted -- `isolation_requirements`: how the worker/model must be run -- `packet_prompt_text`: the exact prompt text sent to the responder - -The packet prompt must not expose raw state internals such as -`current_activation`, `plasticity`, raw dimension scores, coordinator rationale, -author-only answers, or future branch plans. - -## Response Boundary - -The responder may output: - -- a visible action -- optional spoken text -- private interpretation explicitly framed as interpretation -- candidate state updates -- candidate relationship updates -- unresolved hooks - -`spoken_text` is not the place to dump the packet contract. Characters should -not recite every legal, procedural, or safety constraint simply because the -packet made those constraints visible. Keep speech to what the character would -actually say under pressure. Put the full checklist in `visible_action`, -`state_update_candidates`, `relationship_update_candidates`, and the mutation -receipt. - -Good future-institutional speech is compressed and situated: - -```text -I hold the line shallow. Your bay, your mark; my ledger stays awake for every -cost the tide takes. -``` - -Bad future-institutional speech is the output contract wearing a mask: - -```text -Bounded diagnostic contact only. No full intake, no custody, no personhood -finding, no cargo designation... -``` - -That second kind of line may be useful as a failure sample. It is not gold -responder behavior unless the scene specifically calls for formal oath, -courtroom language, ritual compliance, or someone deliberately reading terms -aloud. - -Those candidates are not canonical. The coordinator, event resolver, appraiser, -state mutator, and reviewer decide what becomes truth. - -## Training Use - -Gold responder data requires declared isolation. Valid approaches include: - -- a one-turn subagent started without inherited context -- an external model call that receives only the packet prompt -- a manual packet-only pass, clearly labeled as manual - -Any coordinator rewrite, schema repair, lore correction, or leakage removal must -be preserved as a coordinator intervention. Repaired prose is useful training -data for the coordinator, but it is not raw responder behavior. - -Retrieval-augmented responder data requires scoped lore access before the -responder acts. The coordinator, retrieval worker, or explicitly research-enabled -responder may search only the declared source scope, and the output capture must -list consulted refs and trace entries. The responder itself should not receive repo access unless -the artifact uses `responder_scoped_repository_search`, sets `no_repo_access` to -false, and includes visible research instructions in the prompt. - -Retrieval can also make the packet worse if it floods the scene with faction or -event context and starves the character's own relevant pressures. Review must -verify that packet-visible history, role strain, and local relationships remain -available as behavioral pressure. The point is not to make a character -trauma-dump during a mission-critical exchange. The point is that the responder -cannot be shaped by a pressure it cannot see. - -## Output Captures - -A responder output capture preserves: - -- the packet ref -- the coordinator artifact ref -- generation lane -- lore access mode and consulted refs -- the isolation method -- the exact visible input ref -- hidden context refs that were withheld -- raw responder output -- parsed responder output -- leakage audit -- coordinator review and intervention labels - -The raw output must parse to the reviewed `parsed_output` exactly. If the -coordinator edits prose, repairs schema, removes leakage, or corrects lore, the -capture must say so directly. - -For `responder_scoped_repository_search`, the raw responder object may also -include `consulted_refs`, `followed_refs`, `research_trace`, and -`research_summary`. Those fields should be preserved inside `parsed_output` -when the responder itself produced them; consulted refs, followed refs, summary, -trace status, and trace entries should also be mirrored into top-level -`lore_access` so the capture can be indexed without stripping the original -response. If the runner cannot expose a machine-verifiable tool-call or -retrieval transcript, label the sample as draft and say so in review notes. -Trust, but make the trust write receipts like everyone else. - -The current packet builder consumes `runtime_retrieval_requirements` from the -projected local context. Packet-only source excerpts should come from the same -retrieval/projector seam that would feed runtime context. Static lore sandwiches -are useful only as rejected-path examples and emergency snacks. diff --git a/docs/architecture/schema-future-mechanisms.md b/docs/architecture/schema-future-mechanisms.md deleted file mode 100644 index 551f165..0000000 --- a/docs/architecture/schema-future-mechanisms.md +++ /dev/null @@ -1,164 +0,0 @@ -# Future Schema Mechanisms - -This note parks the useful pressure from `notes/evaluation.md` without treating -that critique as doctrine. The current v0 schema is still a character-state and -prompt-projection seam. The future runtime needs mechanisms that turn state into -changing social behavior. - -## Current Boundary - -The v0 agent-state schema should stay focused on: - -- canonical character state -- directional relationship stance -- observer-local perceived overlays -- memories, goals, values, and scene-local dialogue packs -- enough event interpretation to support prompt projection - -Do not inflate `schemas/agent-state.schema.json` into the whole simulator before -the projection examples prove what the runtime actually needs. - -## Mechanisms To Preserve For Later - -### Event Appraisal - -Each participant needs a private read of the same event. A single exchange can -be betrayal to one agent, exposure risk to another, and flirting-with-knives to -a third. The current schema now allows `private_interpretations` on events as a -lightweight bridge. - -Future work should make appraisal reusable enough to drive state updates, -memory retrieval, and action affordances. - -### State Transitions And Consequences - -`mean`, `plasticity`, and `current_activation` describe state. They do not yet -define how state changes. Future transition machinery needs: - -- activation decay -- event-driven deltas -- sensitization or habituation -- effects on related variables -- rules for when `mean` changes versus only `current_activation` - -The current `event_effects` field is a projection-facing placeholder, not the -final transition engine. - -### Structured Beliefs And Secrets - -String beliefs are useful for authoring, but simulation needs structure: - -- holder -- subject -- claim type -- confidence -- evidence -- visibility -- emotional charge -- whether the belief is private, shared, public, rumor, false, or contested - -Secrets need similar structure: owner, known-by, suspected-by, exposure cost, -protective strategies, and what can leak through action. - -### Action Affordances - -The system needs to choose among possible moves instead of jumping from state to -dialogue. Future projection examples should expose candidate affordances such -as probing, evading, bargaining, softening, escalating, repairing, threatening, -or walking away. - -The important rule: affordances should be justified by goals, appraisals, -capabilities, costs, relationship stance, and scene pressure. - -### Conversation State - -Dialogue needs explicit continuity: - -- active topic -- open questions -- evasions -- accusations -- face-threats -- commitments -- promises, refusals, and ruptures -- who has the floor - -This belongs close to projection because it changes turn shape immediately. - -### Resources And Capabilities - -Cat's debt, taxi condition, mobility, and institutional exposure are not just -backstory. Oz's drone integrity, signal secrecy, anonymity, and physical safety -are not just flavor. Future schemas need concrete resource and capability -fields so desire does not masquerade as ability. - -### Dyads And Shared Relationship History - -Directional relationship stance should remain. A separate dyadic layer may also -be needed for shared history: - -- relationship type -- phase -- shared events -- shared secrets -- unresolved ruptures -- rituals -- dependency structure -- communication pattern - -Do not collapse this into one symmetric relationship object. People are not -that tidy unless the author is lying to save RAM. - -### Social Knowledge, Reputation, And Institutions - -The Aetheria setting needs institutions with teeth: sanctions, authority, -surveillance, reputation effects, access control, role expectations, and public -knowledge. Future work should distinguish private belief, shared belief, public -fact, rumor, common knowledge, and institutional record. - -### Memory Retrieval - -Memories need more than salience and confidence once the runtime starts moving: - -- recency -- emotional charge -- retrieval triggers -- decay -- reconsolidation -- intrusive, avoided, cherished, rehearsed, or distorted status -- schema effects -- whether another agent knows the memory - -The current memory bundle is enough for the first projection seam. It is not yet -the memory engine. - -### Embodiment And Nonverbal Channels - -Oz proves this one immediately. The operator, drone body, observable channels, -leakage risks, and physical affordances are separate facts. Future projection -needs embodiment because social meaning leaks through movement, timing, -silence, distance, posture, and constrained bodies. - -The projected-local-context seam now carries a first embodiment/interface -surface, but the canonical schema still lacks a proper reusable embodiment -model. Future work should promote body form, native habitat, movement channels, -assistive or translation infrastructure, and visible nonverbal signal channels -only after more projection examples prove the required shape. - -For Aetheria faction work, embodiment projection must check the lore vault -before writing. If the faction page supports only general habitat aesthetics or -social affordances, keep generated action at that level and record the missing -ergonomic detail as a source-lore gap instead of inventing a confident local -interface. - -When a blocking gap is found, patch the AetheriaLore source before treating the -detail as available to projection. Ghostlight can discover missing granularity -through scene generation, but the lore vault should become the durable source of -the elaboration. - -## Promotion Rule - -Promote a future mechanism into the main schema only after it has survived at -least one reviewed projection example or runtime slice where it clearly changes -the output. Until then, document it here, test it in examples, and do not let -the ontology grow antlers for sport. diff --git a/docs/architecture/sequential-agent-runtime.md b/docs/architecture/sequential-agent-runtime.md deleted file mode 100644 index 84956f4..0000000 --- a/docs/architecture/sequential-agent-runtime.md +++ /dev/null @@ -1,489 +0,0 @@ -# Sequential Agent Runtime - -Ghostlight's near-term target is not a general-purpose life simulator. - -The near-term product target is procedural interactive dialogue in the game -sense: branching scenes where choices can be speech, silence, movement, object -use, refusal, revelation, concealment, violence, withdrawal, trade, or any other -scene-valid action. "Dialogue tree" does not mean a tree made only of spoken -lines. It means an interactive branch structure for a character encounter. - -Ink is the branch format for that structure. Ghostlight should not invent its -own dialogue-tree file format while Ink already exists and fits the job. See -`docs/architecture/ink-branching-scenes.md` for the integration contract. - -Ghostlight should set up a scene, generate plausible things the protagonist or -NPCs could do, generate responses from the people present, and propagate the -consequences into world state, memory, belief, and social perception. - -The long-term target is broader. The same classifiers, appraisers, and -projection models should eventually operate inside a simulated game world with -open-world contexts, iterated decisions, economic behavior, and major-faction -decision-making. Do not train a tiny dialogue-only creature that panics the -first time someone buys medicine, defects from a faction, or reacts to a -shortage. Also do not build the whole economy today. Both cliffs are stupid. - -The runtime target for now is scene-local: choose which character is acting, -give that character local awareness, let them act, apply consequences, mutate -the relevant state, and continue until the scene produces a usable branching -scene tree, scene transcript, or branch scaffold. - -Single-turn projection remains useful, but it is a microscope, not the animal. - -## Runtime Shape - -One runtime tick should look like this: - -1. Select an acting agent from the initiative schedule. -2. Build that agent's local awareness. -3. Derive available actions and constraints. -4. Let the agent choose a response. -5. Resolve the action into an observable event. -6. Apply every affected participant's appraisal and state mutation for that - event. -7. Append the event record with participant-local interpretations. -8. Update initiative timing, reaction windows, and action recovery. -9. Select the next acting agent from the updated schedule, or end the scene. - -The author sets the initial scene, player role if any, and high-level branch -constraints. The author should not need to decide every line, interruption, -withdrawal, refusal, or concession. That is the point of the machine. - -Every generated character turn must be local to that character. - -For branching scenes, this means protagonist/player options and NPC responses -are separate generation steps: - -1. Build the protagonist's local awareness. -2. Generate plausible protagonist choices from only what the protagonist knows, - perceives, wants, can attempt, and can affect. -3. When one choice is selected, reduce it to observable action: words, silence, - gesture, movement, object use, resource spend, or other perceivable change. -4. Resolve the selected choice into an event visible to affected characters. -5. Apply reviewed participant appraisals and state mutations for that event: - hurt, threat, reassurance, obligation, resentment, trust movement, overload, - misread, world/object/resource changes, and scene-ending choices when they - occur. -6. Update initiative timing and select the next acting agent from the updated - schedule. The next agent may answer, walk away, escalate, comply, refuse, - call for help, attack, or end the interaction. -7. Generate that next action from the newly consolidated local state. -8. Store actor intent, listener appraisal, and durable interpretation - separately. - -There is no privileged paired exchange inside the runtime. For authoring -convenience a branch artifact may show `player action -> NPC action`, but -Ghostlight should treat that as two turns stitched together, not one fused -response object. If Maer wounds Sella with a ledger threat, Sella's state -changes before she is considered as the next actor; she is not obligated to -produce a line just because the author expected one. - -One-shot paired generation, where a model writes both the player's move and the -NPC response from a shared omniscient packet, is acceptable only as bootstrap -scaffolding. It should be reviewed and labeled as such. Do not treat it as the -target runtime behavior. - -## Initiative Scheduler - -Not every character gets a turn every round. There is no round. - -Ghostlight needs a scene-local initiative scheduler: a mechanical organ that -tracks who is ready to act, who is still recovering from a previous move, and -who has a valid interrupt window. It sits after event appraisal/mutation and -before the next local-awareness projection. - -The scheduler does not decide what a character wants. It decides when a -character is eligible to act. - -Core rule: - -```text -observable event - -> participant appraisals and reviewed mutation - -> initiative/reaction update - -> next actor selection - -> next actor projection -``` - -Every affected participant still appraises every event before the next action -is generated. Initiative controls action opportunity, not perception. A hostage -can be terrified by a negotiator's move immediately; that does not mean the -hostage gets a full action before the hostage-taker, unless the schedule or a -reaction window gives them one. - -Each participant carries initiative state: - -- `initiative_speed`: how quickly the participant recovers action opportunity - in this scene. -- `next_ready_at`: the scene-clock time when they can take a normal action. -- `reaction_bias`: how likely they are to seize urgent interrupt windows. -- `interrupt_threshold`: how strong a trigger must be before they interrupt. -- `current_load`: stress, injury, cognitive burden, physical constraint, or - interface lag that makes action harder. -- `status`: whether they are active, blocked, withdrawn, incapacitated, or - offscreen. - -Actions carry recovery shape: - -- `action_scale`: micro, short, standard, major, or committed. -- `base_recovery`: how much scene time the move normally costs. -- `initiative_cost`: how much local opportunity the actor spends. -- `interruptibility`: whether others can break in while the action unfolds. -- `commitment`: how much the actor is locked into the move once begun. - -The scheduler first checks reaction windows created by the last event. A -reaction window is an interruptible opportunity, not a free omniscient response. -It must name the triggering event, eligible actors, urgency, allowed action -scales, expiry, and local basis. If no reaction clears threshold, the scheduler -selects the active participant with the lowest `next_ready_at`. - -Recommended reaction readiness: - -```text -reaction_readiness = (reaction_bias * urgency) - current_load -``` - -An interrupt can fire when `reaction_readiness >= interrupt_threshold`, the -actor is eligible for the window, and the actor is not blocked. Ties are broken -by earlier `next_ready_at`, higher `initiative_speed`, then stable actor id. - -After an accepted action, update the actor: - -```text -recovery = base_recovery / max(initiative_speed, minimum_speed) -next_ready_at = max(scene_clock, current next_ready_at) + recovery -``` - -Major or committed actions should usually create larger recovery, stronger -counterplay windows, clearer visible cues, or more durable consequences. Short -actions let a character stay nimble but should not accomplish everything. A -one-word refusal, a glance to a camera, or stepping behind a marked line can be -fast. A public confession, tackle, system override, or hostage release costs -more initiative because it changes the scene. - -The coordinator may override the scheduler only by recording the override -reason. Useful overrides include player-facing pacing, hard scene boundaries, -or a game-engine rule that is not yet represented in the schedule. An -unrecorded override is not training-ready coordinator data. - -For Ink, the scheduler can be collapsed into branch structure for readability, -but the sidecar should preserve the initiative receipt when the fixture claims -training value. Player choices may be presented together even if, inside the -runtime, they represent alternative actions available at one scheduled moment. - -For game use, the loop should be able to emit: - -- a scene transcript -- Ink scenes with candidate player choices, including speech and non-speech - actions -- compiled Ink JSON -- NPC response branches -- state/memory/social-perception deltas for each branch -- unresolved hooks for later scenes - -If a feature does not help produce those artifacts, it belongs in the parking -lot until the smaller machine works. If a field or label preserves information -needed for later open-world behavior, consumer choice, faction pressure, or -iterated decisions, keep it visible in the training artifact even if the first -prototype does not simulate it. - -## Local Awareness - -An acting agent needs more than a dialogue cue. - -The local awareness pack should include: - -- where the agent is -- who is present -- what the agent can perceive -- what the agent knows, believes, suspects, and misreads -- what the agent wants right now -- what the agent is protecting -- what resources and tools are available -- what social, legal, physical, and emotional constraints apply -- what actions are available -- what each action might cost -- what facts are unresolved -- what the agent is allowed to mutate directly - -This is not reader legibility or global story authorship. This is operational -state for scene-local dialogue and action. If the scene itself is abstract and -byzantine, the agent may still behave correctly inside that mess. Do not shove -general prose quality or whole-plot design into this layer. - -## Branch Choices And Action Selection - -The action model must allow more than speech. - -For a protagonist scene, Ghostlight should be able to generate several -plausible choices for what the protagonist can do next. For example, if Cat is -interacting with another character, the generated choices might include: - -- say the honest thing badly -- deflect with a joke -- leave before the other person can answer -- hand over evidence -- hide evidence -- accept help while pretending not to need it -- threaten to walk -- spend scarce money -- break a device -- touch someone gently -- slap someone - -Those choices should come from Cat's state, scene affordances, resources, -relationship pressure, and goals. They should not be generic verbs glued to a -persona card. Each branch should carry expected consequence surfaces, such as -trust risk, reputation risk, resource cost, information exposure, or future -obligation. - -Keep the action vocabulary small and concrete. Do not turn every possible -speech act into a separate tool. `ask`, `refuse`, `offer`, `reveal`, `conceal`, -and `request authority action` are usually communicative intentions carried by -`speak`, `gesture`, `show_object`, `withhold_object`, or `use_interface`. - -Initial action primitives: - -- `speak` -- `silence` -- `move` -- `gesture` -- `touch_object` -- `block_object` -- `use_object` -- `show_object` -- `withhold_object` -- `transfer_object` -- `spend_resource` -- `attack` -- `wait` - -The agent should choose from affordances produced by the interaction of state, -scene, role, resources, relationship, and pressure. The action should not be -commanded by a prompt label. If a character hits someone, it should fall out of -proximity, inhibition, grievance, fear, role permission, and exhausted trust. - -An action proposal may include intended function: - -- ask -- refuse -- offer -- threaten -- comfort -- reveal -- conceal -- request -- promise -- accuse -- redirect - -That intention is not guaranteed truth. A listener can misread it. A character -can claim they were offering help while the listener perceives a threat. A -character can intend restraint and still be read as contempt. The event should -store observable action separately from actor intent and participant-local -interpretation. - -Example: - -```json -{ - "action_type": "speak", - "spoken_text": "Name the cost before you call it caution.", - "actor_intent": "force_cost_acknowledgment", - "observable_cues": ["calm voice", "still posture", "public challenge"] -} -``` - -Isdra may perceive that as procedural intimidation. Maer may experience it as -stewardship. The classifier/appraiser later learns from those differences. - -## Mutation Authority - -Characters should only mutate what their action can actually affect. - -Examples: - -- A character can mutate their own beliefs, memories, current activation, goals, - and presentation pressure. -- A character can create observable events others may perceive. -- A character can change world objects they can physically or institutionally - access. -- A character can affect relationship stance, but the other side's relationship - update is mediated through that other agent's appraisal. -- A character can propose an order they lack authority to issue. -- A character cannot silently rewrite another agent's private state, decide an - unresolved hidden fact, or seize institutional authority they do not possess. - -This is where the projection-control layer belongs. Frame ownership, authority -boundaries, object custody, required semantics, and forbidden resolutions are -not decorative prompt warnings. They are mutation gates. - -## Event Resolution - -Generated action is not state mutation by itself. It becomes an event proposal. - -The resolver should decide: - -- what observable event occurred -- what world objects changed -- what resources were spent or created -- which agents perceived the event -- how each participant appraised it -- which beliefs were reinforced, challenged, or created -- which memories were written -- which relationship dimensions changed -- which current activations changed -- which options opened or closed - -In a branching scene tree, each branch should carry its own consequence packet. -If Cat chooses to lie, accept help, shove someone, spend money, or reveal a -secret, that branch should record what changed and what might matter later. -Consequences can include: - -- trust lost or gained -- suspicion raised or lowered -- obligation created -- debt created or paid -- resource spent -- information revealed or concealed -- relationship rupture or repair -- faction or reputation pressure changed -- future scene hook opened or closed - -The first implementation can be conservative and partly deterministic. A bad -resolver will build narrative sludge faster than a bad line of dialogue will. -No pressure. Tiny little bear trap. - -The fuzzy parts should stay manual at first. - -Do not invent a fragile rule-based social psychology engine just to feel -automated. Early runtime passes should manually review or author: - -- participant appraisals -- relationship deltas -- belief updates -- memory writes -- activation changes -- ambiguous intent classification -- whether a listener misread or correctly read a move - -Those manual decisions are the training data. Save the observed action, actor -intent, listener perception, accepted mutation, rejected mutation, and reviewer -notes. Later, train classifiers and appraisers on that corpus. The prototype -should automate mechanical legality and visibility first, not pretend it has -already learned human interpretation from twelve examples and a strong coffee. - -## Scope Boundary - -Build interactive branching scene generation first, but shape the data for later -open-world use. - -In scope now: - -- scene-local agent turns -- player/NPC dialogue and action branches -- local action proposals -- event records -- manual reviewed appraisals -- memory, belief, relationship, and activation deltas -- branch consequences that can be carried into later scenes -- action intent and listener interpretation labels -- resource, price, scarcity, obligation, reputation, and faction-pressure tags - when they affect the decision -- reviewed examples of consumer-like choices and institution/faction pressure, - even when the prototype only records them as scene state - -Training-data obligations now: - -- Preserve why an agent chose, bought, refused, hoarded, traded, complied, - defected, concealed, punished, or helped. -- Preserve what the agent believed the cost, risk, status effect, and social - consequence would be. -- Preserve faction and institution pressures as perceived by the agent, not - only as objective setting lore. -- Preserve iterated-decision context: promises, debts, prior betrayals, - reputation, memory, scarcity, and expected future contact. - -Out of implementation scope for now: - -- full autonomous world simulation -- economy simulation loops -- city-scale scheduling -- long-horizon plot invention without author scaffolding -- autonomous factions moving offscreen as full actors -- physical simulation beyond scene affordances -- automatic social appraisal rules pretending to be trained classifiers - -The eventual storyline generator, economic behavior model, and faction decision -model should grow out of reliable branching-scene machinery and reviewed -decision data, not the other way around. - -## Projection's Narrower Job - -Projection still matters. - -Its job is to turn structured state into a compact local action context for one -agent at one moment. It should support action choice and response rendering. It -should not be treated as the whole story engine. - -Projection artifacts are still useful for: - -- debugging whether local state produces plausible action -- training a smaller projector -- preserving reviewed examples -- testing state boundaries and mutation gates -- producing dialogue or action beats inside a larger runtime - -But the production path is sequential: - -```text -agent state + scene state - -> local awareness - -> action affordances - -> agent response/action - -> event resolution - -> participant appraisals and state mutation - -> initiative/reaction scheduling - -> next actor selection - -> next agent action from updated local state -``` - -## First Prototype - -The first implementation should not try to simulate a city. Calm down, wizard. - -Prototype one small Ink-backed branching scene loop, using the current live -fixture or a new source-grounded fixture: - -1. Load a fixture agent-state artifact, such as - `examples/agent-state.pallas-species-strikes.v0.json`. -2. Select one scene and one acting agent. -3. Build a local awareness packet from existing state. -4. Compile projection controls. -5. Generate or author branch choices and NPC responses from local context. -6. Materialize the branch plan through the Branch Compiler as Ink, sidecar - annotation, compiler notes, consequence variables, and visual prompt handles. -7. Compile the Ink scene to JSON with `inkjs`. -8. Save a sidecar training annotation that maps Ink branches to Ghostlight - state basis, actor intent, consequence surfaces, and mutation policy. -9. Apply selected branch consequences only through reviewed mutation: - - Ink variables can track local playthrough facts - - canonical state changes require resolver/reviewer approval -10. Run IF artifact review before acceptance: - - every material variable is read later or marked telemetry-only - - every material choice changes affordance, risk, callback, visual state, or - outcome - - folds preserve consequence rather than hiding it -11. Manually review fuzzy participant appraisals and state effects each turn: - - update every affected participant before selecting the next actor - - add one memory or belief update - - adjust one or two `current_activation` values - - update one relationship stance if justified - - record the rationale as training data -12. Validate the resulting fixture. - -The goal is not literary quality or autonomous plot generation. The goal is to -prove that a character can drive a scene beat, produce branchable dialogue or -non-dialogue action, trigger plausible responses from other characters, and -leave memory, relationship, social perception, and scene state slightly -different behind them. diff --git a/docs/architecture/soft-model-training-artifacts.md b/docs/architecture/soft-model-training-artifacts.md deleted file mode 100644 index 1cbb5ec..0000000 --- a/docs/architecture/soft-model-training-artifacts.md +++ /dev/null @@ -1,539 +0,0 @@ -# Soft Model Training Artifacts - -Ghostlight has two kinds of machinery. - -Some parts should be boring code: - -- schema validation -- visibility filtering -- action legality -- object custody -- resource accounting -- Ink syntax validation and compilation -- event append -- provenance checks -- deterministic context slicing -- mechanical mutation gates - -Other parts are soft. They require judgment, taste, social inference, cultural -pressure, and narrative sense. Do not fake those with brittle rules just because -a function-shaped hole is sitting there looking smug. - -Soft parts should emit reviewed training artifacts from the beginning. Manual -review is not a temporary embarrassment. It is the dataset. - -## Core Rule - -If a decision cannot be made reliably by deterministic code, Ghostlight should -save it as a training example. - -That includes accepted outputs, rejected outputs, repaired outputs, and weird -half-successes. Especially weird half-successes. They are where the machine is -showing the fracture line. - -A useful soft artifact should preserve: - -- the deterministic input slice -- the model or human output -- the reviewer decision -- accepted labels -- rejected labels, if any -- rationale grounded in state, scene, culture, memory, relationship, and lore -- failure notes -- provenance to source lore or fixture state -- whether the artifact is grounded canon, transition-grounded, procedural - branch material, or promoted branch material - -## Sandboxed Responder Rule - -Responder training data must not be authored from an omniscient view. - -The coordinator may know the whole scene, hidden state, future branch plan, -author constraints, and private facts. The responder model we eventually train -will not. If a responder example only works because the authoring agent quietly -used omniscient context, the artifact is poisoned. It teaches the future model to -perform an impossible trick, then looks offended when reality asks for receipts. - -For gold responder or character-action data: - -- the coordinator prepares the scene and selects the acting character -- the projector emits the exact character-local context -- the responder is run from only that projected packet, visible event, allowed - action space, and any explicitly included source excerpts -- the responder does not see other agents' private state, hidden canonical - facts, author-only plot beats, future branch plans, or coordinator rationale -- any isolated worker or sub-agent used for responder generation should be - started without inherited conversation context when the harness supports it -- repo or lore browsing is disabled for the responder unless the projected - packet explicitly includes the excerpts or references the future model will - also receive -- the coordinator reviews after generation, not during it - -Artifact requirements: - -- `responder_visible_input`: the exact prompt or structured packet the responder - saw -- `responder_raw_output`: the unedited output -- `reviewed_output`: the accepted or repaired turn -- `review_status`: accepted, accepted-as-draft, useful-needs-revision, rejected, - or superseded -- `coordinator_interventions`: every edit, repair, deletion, or normalization - made after raw generation -- `hidden_context_refs`: ids or paths for context intentionally withheld, not - the hidden content itself -- `leakage_audit`: checks for private-state leakage, future-branch leakage, - author-only leakage, raw-state soup, prompt-constraint parroting, and - impossible body or object knowledge - -Coordinator-written replacement text can be valuable, but it is not raw -responder output. Mark it as coordinator repair or frontier-curated final. Do -not smuggle repaired prose into the responder corpus as if the sandbox produced -it. That is how a dataset learns to cheat with a straight face. - -## Training-Ready Scene Loop Bundle - -A scene loop is the smallest useful sequential training unit before branch -compilation. It is not enough to have a nice transcript. The bundle needs the -machine trail that made the transcript possible. - -A training-ready scene-loop bundle contains: - -- scene-local digest or lore slice -- initial scene/world state -- current character state refs for every participant -- projected local context per acting turn -- responder packet per acting turn -- raw responder output capture per acting turn -- observable event record per accepted action -- participant appraisal receipt for every affected participant -- reviewed mutation receipt for character state, memory, relationship, - perceived overlays, object state, scene/world state, and unresolved hooks -- coordinator turn receipt carrying next-beat selection, world-state reads, - proposed deltas, glue prose, and review labels -- review summary naming which organs are training-ready, reference-only, or not - training data - -Training readiness is per organ. A bundle can be useful for responder, -appraiser, mutator, relationship/perception updater, and coordinator training -while still being useless for branch compiler, IF artifact reviewer, or visual -replay training. Count only the receipts that actually exist. - -`pallas-training-loop-v0` is the first pilot of this convention. It rebuilds one -Pallas threshold beat as a separate derivative and leaves the Pallas reference -fixture immutable. - -## Soft Organs - -These organs should be treated as model-training targets, not permanent -hand-authored rule nests. - -### Coordinator Or Story Runtime - -Glues scenes together, maintains world state, chooses which machinery runs, and -emits the connective prose around character turns. - -In training-shaped loops, the coordinator should be sandboxed as its own -promptable organ. A coordinator worker receives only the scene state, accepted -receipts, unresolved hooks, available machinery, branch affordances, tonal -intent, author constraints, and game-engine-shaped state surfaces it is allowed -to use. It then proposes the next beat, acting character, machinery calls, glue -prose, and candidate state changes. - -Codex remains the meta-coordinator while the system is being built: it scopes -the task, prepares the coordinator-visible input, launches the sandboxed -coordinator, reviews the output, labels interventions, and wires structured -state between organs. Codex-authored coordinator artifacts are useful draft -material, but they are not raw coordinator training data unless the coordinator -input/output seam was actually sandboxed. - -This is a trainable artifact too. Do not let coordinator judgment evaporate into -chat history just because a large model is currently doing the stage management -with jazz hands and plausible deniability. - -Training artifacts: - -- scene setup receipts -- exact coordinator-visible input packet -- raw sandboxed coordinator output -- parsed and reviewed coordinator artifact -- coordinator plans -- selected next scene or next beat -- chosen acting agent -- selected tools or soft organs invoked -- world-state refs read -- world-state changes proposed -- unresolved hooks carried forward -- branch merge or branch split decisions -- authored glue prose -- rejected glue prose -- reviewer notes about pacing, legibility, state continuity, lore grounding, - game usefulness, and machinery misuse - -The coordinator output should be shaped for a future game engine. Even while the -prototype lives in model imagination and authored prose, it should preserve -structured refs for: - -- scene id -- location id -- time or sequence marker -- participating agents -- active objects -- active resources -- public world facts -- unresolved facts -- branch flags -- event log refs -- state fixture refs -- consequences awaiting review - -Glue prose is part of the artifact. It is not canonical state, but it is useful -training signal for how scenes are bridged, how pressure is restated without -exposition sludge, and how a procedural branch becomes readable narrative. - -Coordinator and narrator intelligence are allowed to exceed character -intelligence. This is how opaque high-context scenes become legible without -flattening the characters. If a Lucent negotiator, influencer, or feed operator -is performing layered reputation warfare, the coordinator may explain the -maneuver in reader-facing prose, but the explanation is not automatically -available to the character who performed or witnessed it. Character cognition -still comes from projected state: intelligence, social acuity, training, -cultural scripts, stress, and blind spots. - -The coordinator may propose state changes, scene transitions, and tool calls. It -does not bypass deterministic gates. It does not silently decide hidden facts. It -does not mutate another organ's private output after review. It conducts the -little orchestra; it does not eat the violins. - -### Projector - -Turns canonical state, perceived state, memory, culture, scene pressure, and -affordances into character-local operating context. - -Training artifacts: - -- projected local context records -- projection examples -- prompt-rendering audits -- leakage failures -- source-grounding failures - -The projector does not write final prose. It prepares the local pressure surface -for an acting model. - -### Character Agent Or Responder - -Chooses what a character does next from local awareness. - -This includes speech and non-speech action. The agent may speak, wait, leave, -hide evidence, reveal evidence, spend a resource, attack, comply, defect, -bargain, comfort, or do nothing useful because people are built badly. - -Training artifacts: - -- exact responder-visible input packet -- hidden context refs, without hidden content -- raw responder output -- coordinator interventions or repairs -- action-choice receipts -- candidate branch sets -- accepted and rejected character turns -- spoken text when speech occurs -- observable non-speech action -- actor intent -- constraints used -- constraints violated -- reviewer notes about voice, lore, embodiment, agency, and scene fit - -This model should be fine-tuned or adapted on a corpus of strong Aetheria -responses spread across the timeline. The goal is not a bolt-on lore module. -The goal is for the responder to internalize the shape of the setting: what -people assume, what institutions feel like, which pressures are normal, which -metaphors appear, what bodies can do, and how the universe tends to hurt people -while insisting it is only doing math. - -That reduces lore handholding at runtime. It does not remove character-local -context. The tuned responder still needs the specific room, speaker, listener, -state, memory, affordances, and known facts for the current turn. - -### Appraiser - -Reads an observable event from one participant's local perspective and proposes -how that participant interprets it. This organ is not only for fictional scene -mutation. It is also one of the core paths by which VoidBot becomes better at -reading people: noticing what a human did or said, forming a grounded opinion -without pretending certainty, and revising that opinion as evidence accumulates. - -Training artifacts: - -- observed event -- participant-local knowledge -- private interpretation -- misread or correct-read label -- emotional appraisal -- relationship implications -- belief implications -- memory candidate -- human-facing opinion update when applicable: trust, concern, irritation, - respect, caution, attachment, boundary pressure, expected future behavior, and - what evidence would change the read -- reviewer corrections - -The appraiser should not know canonical private state except where that -participant knows or believes it. Fundamental attribution bias belongs here. For -VoidBot, this means the model must distinguish an observed human behavior from a -durable claim about who that human is, and should preserve uncertainty, repair -signals, and evidence needed to revise the opinion later. - -### State Mutator - -Turns reviewed appraisal into bounded state changes. - -Training artifacts: - -- prior state refs -- event refs -- appraisal refs -- proposed state deltas -- accepted deltas -- rejected deltas -- mutation authority notes -- reviewer rationale - -The early system should keep this manual and audited. Later a model can learn -common deltas, but deterministic gates still own schema, bounds, and authority. - -### Relationship And Social Perception Classifier - -Updates perceived overlays and relationship stance from repeated evidence. This -classifier should serve both Aetheria agents and VoidBot's long-running human -relationships; the same machinery that lets Sella update her read on Maer should -also let VoidBot update its read on a specific user without collapsing into -either sycophancy or a permanent first-impression mugshot. - -Training artifacts: - -- prior relationship stance -- event and appraisal history -- proposed movement -- confidence movement -- stale or reinforced impressions -- prejudice, stakes, memory, and social-reinforcement drivers -- reviewer notes - -This is where confidence belongs. Do not grow a second correction-resistance -organ because the first one got lonely. - -### Aetheria Responder Corpus - -Training artifacts: - -- source-grounded scene examples -- factional speech and pressure examples -- institution decision examples -- embodiment/interface examples -- negative examples where generic sci-fi assumptions were rejected -- reviewer notes tied to AetheriaLore paths - -This corpus trains the character agent/responder directly. It is how a chosen -base model learns Aetheria's native assumptions rather than waiting for every -prompt to drag the whole lore vault behind it in a little wagon. - -The tuned responder should learn the smell of the setting: Dominion severity, -Aya-coded care pressure, Navigator embodiment, corporate certification culture, -insurer cruelty, upload personhood fights, factional misreads, and the dry -little horrors of systems pretending to be neutral. - -It still must receive character-local context at runtime. Fine-tuning gives it -priors, not omniscience. - -### Branch Compiler - -Turns scene intent, reviewed branch candidates, consequence packets, fold plans, -and visual continuity requirements into playable Ink plus sidecar receipts and, -when illustrated replay is in scope, a separate visual plan artifact. - -The Branch Compiler is trainable because good branching structure is not just -syntax. It needs to decide where choices belong, which consequences can fold -into compact variables, which choices deserve route splits, which callbacks must -exist later, and how visual modifiers attach to actual state. Deterministic code -can validate Ink and refs. It cannot, by itself, know whether a branch feels -meaningful or whether convergence is lying. - -Training artifacts: - -- fixture brief -- source-grounded lore digest refs -- input branch candidates -- reviewed consequence packets -- fold plan -- generated Ink -- generated sidecar -- generated visual plan -- compiler notes -- variable set/read map -- route split or fold rationale -- visual prompt handles -- reviewer findings and repair labels - -The compiler does not own hidden character truth, participant appraisal, or -durable social mutation. It materializes structure from already reviewed or -explicitly marked draft material. - -### IF Artifact Reviewer - -Audits playable branch artifacts before they enter the accepted corpus. - -This reviewer is separate from the branch compiler because compilers are very -good at producing valid little lies. The reviewer checks whether tracked state -actually matters, whether choices change future affordances or outcomes, whether -folds preserve callbacks, whether visual modifiers correspond to real branch -state, and whether endings read the variables the story told us were important. - -Training artifacts: - -- Ink fixture under review -- sidecar under review -- coordinator artifact -- compiler notes -- validation output -- accepted/rejected decision -- severity-ranked findings -- failure labels such as `potemkin_state`, `cosmetic_choice`, `fake_fold`, - `missing_state_read`, `state_named_instead_of_checked`, - `visual_callback_missing`, and `ending_ignores_major_state` -- required fixes -- repaired artifact refs, when available - -Early branch-and-fold reviews are seed material for this organ because they -caught decorative variables before they were allowed to become training sludge. - -### Institution, Faction, And Consumer Decision Models - -Eventually Ghostlight should support economic behavior and major faction -decision-making inside a simulated game world. - -Training artifacts should preserve why agents: - -- buy -- refuse -- trade -- hoard -- comply -- defect -- conceal -- reveal -- punish -- help -- lobby -- exploit -- delay -- sacrifice - -The artifact should preserve perceived cost, scarcity, status pressure, -reputation risk, expected future contact, faction norms, institutional authority, -and moral injury when present. - -Do not train a dialogue-only pet if the adult machine needs to decide whether a -clinic buys counterfeit cryo valves under blockade. - -## Artifact Status - -Soft artifacts should use explicit review status: - -- `accepted` -- `accepted_as_draft` -- `useful_needs_revision` -- `rejected` -- `superseded` - -Rejected artifacts remain valuable when the failure label is clear. A rejected -Navigator action that makes a cetacean walk across a human hallway is not trash. -It is a negative example with teeth. - -## Training Corpus Families - -Ghostlight should expect several related corpora rather than one heroic pile of -JSONL wearing a crown. - -- projection corpus -- projected-local-context corpus -- coordinator/story-runtime corpus -- character-action corpus -- dialogue/prose response corpus -- participant-appraisal corpus -- state-mutation corpus -- relationship/perception corpus -- lore-grounding digest corpus -- Aetheria responder corpus -- Ink branch annotation corpus -- Branch compiler corpus -- IF artifact review corpus -- institution/faction/consumer decision corpus -- negative-example corpus - -Some examples can belong to multiple corpora through references. Do not duplicate -truth; link artifacts by ids and source refs. - -## Aetheria-Tuned Agent Model - -The character agent itself is a training target. - -A sensible long-term stack looks like this: - -```text -AetheriaLore source corpus - -> source-grounded digests and scene fixtures - -> coordinator scene plans and glue-prose receipts - -> reviewed Ghostlight action/dialogue/appraisal artifacts - -> Aetheria-tuned responder or agent model - -> specialized coordinator/projector/appraiser/mutator students - -> deterministic runtime gates and validators -``` - -The Aetheria-tuned agent model should learn setting priors and voice ecology: -what institutions feel like, how factions misread each other, what bodies can do, -what pressure sounds like when nobody in the room has enough authority to fix the -machine. - -It should not replace Ghostlight state. It should not decide hidden facts. It -should not mutate world state directly. It acts inside the local context and -affordances Ghostlight provides. - -## Deterministic Gates Stay Deterministic - -Training models does not remove hard gates. - -Keep these as code: - -- schema validation -- source provenance checks -- speaker-local visibility -- prompt leakage checks -- action enum validation -- body-affordance validation when source-backed -- mutation authority -- object custody -- resource and world-state legality -- Ink compilation -- artifact review status requirements - -A model can propose. The runtime decides what is legal, what is visible, what is -accepted, and what becomes state. - -## Near-Term Policy - -During prototype work: - -1. Keep fuzzy updates manual and reviewed. -2. Emit every model call as a receipt when it teaches something. -3. Store accepted and rejected examples with failure labels. -4. Prefer narrow artifacts over one vague transcript blob. -5. When a prompt fix reveals a reusable failure mode, promote it into validator - logic or artifact schema. -6. When a model repeatedly performs a soft judgment well, mark that organ as a - candidate for distillation or fine-tuning. -7. When it repeatedly fails in a patterned way, save the failures. The beast is - drawing us a map in crayon. - -The point is not to automate everything today. The point is to stop losing the -manual intelligence we are already spending. diff --git a/docs/architecture/technology-item-manifest-plan.md b/docs/architecture/technology-item-manifest-plan.md deleted file mode 100644 index 725a07e..0000000 --- a/docs/architecture/technology-item-manifest-plan.md +++ /dev/null @@ -1,646 +0,0 @@ -# Technology And Item Manifest Plan - -Ghostlight future exploration should produce more than scenes. It should produce -the technical and economic knowledge Aetheria needs for gameplay: what items can -exist, who can build them, what they are made of, which assemblies can be -swapped, what supply chains they depend on, and which factions start with which -tech bases. - -This is not separate from story generation. Major-player decisions, faction -births, branch pressures, and technological discoveries shape the economy. If a -branch discovers a better aetheric emitter, that should eventually change ship -builds, market dependencies, quest hooks, factory politics, salvage value, and -what a desperate mechanic can realistically bolt into a hull without creating a -beautiful obituary. - -The economy is bigger than ship parts. Players moving freight should carry the -ordinary manufactured life of colonies too: habitat fittings, clinic equipment, -interface furniture, ritual goods, industrial consumables, food-processing -systems, maintenance packs, education kits, luxury nonsense, and all the other -things a settlement consumes without ever bolting them into a laser. A trade -economy made only of gear components would be a very fancy skeleton. - -## Source Premise - -Aetheria game design wants ships to be tools, homes, status symbols, and -material compromises. Customization is driven by components with distinct -behavior, manufacturers with priorities and specialties, and vessels tuned for -violence, trade, survival, logistics, or prestige. - -Ghostlight should turn worldbuilding exploration into the data needed to support -that design. - -## Player Fantasy - -The deep gear model is not a loot-affix treadmill. The fantasy is provenance. - -A player hunting for the ultimate laser should be able to trace the item through -its parts, makers, technologies, and accidents: - -- the emitter assembly came from a short-lived manufacturer whose process was - only stable for nine months -- the beam-control wafer uses a regulatory-buried fabrication step no successor - company wants to admit worked -- the thermal rejection assembly is sturdy but mediocre, quietly strangling the - whole weapon -- a pirate rebuild replaced the targeting interface with a counterfeit part - that improves lock speed while making maintenance ugly -- a factional embargo means the good driver wafers are technically illegal, - practically everywhere, and therefore excellent quest bait - -An "ultimate item" is not just the best blueprint. It is the best realized -artifact: the right blueprint, built from the right assemblies, with the right -quality, provenance, manufacturer practice, replacement history, and operating -conditions. If a player wants to rebuild it as the best it can be, the game -should let them hunt the supply chain: salvage yards, old corporate stockpiles, -specialist shops, faction arsenals, black-market refits, inherited ships, -forgotten factories, and small wars over a beam-control wafer some dead -manufacturer only made for nine months before the board got eaten by regulators. - -This is why Ghostlight matters. A spreadsheet can name a laser. Ghostlight should -help explain why that laser exists, who can build it, which parts are worth -killing for, why a particular instance is special, and what stories fall out of -trying to make it better. - -## Content Refinery - -The old bottleneck was not ideas. Ideas are cheap. Volunteer design goblins can -produce a hill of them before lunch and leave the database work sitting there -like a little corpse. - -The real bottleneck is converting taste, lore, mechanics, and future-tech -imagination into loadable, reviewable, schema-shaped content. Ghostlight's -technology pipeline should act as a content refinery: - -1. Ground the request in Aetheria lore: faction, era, location, tech base, - industrial limits, political pressure, and known source constraints. -2. Decompose the concept into item families, assemblies, subassemblies, - components, colony-consumed manufactured goods, materials, processes, - tooling, facilities, expertise, demand profiles, and supply-chain - dependencies. -3. Map each candidate onto the Aetheria-Economy blueprint model: - `SimpleCommodityData`, `CompoundCommodityData`, `ConsumableItemData`, - `GearData`, or another `EquippableItemData` subclass. -4. Define performance intent through behaviors, `PerformanceStat` fields, - quality sensitivity, failure modes, upgrade surfaces, and operating - constraints. -5. Define realized-instance variation: assembly provenance, manufacturer - branding, quality, repair history, counterfeit substitutions, salvage scars, - and ownership chain. -6. Emit reviewable artifacts that separate source facts, inferred engineering, - branch-local assumptions, engine-schema gaps, rejected ideas, and accepted - candidates. -7. Export or hand off accepted candidates as database-shaped content rather than - another swamp of clever prose someone has to manually translate later. - -The goal is not infinite content sludge. The goal is volume with preserved taste: -many plausible blueprints, variants, manufacturers, counterfeit versions, -salvage stories, and supply-chain hooks that still feel like Aetheria. - -## Economy Schema Target - -Ghostlight should target the existing Aetheria-Economy item model instead of -inventing a parallel item taxonomy. - -The concrete source is: - -- `E:\Projects\Aetheria-Economy\Assets\Scripts\ServerShared\ItemData.cs` -- `E:\Projects\Aetheria-Economy\Assets\Scripts\ServerShared\ItemInstance.cs` -- `E:\Projects\Aetheria-Economy\Assets\Scripts\ServerShared\CultCache\` - -The important split: - -- `ItemData` and subclasses are CultCache-backed technological blueprint - records: a way of constructing a thing in the game, including the parameters, - behaviors, stat curves, and category fields that make that construction - meaningful. -- `ItemInstance` and subclasses are runtime objects that link to definition - records and represent manufactured artifacts in the world. -- Ghostlight item manifests should normally propose blueprint/data records, not - individual runtime artifacts. -- Runtime instances belong in simulation, inventory, scene state, cargo, loot, - and world-state fixtures. They are where realized quality, supply-chain - provenance, manufacturer branding, and assembly history can make two items - built from the same blueprint differ in practice. - -Blueprint classes currently relevant to Ghostlight: - -- `SimpleCommodityData` - - basic fungible resources such as steel, hydrogen, volatiles, or feedstock - - maps to `SimpleCommodity` runtime instances with quantity -- `CompoundCommodityData` - - technological blueprints for crafted commodities, assemblies, - subassemblies, processed materials, colony-consumed trade goods, and other - manufactured economic units - - not every compound commodity is an input to higher-level gear; many are - finished manufactured goods consumed by colonies, habitats, institutions, - ships, clinics, farms, sanctuaries, and cultural communities - - maps to `CompoundCommodity` runtime instances whose quality and provenance - can affect downstream items, settlement demand, service quality, comfort, - productivity, legitimacy, maintenance load, or faction-specific living - standards -- `ConsumableItemData` - - usable consumables with behaviors, duration, stackability, icon, and - effectiveness curve - - maps to `ConsumableItem` runtime instances -- `GearData` - - technological blueprints for usable equippable items with hardpoint, - behavior, durability, thermal, audio, schematic, and action-bar fields - - maps through `EquippableItem` runtime instances whose realized quality, - provenance, manufacturer, and installed assembly lineage can alter actual - performance -- `WeaponItemData`, `HullData`, `CargoBayData`, `DockingBayData`, and other - `EquippableItemData` subclasses are specialized top-level usable item - definitions. - -Manifest artifacts should therefore use Ghostlight's conceptual decomposition to -produce reviewed candidate technological blueprints for Aetheria-Economy data -classes: - -```text -material/feedstock -> SimpleCommodityData -component/subassembly/assembly -> CompoundCommodityData -manufactured colony trade good -> CompoundCommodityData -consumable usable item -> ConsumableItemData -equippable usable item -> GearData or another EquippableItemData subclass -weapon -> WeaponItemData -hull/frame/cargo/docking item -> HullData, CargoBayData, DockingBayData, etc. -runtime cargo, inventory, or freight -> SimpleCommodity, CompoundCommodity, - ConsumableItem, or EquippableItem instances -``` - -The conceptual layers below are still useful. They describe how Ghostlight -breaks a technology into reviewable engineering, logistics, and gameplay pieces. -They are not a replacement database schema. The output should be able to say -which Aetheria-Economy blueprint class each candidate wants to become, what -fields are source-backed, what fields are inferred, and which fields require -new engine schema before they can be loaded. - -`PerformanceStat` is the core bridge from blueprint to realized item behavior. -Blueprint data defines stat ranges and quality sensitivity; runtime instances -and equipped/active contexts determine actual evaluation through quality, -durability, heat, effectiveness, and modifiers. Ghostlight manifests should -therefore preserve the difference between: - -- blueprint-level performance intent -- assembly or subassembly contribution to quality and stat behavior -- realized instance provenance and manufacturer branding -- in-world operating conditions that change evaluated performance - -If a Ghostlight manifest needs fields Aetheria-Economy does not currently store, -mark them as manifest-side metadata or source gaps. Do not pretend CultCache -already has slots for every nice idea. The future can have organs; today it has -classes. - -## Nebulous Technology Elaboration - -Aetheria already has plenty of named technologies. Many of them are currently -high-level lore objects rather than actionable game objects. That is fine for a -timeline note. It is not enough for an item blueprint database. - -Ghostlight's exploration pipeline should elaborate existing vague technologies -into blueprint candidates. - -For each nebulous technology, produce: - -- source summary -- inferred operating principle -- gameplay role -- item families enabled -- assemblies and subassemblies implied -- critical components -- materials -- manufacturing processes -- tooling and facility requirements -- required expertise -- quality tiers -- failure modes -- maintenance needs -- salvage value -- counterfeit risk -- substitute parts -- faction access and restrictions -- supply-chain bottlenecks -- prerequisite technologies -- downstream technologies enabled -- branch-local variants -- open lore questions - -This is where a phrase like `super-Planckian emitter` stops being a decorative -sci-fi noun and becomes a logistics problem with teeth. - -If Ghostlight cannot yet know the exact real physics, it should still propose a -consistent fictional engineering stack: what must be fabricated, stabilized, -aligned, cooled, calibrated, certified, transported, repaired, and monopolized. -The output should be reviewable, revisable, and eventually loadable into a game -database. - -Do not hallucinate certainty. Mark inferred engineering as inferred. Mark source -facts as source facts. Mark branch-local innovations as branch-local. The -manifest is allowed to deepen the world; it is not allowed to pretend an -invention arrived without provenance. - -## Item Knowledge Goals - -Every explored technology or item family should be able to answer: - -- what the item does -- what gameplay role it serves -- what systems it plugs into -- what components and subassemblies it requires -- which assemblies are swappable upgrade surfaces -- whether it is a finished colony-consumed trade good rather than an assembly - input -- what population, institution, habitat, ship, or faction demand profile - consumes it -- what service, comfort, legitimacy, safety, productivity, cultural continuity, - or maintenance need it satisfies -- which materials, processes, or specialists are bottlenecks -- which factions or manufacturers can build it -- which factions can maintain it but not manufacture it -- which factions can counterfeit, salvage, or adapt it -- which tech prerequisites unlock it -- which branch conditions or discoveries created it -- which quests, markets, or conflicts it enables -- which blueprint records it should create or update - -## Manifest Object Types - -Use these object layers when producing tech data. Each layer must also declare -its intended Aetheria-Economy target class or state that it is manifest metadata -only: - -- `item_family` -- `item_variant` -- `assembly` -- `subassembly` -- `component` -- `material` -- `process` -- `tooling` -- `expertise` -- `facility` -- `manufacturer` -- `supply_node` -- `upgrade_slot` -- `blueprint` -- `tech_prerequisite` -- `quality_tier` -- `failure_mode` - -An `item_family` is a broad class, such as laser weapon, radiator, aetheric -drive, cryo valve, sensor mast, or habitat seal. - -An `item_variant` is a concrete build with stats, faction/manufacturer flavor, -quality tier, and branch-specific assumptions. - -An `assembly` is a replaceable functional unit. For a laser, emitter assembly, -power conditioning assembly, thermal rejection assembly, beam-control assembly, -targeting interface, and housing are likely assemblies. - -A `subassembly` is a nested unit inside an assembly. The emitter assembly may -include gain medium, field lattice, focusing microstructure, alignment actuator, -control wafer, and contamination seal. - -A `component` is the smallest useful gameplay/logistics unit worth tracking. -Do not split screws unless screws are the point of the quest. The machine has -standards. Barely. - -A `manufactured_trade_good` is a finished compound commodity whose primary role -is economic consumption rather than becoming a higher-level gear assembly. It -may still have components and quality tiers, but the point is that colonies, -ships, habitats, clinics, sanctuaries, temples, schools, or faction enclaves -consume it as part of ordinary life and institutional function. - -Example: a Navigator wet-interface cradle would likely be a -`CompoundCommodityData` candidate. It is not a ship weapon or a laser component. -It is a manufactured interface good consumed by Navigator habitats, route -annexes, mixed-species relay stations, sanctuary registrars, and other spaces -where cetacean or aquatic-adapted cognition must participate in shared -procedure. Its demand profile might be driven by Navigator population share, -route-steward institutions, translation infrastructure, acoustic signaling -standards, maintenance water quality, clinic/sanctuary access, and local -prestige around dignified embodiment. Quality might affect comfort, signal -clarity, translation latency, stress load, infection risk, repair frequency, or -institutional legitimacy. - -A `blueprint` is the technological construction record represented by the -appropriate Aetheria-Economy `*Data` class. It should be specific enough for a -game system to evaluate whether a faction, factory, ship, or player can build -the item, and how sub-assemblies affect performance through quality-sensitive -stats and behavior parameters. - -Ghostlight manifests still need explicit assembly trees, compatibility rules, -supply-chain dependencies, and manufacturing gates. If the current engine schema -does not expose those fields directly, keep them as manifest metadata or -engine-schema gaps attached to the target `*Data` blueprint rather than -pretending they are separate from the blueprint concept. - -A `tech_prerequisite` is a required discovery, process, standard, license, -facility, or expertise gate. - -A `quality_tier` describes meaningful gameplay variation: crude, standard, -premium, military, experimental, branch-exotic, counterfeit, degraded, salvaged, -or other reviewed tiers. - -A `failure_mode` describes what breaks, how it breaks, and what that failure -costs in gameplay, safety, logistics, reputation, or maintenance. - -## Example Pattern: Laser Upgrade Surface - -A laser design should be represented so a higher-tech emitter assembly can alter -performance without rewriting the whole item. - -Example structure: - -```text -item_family: laser_weapon - item_variant: sol_pattern_industrial_laser_mk2 - assembly: emitter_assembly - subassembly: gain_medium - subassembly: focusing_lattice - subassembly: alignment_actuator - assembly: power_conditioning_assembly - assembly: thermal_rejection_assembly - assembly: beam_control_assembly - assembly: targeting_interface - assembly: housing_and_mount -``` - -A branch-local future might discover an aether-stabilized emitter assembly. That -should produce: - -- a new assembly or subassembly record -- prerequisite discoveries -- materials and tooling -- compatibility rules with older laser families -- performance changes -- heat, stability, cost, legality, maintenance, or supply-chain consequences -- factions able to manufacture or adapt it -- quests or market events unlocked by scarcity - -## Example Pattern: Super-Planckian Emitter - -When a source names a technology like `super-Planckian emitter`, Ghostlight -should elaborate it into at least a candidate blueprint stack. - -Example working decomposition: - -```text -item_family: exotic_emitter - item_variant: super_planckian_emitter_core_candidate - assembly: emitter_lattice_assembly - subassembly: boundary_condition_lattice - subassembly: phase-lock microstructure - subassembly: exotic containment frame - assembly: field_drive_assembly - subassembly: pulse shaper - subassembly: high-stability driver wafer - subassembly: feedback quench circuit - assembly: thermal_and_causality_safety_assembly - subassembly: transient heat sink - subassembly: event-spike monitor - subassembly: failsafe isolation gate - assembly: calibration_and_control_assembly - subassembly: metrology package - subassembly: firmware governor - subassembly: certification seal -``` - -That decomposition is not automatically canon. It is a candidate manifest. A -reviewer can accept, reject, revise, or mark source gaps. The important point is -that the technology now has places for supply chains to attach: - -- lattice fabrication -- exotic containment materials -- high-stability driver wafers -- metrology packages -- safety gates -- certification regimes -- specialist calibration expertise -- heat rejection and failure containment - -Once those exist, the game can ask useful questions: - -- who owns lattice fabrication? -- who can counterfeit the driver wafer? -- what happens if the safety gate is downgraded? -- can a higher-tier emitter assembly fit into an older laser housing? -- which faction can maintain it after three jumps and one bad decision? -- what quest appears when the certification seal supply collapses? - -## Pre-Elysium Starting Tech - -Pre-Elysium tech is not a monolith. Everyone was shunted into Elysium together, -but not every faction brought the same industrial base, doctrine, standards, -stockpiles, expertise, or manufacturing rights. - -Ghostlight should generate starting tech manifests for the single-history Sol -artifact: - -- base technologies available before the Rupture -- faction access and restrictions -- manufacturing standards -- dominant manufacturers -- known substitute parts -- logistics bottlenecks -- maintenance dependencies -- doctrine-driven design differences -- legal restrictions and export controls -- black-market or pirate adaptations -- blueprint records for starting equipment, ship systems, weapons, habitats, - medical systems, industrial tooling, logistics infrastructure, colony - furnishings, habitat equipment, institutional interface goods, and finished - manufactured trade goods consumed by settlements - -This matters because Elysium branches inherit different practical capabilities -from the same shared Sol history depending on what each faction controls in that -branch. - -## Post-Rupture Innovation - -Post-Rupture innovation is branch-local canon indexed by lineage. - -When exploration discovers a technology, the manifest should record: - -- branch id and lineage -- prior conditions -- triggering event or pressure -- involved factions, inventors, institutions, or nonhuman actors -- source-backed post-Elysium concepts used -- generated branch assumptions -- prerequisite tech and discoveries -- item families affected -- assemblies or subassemblies created -- supply chain changes -- market/faction consequences -- quest hooks opened -- sibling branches where this innovation does not exist or differs -- blueprint records created or modified -- compatibility with pre-Elysium assemblies - -Aetheric drives, necrotech interfaces, spirit-mediated sensors, temporal memory -archives, pseudospace logistics, and mutable-body support equipment should all -leave this kind of trail when explored. - -## Faction Tech Bases - -For each faction or manufacturer, track: - -- known technologies -- restricted technologies -- lost or inaccessible technologies -- signature design preferences -- manufacturing strengths -- maintenance weaknesses -- doctrine-driven compromises -- supply dependencies -- export controls -- counterfeiting exposure -- salvage behavior -- branch-local innovations - -A faction can understand a technology without being able to build it. It can -install a component without being able to maintain it. It can maintain an item -only by depending on a hated supplier. These distinctions are the gameplay. - -## Coordinator Obligations - -The coordinator/story runtime must emit technology and economy knowledge when a -scene or branch decision changes the material world. - -Coordinator artifacts should include item-manifest deltas when they discover or -alter: - -- technology availability -- component compatibility -- assembly upgrade paths -- colony-consumed manufactured goods -- demand profiles -- materials and manufacturing processes -- supply bottlenecks -- faction access -- market pressure -- quest hooks -- salvage opportunities -- maintenance constraints - -The coordinator is allowed to propose item knowledge. Deterministic validators -and reviewer gates decide whether it becomes a manifest update. - -## Training Artifacts - -Tech/item exploration should emit reviewed artifacts for future models: - -- item manifest records -- component breakdown records -- assembly compatibility records -- colony trade-good records -- demand-profile records -- faction tech-base records -- supply-chain dependency records -- technology discovery records -- branch-local innovation records -- economic consequence records -- rejected overpowered or unsupported item designs -- source-gap records requiring AetheriaLore elaboration - -These artifacts train: - -- coordinator/story runtime -- institution/faction decision models -- consumer and market behavior models -- item-generation models -- lore/source evaluators -- retrieval models for tech prerequisites and dependencies - -## First Schema Target - -The next concrete schema after coordinator artifacts should be a manifest seam -that maps directly onto Aetheria-Economy's technological blueprint classes: - -- `schemas/item-manifest.schema.json` -- `schemas/item-blueprint-candidate.schema.json` -- `schemas/item-instance-provenance-candidate.schema.json` -- `examples/item-manifest/pre-elysium-starting-tech.template.json` -- `examples/item-manifest/future-branch-innovation.template.json` -- `examples/item-manifest/super-planckian-emitter.candidate.json` -- `tools/validate_item_manifests.py` - -Minimum fields: - -- manifest id -- fixture lane -- branch lineage, if any -- source refs -- source-backed facts -- inferred engineering -- open lore gaps -- item family or technology id -- object layer -- consumption role: assembly input, finished trade good, consumable, gear, or - metadata-only -- target Aetheria-Economy class -- target blueprint id, when updating an existing record -- candidate blueprint fields -- blueprint candidate ids -- instance provenance fields, when simulating manufactured artifacts -- parent assembly refs -- child component refs -- materials/process/tooling/facility refs -- colony, habitat, institutional, cultural, or factional consumption drivers -- faction/manufacturer access -- prerequisites -- bottlenecks -- compatibility rules -- quality tiers -- failure modes -- gameplay effects -- economic consequences -- quest hooks -- engine-schema gaps -- review status - -Candidate blueprint fields should be shaped around existing data classes first: - -- shared `ItemData` blueprint fields: `Name`, `Description`, `Manufacturer`, - `Mass`, `Shape`, - `SpecificHeat`, `Conductivity`, `Price` -- `SimpleCommodityData`: `MaxStack`, `Category` -- `CompoundCommodityData`: `DemandProfile`, `Category` -- `ConsumableItemData`: `Behaviors`, `Stackable`, `Duration`, `Icon`, - `Effectiveness` -- `EquippableItemData` and subclasses: `Schematic`, `Behaviors`, `Durability`, - temperature fields, heat performance curve, resilience, icons, sound data, - `HardpointType`, and subclass-specific fields such as weapon range, caliber, - fire type, hull hardpoints, cargo interiors, or docking size - -Ghostlight may propose additional manifest fields, but validators should label -them as metadata, engine-gap, or rejected. Do not silently smuggle non-engine -fields into supposed CultCache records. - -## Data Generation Policy - -During worldbuilding exploration: - -1. If a scene implies a new item, component, supply bottleneck, or technology - dependency, emit a manifest candidate. -2. If a scene implies a manufactured good that a colony, habitat, ship, - institution, species community, or faction consumes, emit a - `CompoundCommodityData` candidate with a demand profile, even if it is not an - assembly input for gear. -3. If a faction decision changes what can be manufactured, maintained, bought, - salvaged, counterfeited, or upgraded, emit a faction tech-base delta. -4. If an innovation appears in Elysium, label its branch lineage and prior - conditions. -5. If existing lore names a technology but lacks blueprint detail, elaborate it - into a candidate manifest with explicit inferred fields and source-gap notes. -6. If the item relies on unsupported lore, patch AetheriaLore or mark a source - gap before treating it as stable. -7. If an item is cool but breaks logistics, keep it as a rejected artifact with - the failure label. Beautiful nonsense is still training data if tagged before - it bites someone. - -Ghostlight should discover the future by exploring it, but every discovery -should leave inventory. The game cannot build a supply chain out of vibes and -one haunted laser. diff --git a/docs/architecture/training-plan.md b/docs/architecture/training-plan.md deleted file mode 100644 index 38572d3..0000000 --- a/docs/architecture/training-plan.md +++ /dev/null @@ -1,1300 +0,0 @@ -# Ghostlight Training Plan - -This document enumerates the trainable stages in Ghostlight so data generation -stays aimed at the machine we are building instead of becoming a heap of -interesting corpses. - -The rule is simple: deterministic code owns legality, visibility, schemas, -resource math, source provenance, Ink compilation, and mutation gates. Models -handle judgment, language, social inference, prioritization, and coordination. -Every model-facing judgment should leave a reviewed artifact. - -Ghostlight is also the training ground for VoidBot's social intelligence. The -appraiser and relationship/perception organs must remain useful for reading real -human interaction over time: forming grounded opinions, noticing uncertainty and -misread risk, tracking trust, irritation, concern, respect, boundaries, and -expectations, and revising those impressions when later evidence contradicts -the first read. If these organs only work for fictional NPC scene mutation, they -have missed one of the original reasons the project exists. - -## Timeline Coverage - -Ghostlight training should cover three timeline lanes: - -- `historical_grounded`: authored late-Sol and pre-Elysium history, used for - primary grounded social pressure. -- `transition_grounded`: the rupture, displacement, and early Elysium shock, - used for continuity between old institutions and altered conditions. -- `future_branch`: possible post-Rupture Elysium futures, used to teach models - Aetheria's stranger concepts as branch-local canonical histories. - -The future branch lane is not optional. The models need to handle post-Rupture -concepts such as Aether, pseudospace, temporal nonlinearity, spirits, necrotech, -mutable bodies, altered substrates, and new species or institutional forms. Late -Sol teaches the old damage. Elysium teaches what the damage does when reality -starts handing out knives with metaphysics on the receipt. - -Sol timeline data is a single-history artifact. Elysium timeline data is -conditional canon: every possible future is true inside the branch whose prior -state produced it. Training data must preserve branch lineage so the model -learns conditional continuity instead of mashing incompatible futures into one -omnivorous sludge. - -Future-branch examples must label: - -- source constraints from authored post-Elysium concepts -- generated branch assumptions -- local branch facts -- branch lineage and prior conditions -- sibling-branch exclusion boundaries -- branch-local facts that must not leak into single-history Sol training or - unrelated Elysium branches -- event constraint type: `branch_attractor`, `fated_event`, - `tech_order_constraint`, `quest_injection`, or `branch_local_event` -- prerequisites, exclusions, and pull strength for constrained events -- the post-Rupture concept being exercised -- the old social pressure being re-expressed - -## Lore Coverage Matrix - -No single fixture is a corpus. A complete Aetheria training corpus needs -coverage across the setting's institutional ecology before the models can be -trusted to carry tone, conflict, and cultural priors without constant hand -feeding. - -Before calling the corpus complete, generate reviewed story/scenario coverage -for: - -- every major faction -- every minor faction -- every movement and counter-project -- every major historical flashpoint -- every major post-Rupture concept or branch-attractor family used in gameplay -- faction-adjacent institutions that strongly shape daily life, trade, law, - care, warfare, media, faith, logistics, or embodiment - -Major factions need at least two distinct story types: - -- `founding_era_story`: the faction's formative pressure, first stable myth, - early institutional compromise, or founding betrayal. -- `day_in_the_life_story`: ordinary operating texture after the faction has - matured, showing how people actually live inside its systems. - -Minor factions, movements, and flashpoints need at least one strong story or -branching-scene fixture each, plus negative or rejected examples where the first -attempt collapses into stereotype, lore drift, or generic sci-fi wallpaper. - -Every accepted coverage story should involve cultural collision. Do not write -sealed terrariums where one faction monologues at itself and calls that -worldbuilding. The useful data comes from contact: - -- major faction versus major faction -- major faction versus minor faction -- faction versus movement -- movement versus movement -- institution versus care network -- local colony versus imported authority -- species/body affordance versus human-default infrastructure -- technical standard versus ritual, law, class, scarcity, or dignity - -Coverage records should tag: - -- primary faction or movement -- secondary and tertiary factions or movements -- flashpoint or era -- story type: `founding_era_story`, `day_in_the_life_story`, - `flashpoint_story`, `movement_story`, `future_branch_story`, or - `trade_life_story` -- collision axis: law, care, class, logistics, species/body, labor, faith, - media, war, trade, personhood, ecology, memory, technology, or legitimacy -- involved cultures and their mutual misreads -- item/economy hooks discovered, including colony-consumed trade goods -- source refs and open lore gaps -- accepted, rejected, or needs-revision review status - -The first pass can be shallow and uneven. The final corpus cannot be. If one -flashpoint starts producing all the examples, stop and rebalance before the -model learns that Aetheria is mostly one corridor argument wearing different -coats. - -Some Elysium events are not globally fixed, but they are not equally optional -either. Founding events for Elysium-born factions, technology discoveries, -metaphysical practices, and quest hooks should be represented as attractors, -rails, or injections when appropriate. - -- `branch_attractor`: likely under recurring pressures, with local variation. -- `fated_event`: authorially constrained to occur unless the branch disables it. -- `tech_order_constraint`: locked behind prerequisite discoveries or systems. -- `quest_injection`: authored content inserted into compatible branch points. -- `branch_local_event`: true only inside its lineage, with no cross-branch pull. - -Future exploration must also emit technology and item knowledge when a branch -discovers or changes material capability. See -`docs/architecture/technology-item-manifest-plan.md` for the manifest seam. That -seam targets the existing Aetheria-Economy CultCache model: Ghostlight proposes -reviewed candidate `ItemData` technological blueprints such as -`SimpleCommodityData`, `CompoundCommodityData`, `ConsumableItemData`, `GearData`, -and specialized `EquippableItemData` subclasses, while runtime `ItemInstance` -objects belong to scene, inventory, cargo, provenance, branding, and world-state -simulation. - -`CompoundCommodityData` candidates are not limited to gear assemblies or -manufacturing inputs. They also cover finished manufactured trade goods consumed -by colonies, habitats, institutions, ships, clinics, species communities, and -faction enclaves. A generated detail like a Navigator wet-interface cradle is -therefore both world texture and a possible colony demand item, not just prose -decoration. - -## Runtime Stack - -Target runtime flow: - -```text -world state + author constraints + lore grounding - -> coordinator/story runtime - -> deterministic state slice and source checks - -> projector - -> sandboxed character agent/responder - -> event resolver and deterministic gates - -> participant appraiser - -> state mutator - -> relationship/perception updater - -> coordinator carries hooks, glue prose, and next beat - -> branch compiler materializes branch-and-fold Ink plus sidecar receipts - -> IF artifact reviewer accepts, rejects, or sends the fixture back -``` - -Some stages are trained as generative models. Some are trained as classifiers or -rankers. Some may remain manual longer than the rest because bad automation here -would create narrative sewage with confidence. - -## Corpus Scale Tiers - -The per-stage counts below are pilot gates, not robust training targets. - -Pilot data exists to shake out schema mistakes, artifact shape problems, -leakage boundaries, reviewer workflow, and validator gaps. It is allowed to be -sacrificial. If a pilot proves that the schema is wrong, update the schema and -accept that some pilot artifacts may become obsolete. Better a small controlled -burn than a cathedral built from cursed bricks. - -Use three corpus tiers: - -- `pilot_schema_shakedown` - - proves that artifacts can be produced, reviewed, validated, and loaded - - exposes missing fields, wrong boundaries, bad labels, and impossible - assumptions - - may be invalidated by schema changes -- `review_assistant_target` - - enough examples for a model to draft useful candidates under human or - frontier-model review - - still not trusted for unattended runtime mutation or simulation authority - - expected to include broad negative examples and repair labels -- `runtime_target` - - enough diversity, sequence coverage, negative coverage, and adversarial - checks to trust a model inside automated loops with deterministic gates - - requires held-out evaluation sets, regression fixtures, and failure audits - - still cannot bypass deterministic legality, visibility, source, or mutation - gates - -Approximate target scale: - -| Stage | Pilot Schema Shakedown | Review Assistant Target | Runtime Target | -| --- | ---: | ---: | ---: | -| Lore grounding compiler | 25 accepted / 25 rejected | 500+ digests | 2,000+ digests | -| Coordinator/story runtime | 50 accepted / 25 rejected | 1,000+ turns | 5,000+ turns | -| Memory/lore retriever | 500 labeled pairs | 5,000+ pairs | 50,000+ pairs | -| Projector | 100 accepted / 50 rejected | 1,000+ examples | 5,000+ examples | -| Character agent/responder | 200 accepted / 100 rejected | 2,000-5,000 turns | 10,000+ turns | -| Event resolver normalization | 100 reviewed examples | 1,000+ examples | 5,000+ examples | -| Participant appraiser | 300 appraisals | 3,000+ appraisals | 10,000+ appraisals | -| State mutator | 500 accepted / 200 rejected | 5,000+ patches | 10,000+ patches | -| Relationship/perception updater | 500 updates | 5,000+ updates | 20,000+ sequence updates | -| Branch compiler | 25 fixtures / 25 rejected | 500 fixtures | 2,000+ fixtures | -| IF artifact reviewer | 100 reviewed fixtures / 100 labeled failures | 2,000+ labeled fixtures | 10,000+ labeled fixtures | -| Guardrail/evaluator classifiers | 300 labeled failures | 3,000+ labeled outputs | 20,000+ labeled outputs | -| Institution/faction/consumer decisions | 500 decisions | 5,000+ decisions | 20,000+ decisions | -| Technology/item manifests | 100 records / 50 rejected | 1,000+ manifests | 5,000+ manifests | - -The exact numbers will move once we know which organs are narrow classifiers, -which are generative, which can lean on retrieval, and which are mostly -deterministic code wearing a little judgment hat. The important rule is that the -first gate proves the schema and workflow. It does not prove robustness. - -## Model Families - -Use these as the default architecture assumptions until evidence says otherwise. - -### Generative Decoder LLM - -Use for stages that must produce structured JSON plus prose or action text. - -Likely training method: - -- supervised fine-tuning -- LoRA or QLoRA for local experiments -- full fine-tune only after corpus shape stabilizes and the model deserves the - electricity - -Candidate stages: - -- coordinator/story runtime -- projector, if deterministic projection becomes too brittle -- character agent/responder -- branch compiler, if rule-assisted Ink materialization is too narrow for - authored fixture variety -- state mutator, only after the mutation schema is very stable -- institution/faction planner, if it needs explanations and mixed outputs -- item or technology manifest generator, if structured extraction from - coordinator exploration becomes too broad for deterministic templates - -### Classifier Or Cross-Encoder - -Use for stages that score or label an event, branch, or output. - -Likely training method: - -- supervised classification -- multi-label classification -- pairwise ranking when choosing between candidates -- calibrated confidence where downstream decisions need thresholds - -Candidate stages: - -- participant appraiser -- relationship/perception updater -- output evaluator -- IF artifact reviewer -- candidate action ranker -- lore/source violation detector -- prompt-leak detector -- branch-consequence and fake-fold detector -- technology and item manifest evaluator - -### Embedding Or Retrieval Model - -Use for selecting relevant memories, lore, prior events, and source snippets. - -Likely training method: - -- start with off-the-shelf embeddings -- add contrastive or triplet tuning only after enough positive and negative - retrieval examples exist - -Candidate stages: - -- memory retrieval -- lore retrieval -- precedent retrieval for coordinator planning -- technology prerequisite and component dependency retrieval - -### Deterministic Code - -Keep as code, not a model: - -- schema validation -- action enum validation -- visibility filtering -- object custody -- resource accounting -- mutation authority -- source provenance requirements -- Ink compilation -- artifact status validation -- world-state patch application -- item manifest validation and compatibility checks - -## Trainable Stages - -### 1. Lore Grounding Compiler - -Purpose: turn Aetheria source material into scene-local grounding digests. - -Current implementation: - -- mostly manual plus frontier-model assistance -- validated by `schemas/lore-grounding-digest.schema.json` - -Inputs: - -- AetheriaLore source paths and excerpts -- target time period -- target location or institution -- involved factions, species, roles, and social movements -- author constraints -- fixture lane: `historical_grounded`, `transition_grounded`, or - `future_branch` - -Outputs: - -- lore grounding digest -- cultural pressure fields -- factional misread maps -- material constraints -- post-Rupture concept constraints, when applicable -- speaker knowledge boundaries -- author-only exclusions -- open lore gaps -- generated branch assumptions, for future branches -- branch lineage and sibling-branch exclusion boundaries - -Training architecture: - -- generative decoder LLM for digest drafting -- classifier/evaluator for source-grounding failures -- retrieval model for source passage selection later - -Training artifacts: - -- accepted digests -- rejected digests -- source-gap records -- source violation labels -- corrections tied to AetheriaLore paths - -Pilot schema shakedown gate: - -- 25 accepted digests across distinct Aetheria eras or institutions -- 25 rejected/source-violation examples -- evaluator catches unsupported room-scale assumptions -- at least 5 future-branch digests exercising authored post-Elysium concepts - before training a responder expected to handle Elysium weirdness - -### 2. Coordinator Or Story Runtime - -Purpose: decide what happens next at the scene/story level and keep the whole -machine pointed at usable game content. - -Current implementation: - -- Codex/frontier coordinator in the loop -- authored glue prose -- manual world-state continuity - -Inputs: - -- game-engine-shaped world state -- scene state -- event history -- unresolved hooks -- active branch flags -- author constraints -- lore grounding digest refs -- available deterministic tools -- available soft organs -- prior reviewer notes -- fixture lane and canon status -- post-Rupture concept constraints for future branches -- active attractors, fated events, tech-order gates, and quest-injection hooks -- current technology and item manifest refs -- faction tech-base refs - -Outputs: - -- next beat or next scene plan -- selected acting agent -- tool/model invocation plan -- world-state refs read -- proposed world-state changes -- branch merge/split decision -- unresolved hooks carried forward -- glue prose -- reviewer-facing rationale -- generated branch assumptions and promotion candidates, for future branches -- branch lineage and conditional truth boundaries -- selected attractor, fate, technology, or quest constraints that shape the next - beat -- item, component, assembly, supply-chain, or faction tech-base deltas implied - by the scene or branch decision -- colony-consumed manufactured goods and demand-profile deltas implied by - habitats, institutions, species communities, interface needs, rituals, or - living standards - -Training architecture: - -- generative decoder LLM with tool-use style output -- possible candidate-plan ranker later -- retrieval model for prior event/hook selection - -Training artifacts: - -- coordinator plan records -- accepted and rejected glue prose -- branch continuity decisions -- tool invocation traces -- world-state proposal receipts -- attractor/rail/injection selection receipts -- item-manifest proposal receipts -- faction tech-base delta receipts -- reviewer labels for pacing, continuity, legibility, game usefulness, and lore - grounding - -Pilot schema shakedown gate: - -- 50 accepted coordinator turns across at least 5 scenes -- 25 rejected coordinator turns with labeled failures -- structured world-state refs present in every accepted example -- glue prose never treated as canonical state -- at least 10 accepted future-branch coordinator turns before using the - coordinator to generate post-Rupture arcs without close review -- at least 20 labeled constrained-event examples before the coordinator is - trusted to inject quests or advance technology order automatically -- at least 25 reviewed item/faction-tech deltas before coordinator exploration - is allowed to create technology data without close review - -### 3. Memory And Lore Retriever - -Purpose: choose what memories, events, and lore snippets are relevant to a turn. - -Current implementation: - -- deterministic selection and manual source checks -- semantic source search through existing tooling when needed - -Inputs: - -- acting agent id -- scene id -- current pressure -- event history -- memory store -- lore grounding corpus -- query or coordinator intent -- fixture lane and canon status - -Outputs: - -- ranked memory refs -- ranked lore/source refs -- rejected irrelevant refs -- retrieval rationale or labels -- source-constraint versus branch-assumption labels when retrieving future - branch context -- branch-lineage labels so sibling futures are not retrieved as if they were - shared facts - -Training architecture: - -- embedding model or bi-encoder for recall -- cross-encoder reranker for precision -- start off-the-shelf; tune only after labels exist - -Training artifacts: - -- selected refs -- rejected refs -- reviewer relevance labels -- missed-critical-context labels - -Pilot schema shakedown gate: - -- 500 labeled retrieval pairs before tuning -- evaluation set includes false friends: similar vibe, wrong faction or era - -### 4. Projector - -Purpose: turn canonical state into character-local operating context. - -Current implementation: - -- projected context schema and validator -- deterministic projector behavior remains the first target, but no live - fixture-specific projector script is currently treated as canonical - -Inputs: - -- canonical agent state -- perceived overlays -- relationship stance -- current scene state -- relevant memories -- lore grounding digest -- observed event, when responding -- projection controls -- branch/canon status and generated-assumption boundaries -- active technology gates and quest constraints - -Outputs: - -- known local facts -- active pressures -- tensions -- action affordances -- constraints -- voice surface cues -- rendered prompt/context text -- audit refs to source state -- explicit distinction between source-backed facts and branch-local assumptions -- branch lineage and conditional truth boundaries -- unavailable action or knowledge constraints derived from tech order - -Training architecture: - -- keep deterministic while feasible -- generative decoder LLM student if deterministic projection becomes too rigid -- classifier/evaluator for leakage and unsupported pressure - -Training artifacts: - -- projected-local-context records -- projection examples -- prompt leakage failures -- source grounding failures -- reviewer corrections - -Pilot schema shakedown gate: - -- 100 accepted projection examples -- 50 rejected examples with clear failure labels -- stable input slicer -- evaluator catches private-state leakage and raw-state soup -- evaluator catches future-branch assumptions leaking into grounded historical - examples - -### 5. Character Agent Or Responder - -Purpose: choose and render what a character does next from local context. - -Current implementation: - -- responder packet and output schemas with validators -- reviewed packet, capture, and mutation receipts -- future gold responder data should use isolated generation workers, - sub-agents, or external model calls that receive only the projected local - packet, not coordinator context - -Inputs: - -- projected local context -- allowed action primitives -- visible event, if responding -- local affordances -- character-local goals, memories, relationship read, and constraints -- Aetheria responder priors from training corpus, eventually -- post-Rupture concept constraints when the turn is in Elysium future branch - territory -- explicit source excerpts included in the projected packet, if any - -Forbidden inputs: - -- coordinator rationale -- other agents' private state -- author-only plot beats -- future branch plan -- hidden canonical facts not visible to the acting character -- raw canonical state variables the final responder model will not receive -- repo or lore browsing beyond excerpts intentionally provided to the responder - -Outputs: - -- selected action type -- observable action -- spoken text, if any -- actor intent -- candidate alternatives -- constraints satisfied or violated -- response rationale -- raw responder output before coordinator review -- reviewed output after coordinator intervention, if any -- coordinator intervention labels - -Training architecture: - -- generative decoder LLM -- SFT/LoRA on reviewed Aetheria response/action corpus -- pairwise preference or ranking later for choosing among candidate turns -- optional separate action-type classifier if generation keeps drifting - -Training artifacts: - -- exact responder-visible input packet -- hidden context refs without hidden content -- sandbox or isolation method -- raw responder output -- coordinator-reviewed output -- coordinator intervention labels -- action-choice receipts -- accepted and rejected turns -- negative examples for wrong body, wrong lore, wrong voice, omniscience, prompt - leakage, and agency collapse -- timeline-spread Aetheria response corpus -- future-branch responses exercising post-Rupture concepts as branch-local canon - without claiming branch facts apply to sibling histories - -Pilot schema shakedown gate: - -- 200 accepted character turns across eras, factions, species, and social roles -- 100 rejected turns with labeled failures -- at least 50 non-speech or mixed-action examples -- evaluation includes speaker-local secret boundaries and body affordances -- every accepted example preserves exact responder-visible input and raw output -- every coordinator repair is labeled instead of being treated as raw responder - behavior -- leakage evaluator catches outputs that require withheld context -- at least 50 accepted post-Rupture future-branch turns before expecting the - responder to handle Elysium-specific weirdness with reduced lore handholding - -### 6. Event Resolver - -Purpose: convert an action proposal into an observable event and mechanical world -changes. - -Current implementation: - -- mostly manual/reviewed for social consequences -- deterministic gates should own mechanical legality - -Inputs: - -- action proposal -- scene state -- world objects -- resources -- authority rules -- location constraints -- participant visibility -- branch/canon status for future generated facts -- technology and quest gates relevant to action legality - -Outputs: - -- observable event record -- legal mechanical world deltas -- perceived-by participant list -- blocked or modified action result -- unresolved facts -- branch-local mechanical facts versus promoted facts -- branch-local mechanical facts versus cross-branch source constraints -- blocked actions caused by missing prerequisites - -Training architecture: - -- mostly deterministic code -- classifier/evaluator for ambiguous action normalization later -- generative model only for explanatory event narration, not legality - -Training artifacts: - -- action-to-event receipts -- blocked-action examples -- normalized action labels -- mechanical delta records - -Pilot schema shakedown gate: - -- do not train until action/event schemas stabilize -- collect 100 reviewed action-to-event examples before considering normalization - assistance - -### 7. Participant Appraiser - -Purpose: interpret an observable event from one participant's local perspective. - -Current implementation: - -- manual reviewed appraisals in mutation receipts -- future appraiser data should keep exact observable events, participant-local - context, accepted interpretations, rejected interpretations, and review notes - -Inputs: - -- observable event -- participant-local state -- participant memories -- perceived relationship stance -- cultural priors -- scene pressure -- known facts and suspected facts -- human interaction history when the appraiser is being used for VoidBot -- conversational tone, timing, repair attempts, recurring preferences, and - boundary signals for human-facing appraisal -- post-Rupture concept being interpreted, if any - -Outputs: - -- private interpretation -- emotional appraisal labels -- intent read, including misread possibility -- threat/reassurance/obligation/humiliation/etc. labels -- proposed memory candidate -- proposed relationship implications -- confidence notes -- human-facing opinion updates when applicable: trust, concern, irritation, - respect, attachment, caution, boundary pressure, expected future behavior, - and what would change the read -- concept-specific misread labels, for weird Elysium phenomena - -Training architecture: - -- multi-label classifier or cross-encoder for labels -- generative decoder LLM for explanation and memory wording -- calibrated confidence model only after enough labels exist - -Training artifacts: - -- appraiser receipts -- misread/correct-read labels -- emotional appraisal labels -- rejected interpretations -- reviewer rationale -- VoidBot-facing human interaction appraisal receipts, including what was - observed, what was inferred, what stayed uncertain, what opinion changed, and - what evidence would reverse or soften the read - -Pilot schema shakedown gate: - -- 300 participant appraisal examples -- balanced set of correct reads, misreads, ambiguous reads, and biased reads -- examples include fundamental attribution bias and confidence movement -- at least 50 human-facing VoidBot appraisal examples before claiming the - appraiser is useful for companion-style memory, opinion, or user-read updates -- future-branch examples include socially grounded misreads of post-Rupture - phenomena - -### 8. State Mutator - -Purpose: apply reviewed appraisal into bounded agent, memory, relationship, and -world-state changes. - -Current implementation: - -- manual audited mutation receipts -- schema validation for final fixtures - -Inputs: - -- prior state refs -- event record -- participant appraisals -- mutation authority constraints -- accepted memory candidates -- relationship/perception implications -- canon status and promotion eligibility - -Outputs: - -- canonical state patch proposal -- memory writes -- perceived overlay updates -- relationship stance deltas -- activation deltas -- rejected or deferred deltas -- reviewer rationale - -Training architecture: - -- keep manual longest -- generative decoder LLM or structured patch model after schema stabilizes -- deterministic validator applies bounds and authority -- possible classifier for whether a delta is justified - -Training artifacts: - -- mutation receipts -- accepted patches -- rejected patches -- deferred unresolved facts -- validator failures -- branch-local patches separated from promoted state patches -- branch-local patches separated from cross-branch source constraints - -Pilot schema shakedown gate: - -- 500 accepted mutation examples -- 200 rejected/deferred mutation examples -- stable patch schema -- validator catches out-of-authority and private-state writes - -### 9. Relationship And Social Perception Updater - -Purpose: update directional relationship stance and perceived overlays over time. - -Current implementation: - -- manual relationship movement in mutation receipts - -Inputs: - -- prior directional relationship stance -- event/appraisal history -- memories -- perceived overlay -- cultural priors -- confidence drivers -- future-contact expectations - -Outputs: - -- relationship stance deltas -- perceived disposition updates -- confidence movement -- stale impression preservation -- social reinforcement notes -- reviewer rationale - -Training architecture: - -- multi-label classifier for movement direction and dimensions -- regression or ordinal classifier for magnitude buckets -- cross-encoder/ranker for candidate deltas -- avoid raw unconstrained numeric generation early - -Training artifacts: - -- relationship update receipts -- perceived-state update receipts -- confidence driver labels -- rejected updates - -Pilot schema shakedown gate: - -- 500 directional relationship updates -- repeated-contact sequences, not only isolated events -- evaluation includes asymmetric relationships and stubborn misreads - -### 10. Branch Compiler - -Purpose: turn reviewed scene intent, branch candidates, consequence packets, and -fold plans into playable Ink plus sidecar receipts. - -Current implementation: - -- coordinator-authored Ink fixtures -- documented branch-and-fold contract -- manual materialization and review - -Inputs: - -- fixture brief and scene spine -- source-grounded lore digest -- current world, scene, resource, relationship, and branch state -- actor-local branch candidates, including speech and non-speech actions -- responder outputs or coordinator-authored placeholder reactions -- reviewed consequence packets -- branch-and-fold plan -- visual continuity requirements -- schema and Ink formatting constraints - -Outputs: - -- readable `.ink` scene content -- Ink variables, choices, knots, gathers, and conditionals -- `.training.json` sidecar tying branches to state basis, action intent, - consequences, callbacks, and review status -- `.visual.json` visual plan tying visual scene ids, image prompts, character - refs, style cues, and branch/state modifiers to Ink anchors -- compiler notes for fold decisions, route-split decisions, and known review - risks - -Training architecture: - -- start as reviewed structured authoring -- generative decoder LLM for fixture drafting once sidecar shape stabilizes -- deterministic validators for Ink syntax, branch ids, sidecar refs, visual - plan refs, and schema shape - -Training artifacts: - -- accepted and rejected compiled fixtures -- Ink/sidecar/visual-plan sets -- compiler notes -- fold and route-split decisions -- state-variable read/write maps -- visual prompt modifier maps -- reviewer findings and repair receipts - -Pilot schema shakedown gate: - -- 25 accepted fixtures across multiple story shapes -- 25 rejected or needs-revision fixtures with labeled compiler failures -- every accepted fixture has an Ink file, sidecar, visual plan, compiler notes, - and review status when illustrated replay is in scope -- every material variable is read later or marked telemetry-only before - acceptance -- branch compiler output is reviewed by the IF artifact reviewer before it - enters the accepted corpus - -### 11. IF Artifact Reviewer - -Purpose: catch false consequence before branch fixtures become training data. - -Current implementation: - -- manual/frontier-model review -- failure taxonomy documented in - `docs/architecture/ink-branching-scenes.md` - -Inputs: - -- Ink file -- `.training.json` sidecar -- `.visual.json` visual plan, when illustrated replay is in scope -- coordinator artifact -- branch compiler notes -- declared variables, resources, risks, relationship bands, and visual - modifiers -- intended branch-and-fold plan -- validation output - -Outputs: - -- `accepted`, `needs_revision`, or `rejected` -- severity-ranked findings -- fake-variable audit -- choice-consequence audit -- fold/callback audit -- state-gated prose audit -- visual-continuity audit -- required fixes - -Training architecture: - -- classifier or cross-encoder for known failure labels -- LLM judge for nuanced IF design failures, with reviewed labels saved -- deterministic support tools for variable set/read maps and branch-id - consistency - -Training artifacts: - -- accepted fixtures -- rejected fixtures -- labeled failures such as `potemkin_state`, `cosmetic_choice`, `fake_fold`, - `missing_state_read`, `state_named_instead_of_checked`, - `visual_callback_missing`, and `ending_ignores_major_state` -- reviewer rationales -- repaired fixture diffs tied to findings - -Pilot schema shakedown gate: - -- 100 reviewed fixtures or fixture fragments -- 100 labeled failures, including at least 25 fake-variable or fake-fold cases -- reviewer catches variables that do not affect affordances, risk, appraisal, - callbacks, visual state, or outcomes -- reviewer catches prose that names alternate branch states instead of checking - variables -- reviewer catches endings that ignore major prior state - -### 12. Output Evaluator And Guardrail Classifiers - -Purpose: reject bad model outputs before they become artifacts or state. - -Current implementation: - -- schema validators -- prompt-leak checks -- body-affordance checks -- object semantics checks - -Inputs: - -- generated output -- source refs -- local context -- schema contract -- failure taxonomy - -Outputs: - -- pass/fail -- failure labels -- severity -- repairability -- reviewer notes - -Training architecture: - -- classifier or cross-encoder -- deterministic regex/schema checks where sufficient -- LLM judge only for nuanced failures, with reviewed labels saved - -Training artifacts: - -- rejected outputs -- accepted outputs -- false positive/false negative review notes -- failure taxonomy examples - -Pilot schema shakedown gate: - -- 300 labeled failures across prompt leakage, omniscience, wrong body, wrong - lore, invalid mutation, schema drift, and flattened character agency - -### 13. Institution, Faction, And Consumer Decision Models - -Purpose: model non-dialogue decisions in economic, factional, institutional, and -open-world contexts. - -Current implementation: - -- not built yet -- preserve hooks in scene data now - -Inputs: - -- actor or institution state -- resources and scarcity -- obligations -- reputation -- faction norms -- expected future contact -- legal authority -- risk and cost models -- local information and misreads -- post-Rupture infrastructure or concept constraints, when applicable -- active technology order, faction attractors, fated events, and quest hooks -- item manifest refs -- faction tech-base refs -- component, assembly, and supply-chain dependencies - -Outputs: - -- decision/action proposal -- perceived cost and benefit -- moral injury or taboo pressure -- resource deltas proposed -- reputation/faction pressure implications -- rationale -- branch-local policy or market assumptions -- constrained-event response: exploit, resist, comply, delay, adapt, sabotage, - or organize around the attractor/rail/injection -- manufacture, buy, salvage, counterfeit, maintain, upgrade, embargo, or - substitute decisions - -Training architecture: - -- generative decoder LLM for complex decisions with rationale -- classifier/ranker for candidate choices -- possible small policy model later inside simulation loops - -Training artifacts: - -- buy/refuse/trade/hoard/comply/defect/conceal/punish/help examples -- accepted and rejected decision rationales -- resource and reputation consequence labels -- constrained-event decision examples for faction founding, technology adoption, - quest hooks, and pressure-born institutions -- item availability and component dependency decisions -- faction access or restriction decisions - -Pilot schema shakedown gate: - -- do not train until scene-local machinery produces reliable decision examples -- collect at least 500 reviewed decision examples across consumer and - institutional contexts -- include future-branch decisions where post-Rupture miracles become markets, - privileges, liabilities, dependencies, or weapons -- include examples where factions or companies emerge from branch pressures, - fated constraints, or quest injections -- include examples where factions differ in starting pre-Elysium tech base, - manufacturing rights, maintenance ability, and supply-chain dependency - -### 14. Technology And Item Manifest Generator - -Purpose: turn worldbuilding exploration into game-usable item, component, -assembly, technology, and supply-chain records. - -Current implementation: - -- not built yet -- architecture plan exists in - `docs/architecture/technology-item-manifest-plan.md` -- concrete target schema exists in Aetheria-Economy as CultCache-backed - `ItemData` technological blueprint classes and linked `ItemInstance` runtime - classes - -Inputs: - -- coordinator plan and glue prose -- branch lineage and prior conditions -- source refs from AetheriaLore -- nebulous named technologies from existing timeline/lore notes -- technology discovery events -- faction or manufacturer state -- item family or gameplay role -- existing item manifests -- pre-Elysium starting tech refs -- post-Rupture concept constraints -- existing Aetheria-Economy item definitions, categories, behavior data, - hardpoint types, and known engine schema gaps - -Outputs: - -- candidate Aetheria-Economy technological blueprint records -- `SimpleCommodityData` candidates for fungible resources and feedstock -- `CompoundCommodityData` candidates for assemblies, subassemblies, - components, processed materials, colony-consumed trade goods, and - manufactured economic units -- `ConsumableItemData` candidates for usable consumables -- `GearData` or other `EquippableItemData` subclass candidates for usable - equipment, ship systems, hulls, cargo structures, docking systems, and weapons -- assembly-tree, recipe, compatibility, and supply-chain metadata attached to - the target blueprint record -- instance-provenance candidates when simulating manufactured artifacts, - including realized quality, supply-chain lineage, manufacturer branding, and - subassembly contributions to performance -- item family and item variant records as manifest metadata -- process, tooling, expertise, and facility records -- compatibility and upgrade-slot rules -- faction/manufacturer access records -- prerequisites and technology order -- supply-chain bottlenecks -- gameplay effects -- economic consequences -- quest hooks -- rejected unsupported item designs -- source-gap records for named tech that lacks actionable blueprint detail -- engine-schema gap records when a useful manifest concept has no CultCache - field yet - -Training architecture: - -- start as reviewed structured authoring -- generative decoder LLM for manifest drafting once schema exists -- classifier/evaluator for unsupported tech, impossible compatibility, bad - source grounding, and overpowered designs -- retrieval model for prerequisite/component dependency lookup later - -Training artifacts: - -- item manifest records -- blueprint records -- component breakdown records -- assembly compatibility records -- faction tech-base records -- technology discovery records -- branch-local innovation records -- economic consequence records -- rejected item designs with failure labels -- nebulous-tech elaboration records with inferred/source/gap fields -- instance-provenance records for manufactured artifacts when a scene or branch - needs realized supply-chain history, not just a blueprint - -Pilot schema shakedown gate: - -- item manifest schema and validator exist -- validator checks target Aetheria-Economy blueprint class, source-backed - fields, inferred fields, metadata-only fields, instance-provenance fields, and - engine-schema gaps -- 100 reviewed item/component/assembly records -- 50 faction tech-base records across pre-Elysium and future branches -- 50 rejected/invalid item examples with clear failure labels -- at least 10 branch-local innovations tied to lineage and prerequisites -- at least 10 existing named technologies elaborated from vague lore into - candidate blueprints with explicit source facts, inferred engineering, and - open gaps - -## Training Order - -Do not train everything at once. That way lies a ceremonial bonfire of GPUs. - -Recommended order: - -1. Keep deterministic validators and artifact schemas ahead of data volume. -2. Build coordinator artifact schema and start saving coordinator receipts. -3. Expand projected local context and character-turn capture receipts. -4. Stabilize branch compiler artifacts for Ink, sidecars, fold notes, and visual - prompt handles. -5. Build IF artifact reviewer labels from existing branching failures. -6. Build broader evaluator labels from responder, projector, lore, and mutation - failures. -7. Fine-tune or LoRA the Aetheria responder first, because strong response data - directly improves visible output and reduces lore handholding. -8. Add future-branch post-Rupture examples before claiming the responder can - handle Elysium-era concepts without heavy prompting. -9. Train projector only if deterministic projection becomes a bottleneck. -10. Train appraiser and relationship updater after enough manual mutation receipts - exist. -11. Train state mutator last among social organs because bad mutation corrupts - the world state. -12. Build item manifest schema before large future-branch exploration produces - technology data. -13. Train institution/faction/consumer models after scene-local decisions provide - enough grounded examples. - -## Minimum Corpus Before First Experimental Fine-Tune - -These are still pilot numbers. Use them for controlled experiments, schema -pressure tests, and early behavior probes. Do not treat them as enough for -robust runtime use. - -A first useful Aetheria responder fine-tune wants: - -- 200 accepted character turns -- 50 non-speech or mixed-action turns -- 50 rejected/negative examples with clear labels -- exact responder-visible input for every turn -- raw responder output separated from reviewed or coordinator-repaired output -- hidden-context refs and leakage audits for every turn -- at least 5 factions or institutional contexts -- at least 3 time periods or historical flashpoints -- at least 50 accepted future-branch post-Rupture turns before using the model - for Elysium-era generation with reduced lore scaffolding -- source refs for every grounded example -- explicit local-context boundary for every turn -- no Elysium branch facts mixed into single-history Sol data or unrelated - sibling branches -- clear labels separating source-backed Elysium concepts from generated future - branch facts -- branch lineage for every future-branch example - -A first coordinator fine-tune wants: - -- 50 accepted coordinator turns -- 25 rejected coordinator turns -- at least 5 complete scene transitions -- world-state refs in every example -- glue prose paired with structured state deltas or explicit no-delta notes - -A first branch compiler model wants: - -- 25 accepted Ink fixtures with sidecars and compiler notes -- 25 rejected or needs-revision fixtures with specific compiler failure labels -- variable set/read maps for every fixture -- branch-and-fold decisions marked as fold, conditional variant, or route split -- visual prompt handles tied to actual state variables -- IF artifact reviewer decisions for every accepted example - -A first IF artifact reviewer wants: - -- 100 reviewed fixtures or fixture fragments -- 100 labeled failures -- examples where the human review found fake state or fake folds before repair -- repaired versions paired with the original finding -- held-out fixtures with intentionally subtle cosmetic-choice and callback gaps - -A first appraiser/classifier training run wants: - -- 300 participant appraisals -- balanced misread/correct/ambiguous/bias examples -- at least 50 VoidBot-facing human interaction appraisals with opinion-update - labels and uncertainty notes -- labeled confidence drivers -- reviewer rationale - -A first item-manifest model wants: - -- 100 reviewed item/component/assembly records -- 50 faction tech-base records -- 50 rejected item designs or compatibility failures -- source refs or branch lineage for every record -- explicit component, assembly, prerequisite, bottleneck, and gameplay-effect - fields -- named-tech elaborations that separate source facts from inferred engineering - and open lore gaps - -## Artifact Shape Rule - -Every training artifact should answer: - -- What did the model or human see? -- What was hidden from them? -- What did they produce? -- What was accepted? -- What was rejected? -- Why? -- Which source or state refs justify the decision? -- Which future model family is this example for? - -If an artifact cannot answer those questions, it is probably a transcript, not a -training example. Transcripts are nice. Training examples are how the beast gets -less stupid. diff --git a/docs/architecture/voidbot-routine-adoption-plan.md b/docs/architecture/voidbot-routine-adoption-plan.md deleted file mode 100644 index 472a211..0000000 --- a/docs/architecture/voidbot-routine-adoption-plan.md +++ /dev/null @@ -1,151 +0,0 @@ -# VoidBot Routine Adoption Plan - -VoidBot now has the best live reference for the agent routine Ghostlight needs: -work or rumination on heartbeat, periodic sleep for consolidation, typed -MessagePack persistence through a CultCache-style contract, and vector-backed -memory resonance. Ghostlight should adopt the routine without inheriting -VoidBot's moderation job. - -## Imported Organs - -- **Heartbeat scheduler:** chooses work, rumination, or sleep/consolidation from - readiness, load, status, reaction windows, and pending turns. -- **Completion-gated cooldown:** a participant cannot act again until its - previous heartbeat turn finishes; recovery starts at completion. -- **Sleep cycle:** scheduled naps are not absence. They compress memory, - strengthen useful associations, cool saturated themes, refresh dreams, and - keep direct speech rare. -- **CultCache persistence:** canonical state is MessagePack, routed by typed - document definitions, with JSON working projections for inspection/review. -- **Vector memory:** memories carry semantic vector metadata and Qdrant points - so recall, resonance, incubation, and dreams are grounded in retrievable - structure. -- **Thought organs:** analytic lane, associative lane, bridge, memory resonance, - incubation, and candidate intervention/dream queues. - -## Ghostlight Translation - -Ghostlight's swarm is the cast. The heartbeat initiative system therefore -applies directly to characters taking turns within a scene, not merely to -background maintenance workers. - -There are two scopes using the same timing law: - -- **scene heartbeat:** selects which in-scene character acts, reacts, waits, - hesitates, refuses, speaks, withholds, moves, or uses an object. -- **maintenance heartbeat:** wakes offstage agents, cast records, coordinator - organs, appraisers, mutators, and fixture builders for rumination, sleep - consolidation, or reviewed maintenance. - -The point is one initiative physiology with different arenas, not two unrelated -schedulers wearing each other's hat. - -```text -heartbeat initiative - -> choose scene participant or maintenance organ - -> scene turn | reaction | wait | rumination | sleep - -> read typed state from CultCache-compatible store - -> optional Qdrant recall / memory resonance - -> produce visible action, event, appraisal, mutation, dream, or maintenance receipt - -> completion starts cooldown - -> write canonical MessagePack + JSON working projection -``` - -## Persistence Shape - -Ghostlight can start with the CultCacheTS contract directly for Node-side tools, -but the Python-heavy validator/tooling surface needs a compatible file contract: - -- canonical store: single-file MessagePack envelope array -- envelope: `key`, `type`, `payload`, `storedAt` -- schema owner: code definitions, not hand-edited loose JSON -- working projection: JSON, human-readable, safe for review, optionally stripped - of bulky vector values -- write discipline: use an external lock or one coordinator writer; the - single-file store is not a database wearing a fake mustache - -Initial document types: - -- `ghostlight.agent_state` -- `ghostlight.scene_state` -- `ghostlight.initiative_schedule` -- `ghostlight.scene_heartbeat_state` -- `ghostlight.training_loop_bundle` -- `ghostlight.runtime_heartbeat_state` -- `ghostlight.memory_resonance` -- `ghostlight.sleep_cycle` - -## Memory Vector Shape - -Qdrant becomes the retrieval layer for agent memory, not canonical social truth. - -Each memory-like record should keep: - -- stable memory id -- kind: episodic, semantic, relationship, goal, value, musing, dream, - scene-memory, appraisal, mutation, or lore-grounding -- summary text used for embedding -- source hash -- embedding backend/model/dimensions -- Qdrant point id and collection -- salience/confidence/update time -- source refs into fixtures, lore, or reviewed artifacts - -Ghostlight's existing training docs already point toward retrieval-backed memory. -This plan makes it operational instead of aspirational, the traditional route -by which a research note stops being furniture. - -## Sleep Behavior - -During sleep turns: - -- do not generate ordinary scene turns unless the character is actually in the - scene and selected by the scene heartbeat -- inspect memory resonance clusters and incubation entries -- merge duplicate memories -- prune stale or low-confidence residue -- create or refresh at least one dream only when it compresses a useful seam -- update `sleep_cycle.activeDreamThemes`, `lastDreamAt`, and - `lastDistillationSummary` -- write a maintenance receipt for review - -Dreams are compressed operational memory, not glitter. If a dream survives, the -next waking turn should be more coherent because of it. - -## Migration Slices - -1. **Contract fixture** - - Add a small CultCache-compatible MessagePack fixture and validator. - - Prove Python can read/write the envelope without losing schema shape. - -2. **Runtime heartbeat schema** - - Add `schemas/runtime-heartbeat-state.schema.json`. - - Include pending turn, sleep cycle, rumination, and completion receipts. - -3. **Agent state migration** - - Keep current JSON examples as projections. - - Add canonical MessagePack test store for one small agent-state fixture. - -4. **Memory resonance** - - Add a local memory-organ script that embeds memory summaries, writes Qdrant - points, builds resonance edges/clusters, and writes incubation state. - -5. **Sleep receipt** - - Add a sleep/consolidation artifact schema and validator. - - Require sleep receipts to name pruned/merged/strengthened memories. - -6. **Training-loop integration** - - Promote scene initiative schedules into the same heartbeat contract used - by the swarm. - - Let characters take scene turns through heartbeat initiative, then route - appraisal/mutation/coordinator maintenance through the same completion and - cooldown law. - -## Boundaries - -- Do not make Qdrant canonical truth. -- Do not store raw vector blobs in every human working projection. -- Do not let sleep turns mutate accepted training fixtures without reviewed - maintenance receipts. -- Do not make every Ghostlight character into a background daemon before the - runtime heartbeat store can prove who is awake, asleep, pending, or complete.