diff --git a/docs/architecture/prompt-projection-contract.md b/docs/architecture/prompt-projection-contract.md index 76950ad..ad83e0e 100644 --- a/docs/architecture/prompt-projection-contract.md +++ b/docs/architecture/prompt-projection-contract.md @@ -3,12 +3,20 @@ 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 diff --git a/docs/architecture/sequential-agent-runtime.md b/docs/architecture/sequential-agent-runtime.md new file mode 100644 index 0000000..f85dd32 --- /dev/null +++ b/docs/architecture/sequential-agent-runtime.md @@ -0,0 +1,176 @@ +# Sequential Agent Runtime + +Ghostlight's target is not a fancy dialogue prompt machine. + +The target is a sequential social-agent runtime: set the stage, choose which +character is acting, give that character local awareness, let them act, apply +consequences, mutate state, and continue. The author should not need to control +every beat. The useful machine is the one that makes characters push the story +sideways for reasons their state can explain. + +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. +2. Build that agent's local awareness. +3. Derive available actions and constraints. +4. Let the agent choose a response. +5. Resolve the response against the scene. +6. Mutate world, relationship, memory, belief, and activation state. +7. Append an event record with participant-local interpretations. +8. Choose the next acting agent or end the scene. + +The author sets the initial scene and may steer with high-level constraints. +The author should not need to decide every line, interruption, withdrawal, +betrayal, repair attempt, confession, or slap. That is the point of the machine. + +## 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. This is operational state. If the scene itself is +abstract and byzantine, the agent may still behave correctly inside that mess. +The story may be hard to read for separate authoring reasons. Do not shove that +problem into projection. + +## Action Selection + +The action model must allow more than speech. + +Actions can include: + +- speak +- stay silent +- ask a question +- refuse +- leave +- follow +- touch or block a control surface +- comfort +- threaten +- attack +- conceal evidence +- reveal evidence +- spend a resource +- call for help +- change topic +- make a promise +- break a promise +- update a public record +- create a private obligation + +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. + +## 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 + +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. + +## 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 + -> state mutation + -> next agent +``` + +## First Prototype + +The next implementation should not try to simulate a city. Calm down, wizard. + +Prototype one tiny loop: + +1. Load `examples/agent-state.cold-wake-story-lab.json`. +2. Select one scene and one acting agent. +3. Build a local awareness packet from existing state. +4. Compile projection controls. +5. Render a prompt that asks for an action, not just dialogue. +6. Send it to Qwen. +7. Save the response as an event proposal. +8. Apply a small deterministic mutation: + - append event + - add one memory or belief update + - adjust one or two `current_activation` values + - update one relationship stance if justified +9. Validate the resulting fixture. + +The goal is not literary quality. The goal is to prove that a character can act +from local state and leave the world slightly different behind them. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index d7dc1b0..1aebb49 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -38,6 +38,7 @@ Ghostlight now has the persistence spine plus the first architecture payload: - prompt projection and distillation docs: - `docs/architecture/prompt-projection-contract.md` - `docs/architecture/projection-distillation-plan.md` + - `docs/architecture/sequential-agent-runtime.md` - evaluation follow-up docs: - `docs/architecture/schema-future-mechanisms.md` - Aetheria lore grounding docs: @@ -90,10 +91,9 @@ training feedstock for projection and dialogue scaffolding. ## Current Next Action -Build the deterministic projection input slicer/renderer prototype that emits -`projection_controls` and `prompt_text` from agent state, then rerun a -story-lab beat through it instead of hand-authoring the full projection -artifact. +Build the first deterministic sequential-agent prototype: local awareness, +projection controls, action prompt, Qwen event proposal, conservative state +mutation, and validation on one Cold Wake story-lab beat. Cat/Oz remains useful as an Elysium procedural mechanics fixture, but grounded training data should start from authored historical lore rather than gameplay @@ -137,6 +137,8 @@ Remaining projection path: - build a deterministic speaker-local input slicer - build a renderer that emits projection controls before prompt prose +- build the first sequential runtime tick so an agent can act from local + awareness and mutate only the state it has authority to affect - use a frontier teacher model to generate/audit projection artifacts - train a smaller student projector only after the artifact schema, input slicer, and evaluator stabilize diff --git a/notes/ghostlight-current-system-map.md b/notes/ghostlight-current-system-map.md index 4da87ae..dd10364 100644 --- a/notes/ghostlight-current-system-map.md +++ b/notes/ghostlight-current-system-map.md @@ -45,6 +45,9 @@ state and re-entry discipline. - `docs/architecture/projection-distillation-plan.md` - plan for using a frontier teacher model to generate reviewed projection artifacts before training a smaller student projector +- `docs/architecture/sequential-agent-runtime.md` + - target runtime loop where agents act from local awareness, generated actions + become event proposals, and bounded state mutation drives the next turn - `docs/experiments/cold-wake-story-lab.md` - four-scene Cold Wake writing experiment using Ghostlight projection as a story-generation crutch and training-data source @@ -119,7 +122,7 @@ state and re-entry discipline. - a full projection training corpus - a deterministic projection input slicer - a student projection model -- a simulation/event loop +- a simulation/event loop implementation - a relationship engine - a culture prior engine @@ -128,5 +131,5 @@ digest schema, first draft Cold Wake grounding digest, and first Cold Wake story-lab Qwen captures now exist as v0 seams. The first complete Cold Wake story pass exists with receipts, and projection controls have been promoted as the architectural answer to repeated prompt leaks. The next implementation -target is building a deterministic input slicer/renderer prototype that emits -projection controls and prompt text from agent state. +target is the first deterministic sequential-agent tick: local awareness, +action prompt, event proposal, conservative state mutation, and validation. diff --git a/notes/ghostlight-implementation-plan.md b/notes/ghostlight-implementation-plan.md index 28ecb36..0c21753 100644 --- a/notes/ghostlight-implementation-plan.md +++ b/notes/ghostlight-implementation-plan.md @@ -32,8 +32,28 @@ - Keep the prompt renderer a projection surface instead of a second brain. - Make generated moves inspectable: why this character deflects, confesses, threatens, softens, bargains, or lies. + - Treat this as a debug/training seam for the larger sequential runtime, not + as the final product shape. -4. Build the projection distillation loop. Started. +4. Build the sequential agent loop. New target. + - Use `docs/architecture/sequential-agent-runtime.md` as the first runtime + contract. + - Build local awareness from scene state, agent state, relationships, + memories, resources, affordances, and known constraints. + - Let the acting agent choose speech, silence, movement, resource use, + concealment, revelation, violence, refusal, or other available action. + - Treat generated action as an event proposal, not direct truth mutation. + - Resolve the event against world state and mutation authority. + - Apply bounded state changes: event append, memory/belief updates, + relationship movement, current activation deltas, resource/object changes, + and opened or closed options. + - Keep author control at stage-setting and high-level constraints; do not + require the author to script every beat. + - First prototype: rerun one Cold Wake story-lab beat through a deterministic + local-awareness/projection-control renderer, then apply one conservative + state mutation and validate the resulting fixture. + +5. Build the projection distillation loop. Started. - Use `docs/architecture/projection-distillation-plan.md` as the teacher to student roadmap. - Use `docs/architecture/aetheria-lore-grounding-architecture.md` to keep @@ -77,7 +97,7 @@ - Train or adapt a smaller student projector only after the artifact schema, input slicer, and evaluator are stable. -5. Build the first drama-scaffolding loop. +6. Build the first drama-scaffolding loop. - memory updates - relationship updates - goal pressure @@ -85,7 +105,7 @@ - cultural and institutional pressure - conflict beats derived from incompatible goals and values -6. Build the first Aetheria authoring consumer. +7. Build the first Aetheria authoring consumer. - use the Call of the Void slice described in `AetheriaLore` as the first concrete content-generation context - treat Call of the Void and other Elysium gameplay-era fixtures as diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 7f649a9..6c5ba6a 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -28,3 +28,4 @@ {"ts": "2026-05-01T21:16:24+00:00", "type": "experiment", "status": "mixed", "note": "Cold Wake story-lab first Qwen response confirmed response_turn/action affordances are useful: qwen3.5:9b produced a mixed terminal-blocking plus dialogue beat for Maer. Failure lesson: personhood-pressure wording was too strong and let the model imply the artifact was a person instead of preserving unresolved suspicion."} {"ts": "2026-05-01T21:22:33+00:00", "type": "experiment", "status": "accepted", "note": "Cold Wake Maer/Veyr projection now has useful rejected v1/v2 captures and accepted v3 Qwen output. Lesson: unresolved personhood pressure needs explicit noun fencing; claimant-status, provenance, and chain-of-custody language preserved ambiguity while still allowing controlled terminal-blocking action."} {"ts": "2026-05-01T21:32:34+00:00", "type": "experiment", "status": "accepted", "note": "Completed first Cold Wake short story from Ghostlight projection receipts. Architectural lesson: repeated Qwen failures were not just prompt wording issues; projection needs first-class controls for frame ownership, authority boundaries, object custody, required semantics, and forbidden resolutions. Added capture validation so accepted/rejected outputs remain accountable training data."} +{"ts": "2026-05-01T21:59:49+00:00", "type": "design", "status": "accepted", "note": "Reframed Ghostlight target from specific dialogue projection toward sequential character agents: each acting agent gets local awareness, options, objectives, and mutation authority; generated action becomes an event proposal resolved into bounded state changes. Single-turn projection remains a debug/training seam, not the procedural-generation endpoint."} diff --git a/state/map.yaml b/state/map.yaml index ad2d9b4..e0bbf50 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -14,9 +14,9 @@ objective: procedural drama, and eventual live-world simulation without collapsing into prompt soup. current: > - Freeze the first canonical agent-state schema and validation seam, then use - it as the contract for perceived-state overlays, classifier/event records, - prompt projection, and authoring-oriented drama generation. + Move from hand-authored single-turn projection artifacts toward the first + sequential agent runtime tick: local awareness, action choice, event + proposal, conservative state mutation, and validation. constraints: - Prefer explicit latent state over persona theater. @@ -37,7 +37,7 @@ invariants: - Listener misread is part of the model, not an error to flatten away. - Personality must be modeled as layered organization, presentation, and situational activation, not just one bag of labels. - Authoring outputs must remain explainable in terms of state, relationship, pressure, memory, and goals. - - Dialogue generation should be character-local: each prompt should restrict context to what the speaking character knows, feels, wants, remembers, hides, and perceives. + - Character generation should be agent-local: each acting turn should restrict context to what the character knows, feels, wants, remembers, hides, perceives, can attempt, and has authority to affect. - Aetheria grounded training data should come from authored historical lore; procedural Elysium scenes are branch material until reviewed or promoted. data_flow: @@ -85,8 +85,8 @@ accepted_design: - Sarcastic deflection, sincerity evasion, emotional evasion, banter-as-boundary, and verbal aggression are target emergent behaviors for projection tests. - Dialogue context packs are positive-context payloads; unknown or author-only material is omitted rather than listed as forbidden context, while known secrets are handled through goals, memories, beliefs, and presentation constraints. - Relationship stance is directional; reciprocal agent pairs need separate edges because trust, fear, obligation, dependence, and betrayal expectations are not symmetric by default. - - Prompt projection should compile state into speaker-local pressure prose through input selection, active-pressure scoring, tension detection, response affordance derivation, compact prompt rendering, and post-generation evaluation. - - Projection must allow characters to act, not only speak; response turns can be dialogue, action, silence, withdrawal, violence, or mixed beats when state and scene pressure justify them. + - Prompt projection should compile state into actor-local awareness and pressure prose through input selection, active-pressure scoring, tension detection, response affordance derivation, projection controls, compact prompt rendering, and post-generation evaluation. + - Projection must allow characters to act, not only speak; response turns can be dialogue, action, silence, withdrawal, violence, resource use, concealment, revelation, or mixed beats when state and scene pressure justify them. - Projection distillation is the long-term optimization path: a frontier teacher model generates reviewed projection artifacts, and a smaller student projector is trained only after the artifact schema, deterministic input slicer, and evaluator are stable. - Behavioral warmth and verbal warmth are separate axes: `interpersonal_warmth` describes social care or welcome, while `verbal_warmth` describes soft or reassuring language surface. - Events can carry lightweight observed exchange, private interpretation, and event-effect scaffolding so prompt projection can reason from appraisal and consequence without pretending the v0 schema is already a full transition engine. @@ -99,7 +99,9 @@ accepted_design: - Projection controls are now first-class in projection examples: frame_controls, authority_boundaries, object_custody, required_semantics, and forbidden_resolutions capture failure lessons before prompt prose is rendered. - Qwen response captures are validated training receipts, not loose logs; accepted, rejected, and useful-needs-revision outputs should keep review status, response kind, strengths, failures, and pipeline lessons. - The first complete Cold Wake short story, The Narrowest Possible Margin, is assembled from Ghostlight projection receipts plus in-session connective narration. + - Single-turn projection is a debug and training seam, not the final procedural-generation shape; the target runtime is sequential agents acting from local awareness, producing event proposals, and mutating bounded state. + - Generated action should become an event proposal resolved by mutation authority, not direct unrestricted edits to world or other-agent private state. current_status: summary: Ghostlight now has the Epiphany-style persistence spine, the first architecture payload, the v0 canonical agent-state schema seam, prompt projection docs, immediate schema fixes from evaluation, first reviewed Cat/Oz projection examples, a revised Aetheria lore-grounding architecture, a lore grounding digest schema, the first draft Cold Wake historical grounding digest, a Cold Wake story-lab fixture, projection controls, validated Qwen capture receipts, and a complete Cold Wake short story assembled from accepted projection outputs. - next_action: Build the deterministic projection input slicer/renderer prototype that emits projection_controls and prompt_text from agent state, then rerun a story-lab beat through it instead of hand-authoring the full projection artifact. + next_action: Build the first deterministic sequential-agent prototype: local awareness, projection controls, action prompt, Qwen event proposal, conservative state mutation, and validation on one Cold Wake story-lab beat.