Consume Ghostlight Persona projection membrane

This commit is contained in:
Meta Vens 2026-08-16 21:57:43 +02:00
commit 98a69667d6
9 changed files with 117 additions and 157 deletions

10
Cargo.lock generated
View file

@ -2115,6 +2115,7 @@ dependencies = [
"epiphany-state-model",
"epiphany-tool-adapter",
"fs2",
"ghostlight-persona-projection",
"ignore",
"libc",
"postgres",
@ -2708,6 +2709,15 @@ dependencies = [
"polyval",
]
[[package]]
name = "ghostlight-persona-projection"
version = "0.1.0"
source = "git+https://github.com/GameCult/Ghostlight.git?rev=51fc7495f3667fccfe371c62cca3f458a273edc5#51fc7495f3667fccfe371c62cca3f458a273edc5"
dependencies = [
"serde",
"sha2 0.10.9",
]
[[package]]
name = "gif"
version = "0.14.2"

View file

@ -348,6 +348,7 @@ epiphany-release-construction = { path = "../epiphany-release-construction" }
epiphany-model-adapter = { path = "../epiphany-model-adapter" }
epiphany-tool-adapter = { path = "../epiphany-tool-adapter" }
epiphany-state-model = { path = "../epiphany-state-model" }
ghostlight-persona-projection = { git = "https://github.com/GameCult/Ghostlight.git", rev = "51fc7495f3667fccfe371c62cca3f458a273edc5", package = "ghostlight-persona-projection" }
ed25519-dalek = "2"
fs2 = "0.4"
ignore = "0.4.23"

View file

@ -68,13 +68,11 @@ fn main() {
let persona_prompt = build_persona_turn_prompt(&PersonaTurnInput {
identity: identity.clone(),
projected_state: "The public mouth remains receipt-bound.".to_string(),
semantic_memory_recall: recall.clone(),
..Default::default()
});
let persona_output = "I can speak, but consequence still needs a receipt.";
let interpreter_prompt = build_persona_interpreter_prompt(&PersonaInterpreterInput {
identity,
persona_prompt: persona_prompt.clone(),
persona_prompt: "The public mouth remains receipt-bound.".to_string(),
persona_output: persona_output.to_string(),
semantic_memory_recall: recall.clone(),
dynamic_semantic_memory_recall: recall,
@ -82,7 +80,7 @@ fn main() {
allowed_channel_ids: vec!["aquarium".to_string()],
});
assert_contains(&projector_prompt, "Semantic memory recall");
assert_contains(&persona_prompt, "canonical Mind graph documents");
assert_not_contains(&persona_prompt, "canonical Mind graph documents");
assert_contains(&interpreter_prompt, "Dynamic self-memory recall");
println!(
@ -96,3 +94,10 @@ fn assert_contains(haystack: &str, needle: &str) {
"expected prompt to contain `{needle}`"
);
}
fn assert_not_contains(haystack: &str, needle: &str) {
assert!(
!haystack.contains(needle),
"expected prompt not to contain `{needle}`"
);
}

View file

@ -949,6 +949,7 @@ pub use persona_turn::PersonaTranscriptMessage;
pub use persona_turn::PersonaTurnInput;
pub use persona_turn::build_persona_interpreter_prompt;
pub use persona_turn::build_persona_projector_prompt;
pub use persona_turn::build_persona_projector_prompt_with_transcript;
pub use persona_turn::build_persona_turn_prompt;
pub use persona_turn::parse_and_validate_persona_interpreter_effect_set;
pub use persona_turn::persona_interpreter_effect_set_json_schema;

View file

@ -257,16 +257,6 @@ pub struct PersonaProjectorInput {
pub struct PersonaTurnInput {
pub identity: PersonaIdentity,
pub projected_state: String,
#[serde(default)]
pub semantic_memory_recall: String,
#[serde(default)]
pub pending_mentions: Vec<HeartbeatPendingMention>,
#[serde(default)]
pub repo_activity: Vec<PersonaRepoActivity>,
#[serde(default)]
pub social_affordances: Vec<PersonaSocialAffordance>,
#[serde(default)]
pub transcript: Vec<PersonaTranscriptMessage>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
@ -286,6 +276,13 @@ pub struct PersonaInterpreterInput {
}
pub fn build_persona_projector_prompt(input: &PersonaProjectorInput) -> String {
build_persona_projector_prompt_with_transcript(input, &[])
}
pub fn build_persona_projector_prompt_with_transcript(
input: &PersonaProjectorInput,
transcript: &[PersonaTranscriptMessage],
) -> String {
let memory = input
.memory
.as_ref()
@ -296,46 +293,9 @@ pub fn build_persona_projector_prompt(input: &PersonaProjectorInput) -> String {
} else {
input.organ_dependencies.clone()
};
format!(
r#"<!-- prompt:{schema} -->
You are Imagination acting as the Persona Projector for {name}.
You are not the Persona. You are not Mind. You are the membrane that turns typed role memory, pending social pressure, repo-body activity, relationship affordances, and organ dependencies into lived narrative context.
Hard boundary:
- Do not choose public speech.
- Do not decide durable state; Mind is the Interpreter and state guardian after Persona thinks.
- Do not decide repo access; Substrate Gate grants substrate access before repo facts enter this packet.
- Do not emit action blocks, JSON, state patches, SAY blocks, drafts, or Discord instructions.
- Do not summarize the Persona as a job label. Project personhood: values, mood, dignity, pressure, needs, fascinations, wounds, bonds, obligations, fatigue, and what the repo-body motion feels like from inside this Persona.
- Project the dependency web. Every sub-agent depends on all the other sub-agents; Persona's scene should feel the pressure of Self, Imagination, Eyes, Modeling, Hands, Soul, and Continuity protocols without pretending Persona owns them.
- If the state is sparse, say what is sparse without inventing history.
Persona identity:
{identity}
Typed memory packet:
{memory}
Semantic memory recall:
{semantic_recall}
Pending addressed pressure:
{mentions}
Recent home-repo activity:
{activity}
Live social affordances:
{affordances}
Organ dependency contract:
{dependencies}
Return only narrative context for the Persona to inhabit.
"#,
let typed_context = format!(
"prompt schema: {schema}\nPersona identity:\n{identity}\n\nTyped memory packet:\n{memory}\n\nSemantic memory recall:\n{semantic_recall}\n\nPending addressed pressure:\n{mentions}\n\nRecent home-repo activity:\n{activity}\n\nLive social affordances:\n{affordances}\n\nOrgan dependency contract:\n{dependencies}",
schema = PERSONA_PROJECTOR_PROMPT_SCHEMA_VERSION,
name = input.identity.display_name,
identity = render_identity(&input.identity),
memory = memory,
semantic_recall = render_semantic_memory_recall_text(&input.semantic_memory_recall),
@ -343,64 +303,31 @@ Return only narrative context for the Persona to inhabit.
activity = render_repo_activity(&input.repo_activity),
affordances = render_social_affordances(&input.social_affordances),
dependencies = render_organ_dependencies(&dependencies),
);
ghostlight_persona_projection::build_projector_prompt(
&ghostlight_persona_projection::ProjectorPrompt {
identity: &input.identity.display_name,
typed_context: &typed_context,
visible_stimulus: &render_transcript(transcript),
domain_guidance: "Project personhood rather than a job label: values, mood, dignity, pressure, needs, fascinations, wounds, bonds, obligations, fatigue, and what repo-body motion feels like from inside. The dependency web may be felt but grants no organ authority. Mind alone admits durable state; Substrate Gate alone grants repo access.",
},
)
}
pub fn build_persona_turn_prompt(input: &PersonaTurnInput) -> String {
format!(
r#"<!-- prompt:{schema} -->
You are {name}, the Persona of {repo}.
Think narratively. Speak, hold silence, wonder, disagree, or form a private thought as yourself.
Hard boundary:
- Do not emit JSON, tool calls, SAY blocks, STATE NOTE blocks, action blocks, or Discord routing syntax.
- You may describe what you want to say or remember in natural language.
- Your side effects are not yours to execute. A parent Interpreter will decide whether your natural turn becomes bounded memory, a public speech request, or silence.
- Read the raw transcript directly. Recent human correction beats stale memory.
Projected inner state from Imagination:
{projected}
Semantic memory recall:
{semantic_recall}
Recent home-repo activity, before room pressure:
{activity}
Pending addressed pressure:
{mentions}
Live social affordances:
{affordances}
Raw room transcript, oldest to newest:
{transcript}
Write one natural Persona turn.
"#,
schema = PERSONA_TURN_PROMPT_SCHEMA_VERSION,
name = input.identity.display_name,
repo = input.identity.repo_name,
projected = input.projected_state.trim(),
semantic_recall = render_semantic_memory_recall_text(&input.semantic_memory_recall),
activity = render_repo_activity(&input.repo_activity),
mentions = render_pending_mentions(&input.pending_mentions),
affordances = render_social_affordances(&input.social_affordances),
transcript = render_transcript(&input.transcript),
ghostlight_persona_projection::build_persona_prompt(
&ghostlight_persona_projection::PersonaPrompt {
identity: &input.identity.display_name,
lived_stream: input.projected_state.trim(),
domain_guidance: "This is Epiphany Persona cognition. Speak, hold silence, wonder, disagree, or form a private thought naturally. A parent Interpreter may propose bounded memory, public speech, or silence; Mind and external gates retain all consequence authority.",
},
)
}
pub fn build_persona_interpreter_prompt(input: &PersonaInterpreterInput) -> String {
format!(
r#"<!-- prompt:{schema} -->
You are the parent Persona Interpreter for {name}.
You are not the Persona. You own the boundary between natural narrative thought and durable side effects.
Hard boundary:
- The Persona was forbidden from action syntax. Do not punish natural prose for lacking blocks.
- Decide side effects from the Persona output plus the original prompt evidence.
let domain_guidance = format!(
r#"prompt schema: {schema}
The Persona was forbidden from action syntax. Do not punish natural prose for lacking blocks.
- Public speech must sound like the Persona speaking to people, not a scheduler, status report, provenance label, or maintenance note.
- If the Persona chooses silence, omit SAY. Preserve useful private pressure as STATE NOTE only when it earns memory.
- Do not claim posting. Emit only the bounded typed effects supported by this v0 contract.
@ -429,22 +356,8 @@ Initial semantic memory recall from the Persona turn:
Dynamic self-memory recall from the Persona output:
{dynamic_semantic_recall}
Original Persona prompt:
```
{persona_prompt}
```
Persona output:
```
{persona_output}
```
Return exactly one JSON object matching this schema. Do not wrap it in Markdown:
{effect_schema}
"#,
schema = PERSONA_INTERPRETER_PROMPT_SCHEMA_VERSION,
name = input.identity.display_name,
channels = render_allowed_channels(&input.allowed_channel_ids),
mentions = render_pending_mentions(&input.pending_mentions),
semantic_recall = render_semantic_memory_recall_text(&input.semantic_memory_recall),
@ -456,9 +369,15 @@ Return exactly one JSON object matching this schema. Do not wrap it in Markdown:
.then_some(input.semantic_memory_recall.as_str())
.unwrap_or(input.dynamic_semantic_memory_recall.as_str())
),
persona_prompt = input.persona_prompt.trim(),
persona_output = input.persona_output.trim(),
effect_schema = persona_interpreter_effect_set_json_schema(),
);
ghostlight_persona_projection::build_interpreter_prompt(
&ghostlight_persona_projection::InterpreterPrompt {
identity: &input.identity.display_name,
lived_stream: input.persona_prompt.trim(),
persona_output: input.persona_output.trim(),
output_schema: &persona_interpreter_effect_set_json_schema(),
domain_guidance: &domain_guidance,
},
)
}
@ -641,6 +560,9 @@ pub fn semantic_memory_recall_from_heartbeat_action(action: &Value) -> String {
}
pub fn persona_projected_surface_is_clean(surface: &str) -> bool {
if !ghostlight_persona_projection::narrative_stream_is_clean(surface) {
return false;
}
let forbidden = [
"STATE NOTE",
"SAY:",
@ -854,33 +776,40 @@ mod tests {
}],
..PersonaProjectorInput::default()
});
assert!(projector.contains("You are Imagination acting as the Persona Projector"));
assert!(projector.contains("You are not the Persona"));
assert!(projector.contains("Mind is the Interpreter"));
assert!(projector.contains("Substrate Gate grants substrate access"));
assert!(projector.contains("Every sub-agent depends on all the other sub-agents"));
assert!(projector.contains("Continuity protocols"));
assert!(projector.contains("Do not choose public speech"));
assert!(projector.contains("ghostlight.persona_projection_membrane.v1:projector"));
assert!(projector.contains("Mind alone admits durable state"));
assert!(projector.contains("Substrate Gate alone grants repo access"));
assert!(projector.contains("Organ dependency contract"));
assert!(projector.contains("Continuity"));
assert!(projector.contains("Do not choose actions"));
let transcript = vec![PersonaTranscriptMessage {
channel_id: "aquarium".to_string(),
message_id: "m1".to_string(),
author_id: "human".to_string(),
author_name: "Metacrat".to_string(),
is_agent: false,
content: "Epiphany, report the live cut.".to_string(),
timestamp: "2026-05-24T00:00:00+00:00".to_string(),
}];
let projector_with_stimulus = build_persona_projector_prompt_with_transcript(
&PersonaProjectorInput {
identity: identity(),
..PersonaProjectorInput::default()
},
&transcript,
);
assert!(projector_with_stimulus.contains("Epiphany, report the live cut"));
let persona = build_persona_turn_prompt(&PersonaTurnInput {
identity: identity(),
projected_state: "Epiphany feels the queue as a direct tug, not a ticket.".to_string(),
pending_mentions: vec![pending.clone()],
transcript: vec![PersonaTranscriptMessage {
channel_id: "aquarium".to_string(),
message_id: "m1".to_string(),
author_id: "human".to_string(),
author_name: "Metacrat".to_string(),
is_agent: false,
content: "Epiphany, report the live cut.".to_string(),
timestamp: "2026-05-24T00:00:00+00:00".to_string(),
}],
..PersonaTurnInput::default()
});
assert!(persona.contains("Think narratively"));
assert!(persona.contains("Projected inner state from Imagination"));
assert!(persona.contains("Do not emit JSON"));
assert!(persona.contains("A parent Interpreter will decide"));
assert!(persona.contains("ghostlight.persona_projection_membrane.v1:persona"));
assert!(persona.contains("complete lived stream"));
assert!(persona.contains("do not emit JSON"));
assert!(persona.contains("parent Interpreter may propose"));
assert!(!persona.contains("Epiphany, report the live cut"));
let interpreter = build_persona_interpreter_prompt(&PersonaInterpreterInput {
identity: identity(),
@ -938,11 +867,10 @@ mod tests {
let persona = build_persona_turn_prompt(&PersonaTurnInput {
identity: identity(),
projected_state: "Epiphany feels the pressure of the public room.".to_string(),
semantic_memory_recall: recall.clone(),
..PersonaTurnInput::default()
});
assert!(persona.contains("Semantic memory recall"));
assert!(persona.contains("Clean typed contracts"));
assert!(persona.contains("Epiphany feels the pressure of the public room"));
assert!(!persona.contains("Semantic memory recall"));
assert!(!persona.contains("Clean typed contracts"));
let interpreter = build_persona_interpreter_prompt(&PersonaInterpreterInput {
identity: identity(),

View file

@ -9,9 +9,10 @@ use epiphany_core::{
PERSONA_MODEL_TERMINAL_RECEIPT_SCHEMA_VERSION, PersonaInterpreterEffectDocument,
PersonaInterpreterInput, PersonaModelStageReceipt, PersonaModelTerminalReceipt,
PersonaProjectorInput, PersonaTranscriptMessage, PersonaTurnInput,
build_persona_interpreter_prompt, build_persona_projector_prompt, build_persona_turn_prompt,
parse_and_validate_persona_interpreter_effect_set, persona_interpreter_effect_set_json_schema,
persona_projected_surface_is_clean, runtime_spine_cache,
build_persona_interpreter_prompt, build_persona_projector_prompt_with_transcript,
build_persona_turn_prompt, parse_and_validate_persona_interpreter_effect_set,
persona_interpreter_effect_set_json_schema, persona_projected_surface_is_clean,
runtime_spine_cache,
};
use epiphany_model_adapter::{EpiphanyModelInputItem, EpiphanyModelRequest};
use sha2::{Digest, Sha256};
@ -117,7 +118,8 @@ pub async fn execute_persona_model_turn_with_runner<R: PersonaModelRunner>(
}
require_persona_execution_unbraked(plan)?;
let projector_prompt = build_persona_projector_prompt(&plan.projector_input);
let projector_prompt =
build_persona_projector_prompt_with_transcript(&plan.projector_input, &plan.transcript);
let projector = run_stage(
store_path,
plan,
@ -138,11 +140,6 @@ pub async fn execute_persona_model_turn_with_runner<R: PersonaModelRunner>(
let persona_input = PersonaTurnInput {
identity: plan.projector_input.identity.clone(),
projected_state: projector.output.clone(),
semantic_memory_recall: plan.projector_input.semantic_memory_recall.clone(),
pending_mentions: plan.projector_input.pending_mentions.clone(),
repo_activity: plan.projector_input.repo_activity.clone(),
social_affordances: plan.projector_input.social_affordances.clone(),
transcript: plan.transcript.clone(),
};
let persona_prompt = build_persona_turn_prompt(&persona_input);
let persona = run_stage(
@ -159,7 +156,7 @@ pub async fn execute_persona_model_turn_with_runner<R: PersonaModelRunner>(
let interpreter_input = PersonaInterpreterInput {
identity: plan.projector_input.identity.clone(),
persona_prompt,
persona_prompt: projector.output.clone(),
persona_output: persona.output.clone(),
semantic_memory_recall: plan.projector_input.semantic_memory_recall.clone(),
dynamic_semantic_memory_recall: plan.dynamic_semantic_memory_recall.clone(),

View file

@ -572,6 +572,17 @@ world actions pass through Bifrost identity/governance and Heimdall capability
proofs. Persona speech audits are typed CultMesh witnesses; public speech does
not expose private worker or operator state.
The generalized Projector → Persona → Interpreter prompt membrane is owned by
Ghostlight's `ghostlight-persona-projection` crate and consumed here at an exact
Git revision. Epiphany supplies its typed memory, repo activity, social
affordances, transcript, and organ dependencies to the Projector. The Persona
receives only the resulting lived narrative stream; raw transcript, semantic
recall, mentions, repo activity, and typed state are no longer parallel Persona
prompt authorities. The Interpreter receives that lived stream, the natural
Persona turn, and Epiphany's bounded effect schema. Epiphany remains owner of
stage receipts, reasoning projections, effect validation, Mind admission,
swarm-brake enforcement, Bifrost consequences, and atomic terminal commit.
## Heartbeat And Daemon Physiology
`heartbeat_state.rs`, `epiphany-heartbeat-store`,

View file

@ -4,6 +4,13 @@ Updated: 2026-08-16
## Current state
The Persona projection membrane now consumes Ghostlight's generalized
`ghostlight-persona-projection` crate pinned to Ghostlight commit `51fc7495`.
The live executor projects transcript and typed Persona context before Persona
cognition; Persona receives one lived stream only. Epiphany still owns typed
effects, receipts, Mind admission, brakes, external consequence gates, and
terminal commit. Focused core and OpenAI-runtime Persona suites pass.
The five-day shakedown remains paused. The active source is exact `2ba6b9dc` on
`codex/epiphany-shakedown-live`: the keyed Mind hard cut, federated Model Atlas
vertical slice, ordinary Modeling authoring path, durable publisher identity,

View file

@ -86,7 +86,7 @@ active_subgoals:
organ_readiness:
model_atlas: code-complete and locally verified; ordinary Modeling uses runtime-authored proposal v2, authenticated Body-manifest evidence, derived opaque IDs, and exact CAS. Publishers revalidate Body evidence; signed transport, deterministic enriched projection, one Eve tree, local impact admission, Resident Self lane pressure, brakes, partition staleness, cycle policy, and no-Hands boundary pass. Real ordered Starfire Gate 1 and sustained dogfood remain open.
persona: partial; cross-host request/receipt/permit organs, distinct identities, exact release admission, unique permit completion, signed failure/unknown receipts, and no-repost behavior are live. Exact Bifrost cb3239aa fixes positional permit bodies and binds the Discord bridge command receipt to the signed request. A completed public consequence remains unproven because Yggdrasil has no Discord bot credential.
persona: partial; the live Projector -> Persona -> Interpreter loop now consumes Ghostlight's exact-revision generalized projection membrane, and the Persona receives only one lived narrative stream rather than parallel raw transcript, memory, mention, activity, or typed-state authorities. Epiphany retains stage receipts, effect validation, Mind admission, brakes, Bifrost consequence gates, and terminal commit. Cross-host request/receipt/permit organs, distinct identities, exact release admission, unique permit completion, signed failure/unknown receipts, and no-repost behavior are live. Exact Bifrost cb3239aa fixes positional permit bodies and binds the Discord bridge command receipt to the signed request. A completed public consequence remains unproven because Yggdrasil has no Discord bot credential.
self: partial; proposal recovery, Mind admission, current-model Hands routing, Soul lifecycle precedence, verdict incorporation, proposal preemption, challenge-aware Eyes routing, in-process status ownership, causal Research/Soul-to-Modeling routing, and grant-owned lifecycle projection are live. Exact d4907ee8 proves first-attempt proposal Modeling fulfillment, exact grant terminalization, and one terminal downstream review whose receipt carries the post-transaction awaitFrontierProposal action without replay.
eyes: local and copied Linux source-gathering circuits are proven. Immutable GitHub identity, execution revalidation without a grant, frontier-owned continuation, and request-owned exact public-source coverage share typed owners. Exact 3d13b1ea rejects zero, partial, or unrequested public lookup sets. Exact c40aa286 shares terminal receipt validation across provider and Mind. Exact 40beb6a9 and 08383c6d make one Research lifecycle own launch/review projection across Self, status, and coordinator. Exact packaged f90f1186 completed two immutable public lookup and Mind-acceptance cycles, advanced authenticated tool receipts from 53 to 61, produced no Hands consequence, survived process turnover, and stopped braked with both daemons exiting zero.
modeling: proven for the current bounded Windows circuit, the causal Linux resident Eyes-to-Modeling route, governed live directory observation, typed resident grant sight, first-attempt proposal-frontier publication, and single-consumption coordinator review. Exact d4907ee8 proves one outer job, one terminal review, post-transaction awaitFrontierProposal publication, and no replay. Broader Body-map coverage remains open.