Shape heartbeat cooldown with personality and mood
This commit is contained in:
parent
46c518234a
commit
01f1a0bcbc
6 changed files with 323 additions and 15 deletions
|
|
@ -127,6 +127,7 @@ fn main() -> Result<()> {
|
|||
schedule_id: tick_schedule_id,
|
||||
source_scene_ref,
|
||||
defer_completion,
|
||||
agent_store: agent_store.clone(),
|
||||
},
|
||||
)?;
|
||||
if apply_rumination {
|
||||
|
|
@ -288,6 +289,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
|
|||
schedule_id: "smoke-work".to_string(),
|
||||
source_scene_ref: "smoke/coordinator".to_string(),
|
||||
defer_completion: true,
|
||||
agent_store: Some(temp_agent_store.clone()),
|
||||
},
|
||||
)?;
|
||||
let blocked_repeat = tick_heartbeat_store(
|
||||
|
|
@ -301,6 +303,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
|
|||
schedule_id: "smoke-work".to_string(),
|
||||
source_scene_ref: "smoke/coordinator".to_string(),
|
||||
defer_completion: true,
|
||||
agent_store: Some(temp_agent_store.clone()),
|
||||
},
|
||||
)
|
||||
.err()
|
||||
|
|
@ -329,6 +332,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
|
|||
schedule_id: "smoke-idle".to_string(),
|
||||
source_scene_ref: "smoke/idle".to_string(),
|
||||
defer_completion: false,
|
||||
agent_store: Some(temp_agent_store.clone()),
|
||||
},
|
||||
)?;
|
||||
|
||||
|
|
@ -390,6 +394,28 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
|
|||
&& routine["routine"]["appraisals"]["schema_version"]
|
||||
== "epiphany.agent_thought_appraisals.v0"
|
||||
&& routine["routine"]["reactions"]["schema_version"] == "epiphany.agent_reactions.v0"
|
||||
&& routine_status["participants"]
|
||||
.as_array()
|
||||
.and_then(|participants| {
|
||||
let hands = participants
|
||||
.iter()
|
||||
.find(|item| item["roleId"] == "implementation")?;
|
||||
let self_lane = participants
|
||||
.iter()
|
||||
.find(|item| item["roleId"] == "coordinator")?;
|
||||
let hands_personality = hands["personalityCooldownMultiplier"]
|
||||
.as_f64()
|
||||
.unwrap_or(1.0);
|
||||
let self_personality = self_lane["personalityCooldownMultiplier"]
|
||||
.as_f64()
|
||||
.unwrap_or(1.0);
|
||||
let hands_effective = hands["effectiveCooldownMultiplier"].as_f64().unwrap_or(1.0);
|
||||
let self_effective = self_lane["effectiveCooldownMultiplier"]
|
||||
.as_f64()
|
||||
.unwrap_or(1.0);
|
||||
Some(hands_personality < self_personality && hands_effective < self_effective)
|
||||
})
|
||||
== Some(true)
|
||||
&& routine_status["sleepCycle"]["schema_version"] == "epiphany.sleep_cycle.v0";
|
||||
|
||||
let result = serde_json::json!({
|
||||
|
|
@ -400,6 +426,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
|
|||
"idleEvent": idle["event"],
|
||||
"idleRumination": idle["rumination"],
|
||||
"voidRoutine": routine["routine"],
|
||||
"personalityTiming": routine_status["participants"],
|
||||
"validationErrors": validation_errors,
|
||||
"initiativeErrors": initiative_errors,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ pub struct HeartbeatTickOptions {
|
|||
pub schedule_id: String,
|
||||
pub source_scene_ref: String,
|
||||
pub defer_completion: bool,
|
||||
pub agent_store: Option<std::path::PathBuf>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
|
|
@ -478,6 +479,7 @@ pub fn run_void_routine_store(
|
|||
|
||||
let memory_records = collect_role_memory_records(options.agent_store.as_deref())?;
|
||||
let appraisal_profiles = collect_role_appraisal_profiles(options.agent_store.as_deref())?;
|
||||
apply_personality_timing_profiles(&mut state, &appraisal_profiles);
|
||||
let resonance = build_memory_resonance(&memory_records);
|
||||
let incubation = build_incubation(&state.incubation, &resonance, &memory_records);
|
||||
let thought_lanes = build_thought_lanes(&resonance, &incubation, &memory_records);
|
||||
|
|
@ -486,6 +488,7 @@ pub fn run_void_routine_store(
|
|||
let appraisals =
|
||||
build_agent_appraisals(&appraisal_profiles, &thought_lanes, &incubation, &bridge);
|
||||
let reactions = build_agent_reactions(&appraisals, &bridge);
|
||||
apply_mood_timing_from_appraisals(&mut state, &appraisals);
|
||||
let sleep_cycle =
|
||||
update_sleep_cycle(state.sleep_cycle.as_ref(), &incubation, options.allow_dream);
|
||||
let run_id = format!("epiphany-void-routine-{}", now_stamp());
|
||||
|
|
@ -559,6 +562,13 @@ pub fn tick_heartbeat_store(
|
|||
state.target_heartbeat_rate = options.target_heartbeat_rate;
|
||||
}
|
||||
patch_missing_participants(&mut state);
|
||||
if let Some(agent_store) = options.agent_store.as_deref() {
|
||||
let appraisal_profiles = collect_role_appraisal_profiles(Some(agent_store))?;
|
||||
apply_personality_timing_profiles(&mut state, &appraisal_profiles);
|
||||
}
|
||||
if let Some(appraisals) = state.appraisals.clone() {
|
||||
apply_mood_timing_from_appraisals(&mut state, &appraisals);
|
||||
}
|
||||
let result = tick_once(&mut state, &options)?;
|
||||
write_heartbeat_state_entry(store_path, &state)?;
|
||||
|
||||
|
|
@ -678,7 +688,7 @@ fn tick_once(
|
|||
rate,
|
||||
);
|
||||
let scene_clock = state.scene_clock.max(selected.next_ready_at);
|
||||
let recovery = action.base_recovery
|
||||
let recovery = action.base_recovery * effective_cooldown_multiplier(&selected)
|
||||
/ selected
|
||||
.initiative_speed
|
||||
.max(state.selection_policy.minimum_speed);
|
||||
|
|
@ -699,6 +709,19 @@ fn tick_once(
|
|||
next_ready_at: None,
|
||||
extra: BTreeMap::new(),
|
||||
};
|
||||
let mut pending = pending;
|
||||
pending.extra.insert(
|
||||
"personalityCooldownMultiplier".to_string(),
|
||||
serde_json::json!(personality_cooldown_multiplier(&selected)),
|
||||
);
|
||||
pending.extra.insert(
|
||||
"moodCooldownMultiplier".to_string(),
|
||||
serde_json::json!(mood_cooldown_multiplier(&selected)),
|
||||
);
|
||||
pending.extra.insert(
|
||||
"effectiveCooldownMultiplier".to_string(),
|
||||
serde_json::json!(effective_cooldown_multiplier(&selected)),
|
||||
);
|
||||
state.participants[selected_index].pending_turn = Some(pending.clone());
|
||||
state.participants[selected_index].last_action_id = Some(action.action_id.clone());
|
||||
state.participants[selected_index].last_woke_at = Some(now_iso());
|
||||
|
|
@ -751,6 +774,9 @@ fn tick_once(
|
|||
"action_type": action.action_type,
|
||||
"action_scale": action.action_scale,
|
||||
"base_recovery": action.base_recovery,
|
||||
"personality_cooldown_multiplier": personality_cooldown_multiplier(&selected_after),
|
||||
"mood_cooldown_multiplier": mood_cooldown_multiplier(&selected_after),
|
||||
"effective_cooldown_multiplier": effective_cooldown_multiplier(&selected_after),
|
||||
"initiative_cost": action.initiative_cost,
|
||||
"interruptibility": action.interruptibility,
|
||||
"commitment": action.commitment,
|
||||
|
|
@ -782,7 +808,7 @@ fn tick_once(
|
|||
"review_notes": [
|
||||
"Epiphany heartbeat uses Ghostlight initiative timing as a harness scheduling receipt.",
|
||||
"A selected idle lane may ruminate and request bounded self-memory mutation; it may not invent project work.",
|
||||
"When no coordinator work is active, idle rumination uses the sleep heartbeat multiplier so the swarm dreams slowly instead of thrashing."
|
||||
"When no coordinator work is active, idle rumination is slowed by the sleep multiplier and shaped by personality and mood cooldowns so the swarm dreams instead of thrashing."
|
||||
],
|
||||
});
|
||||
|
||||
|
|
@ -969,11 +995,11 @@ fn action_for_selection(
|
|||
commitment: 0.25,
|
||||
local_affordance_basis: vec![
|
||||
format!(
|
||||
"{} has no actionable lane work; ruminate and distill role memory.",
|
||||
"{} has no actionable lane work; ruminate on role quality and prepare candidate self-memory pressure.",
|
||||
selected.display_name
|
||||
),
|
||||
"Heartbeat slots control opportunity, not project authority.".to_string(),
|
||||
"When no coordinator work is active, idle rumination uses the sleep heartbeat multiplier so the swarm dreams slowly instead of thrashing.".to_string(),
|
||||
"When no coordinator work is active, idle rumination is slowed by the sleep multiplier and shaped by personality and mood cooldowns so the swarm dreams instead of thrashing.".to_string(),
|
||||
],
|
||||
}
|
||||
}
|
||||
|
|
@ -1304,6 +1330,11 @@ fn participant_status_json(participant: &HeartbeatParticipant) -> Value {
|
|||
"arena": participant_arena(participant),
|
||||
"participantKind": participant_kind(participant),
|
||||
"initiativeSpeed": participant.initiative_speed,
|
||||
"personalityCooldownMultiplier": personality_cooldown_multiplier(participant),
|
||||
"moodCooldownMultiplier": mood_cooldown_multiplier(participant),
|
||||
"effectiveCooldownMultiplier": effective_cooldown_multiplier(participant),
|
||||
"personalityTiming": participant.extra.get("personalityTiming"),
|
||||
"moodTiming": participant.extra.get("moodTiming"),
|
||||
"nextReadyAt": participant.next_ready_at,
|
||||
"reactionBias": participant.reaction_bias,
|
||||
"interruptThreshold": participant.interrupt_threshold,
|
||||
|
|
@ -1324,6 +1355,9 @@ fn schedule_participant_json(participant: &HeartbeatParticipant) -> Value {
|
|||
"arena": participant_arena(participant),
|
||||
"participant_kind": participant_kind(participant),
|
||||
"initiative_speed": participant.initiative_speed,
|
||||
"personality_cooldown_multiplier": personality_cooldown_multiplier(participant),
|
||||
"mood_cooldown_multiplier": mood_cooldown_multiplier(participant),
|
||||
"effective_cooldown_multiplier": effective_cooldown_multiplier(participant),
|
||||
"next_ready_at": participant.next_ready_at,
|
||||
"reaction_bias": participant.reaction_bias,
|
||||
"interrupt_threshold": participant.interrupt_threshold,
|
||||
|
|
@ -1354,6 +1388,9 @@ fn pending_turn_json(turn: &HeartbeatPendingTurn) -> Value {
|
|||
"startedAt": turn.started_at,
|
||||
"startedSceneClock": turn.started_scene_clock,
|
||||
"baseRecovery": turn.base_recovery,
|
||||
"personalityCooldownMultiplier": turn.extra.get("personalityCooldownMultiplier"),
|
||||
"moodCooldownMultiplier": turn.extra.get("moodCooldownMultiplier"),
|
||||
"effectiveCooldownMultiplier": turn.extra.get("effectiveCooldownMultiplier"),
|
||||
"recovery": turn.recovery,
|
||||
"cooldownPolicy": turn.cooldown_policy,
|
||||
"completedAt": turn.completed_at,
|
||||
|
|
@ -1387,16 +1424,16 @@ fn rumination_patch(role_id: &str, action_id: &str) -> Value {
|
|||
let display_name = display_name_for_role(role_id);
|
||||
serde_json::json!({
|
||||
"agentId": agent_id_for_role(role_id),
|
||||
"reason": format!("{display_name} won an idle heartbeat slot and should preserve the habit of using idle wakeups to distill role memory instead of manufacturing project work."),
|
||||
"reason": format!("{display_name} won an idle heartbeat slot and should preserve the habit of using idle wakeups to ruminate before sleep/review distills anything durable."),
|
||||
"semanticMemories": [{
|
||||
"memoryId": format!("mem-{role_id}-heartbeat-rumination"),
|
||||
"summary": "When a heartbeat wakes this lane and no coordinator-approved work is available, the correct move is to ruminate on role quality, cut stale memory, and return a bounded self-memory improvement rather than inventing project authority.",
|
||||
"summary": "When a heartbeat wakes this lane and no coordinator-approved work is available, the correct move is to ruminate on role quality and surface candidate self-memory pressure rather than inventing project authority; durable distillation belongs in sleep or review.",
|
||||
"salience": 0.78,
|
||||
"confidence": 0.88,
|
||||
}],
|
||||
"goals": [{
|
||||
"goalId": format!("goal-{role_id}-heartbeat-self-distill"),
|
||||
"description": "Use idle heartbeat slots to become sharper at this lane's own work before touching project state.",
|
||||
"goalId": format!("goal-{role_id}-heartbeat-rumination"),
|
||||
"description": "Use idle heartbeat slots to ruminate on this lane's own work and prepare bounded memory pressure before touching project state.",
|
||||
"scope": "life",
|
||||
"priority": 0.82,
|
||||
"emotionalStake": "An idle organ that invents work becomes noise in the bloodstream.",
|
||||
|
|
@ -1592,6 +1629,247 @@ fn collect_trait_group(
|
|||
}
|
||||
}
|
||||
|
||||
fn apply_personality_timing_profiles(
|
||||
state: &mut EpiphanyHeartbeatStateEntry,
|
||||
profiles: &[RoleAppraisalProfile],
|
||||
) {
|
||||
for participant in &mut state.participants {
|
||||
let Some(profile) = profiles
|
||||
.iter()
|
||||
.find(|profile| profile.role_id == participant.role_id)
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
let timing = personality_timing_for_profile(profile);
|
||||
participant.extra.insert(
|
||||
"personalityCooldownMultiplier".to_string(),
|
||||
serde_json::json!(timing.cooldown_multiplier),
|
||||
);
|
||||
participant.extra.insert(
|
||||
"personalityTiming".to_string(),
|
||||
serde_json::json!({
|
||||
"schema_version": "epiphany.personality_timing.v0",
|
||||
"source": "state/agents.msgpack",
|
||||
"cooldownMultiplier": timing.cooldown_multiplier,
|
||||
"workDrive": timing.work_drive,
|
||||
"handsiness": timing.handsiness,
|
||||
"caution": timing.caution,
|
||||
"ruminationBias": timing.rumination_bias,
|
||||
"basis": timing.basis,
|
||||
"contract": "Cooldown is personality-shaped. Lower multipliers recover faster; higher multipliers yield the floor to other lanes."
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct PersonalityTiming {
|
||||
cooldown_multiplier: f64,
|
||||
work_drive: f64,
|
||||
handsiness: f64,
|
||||
caution: f64,
|
||||
rumination_bias: f64,
|
||||
basis: Vec<String>,
|
||||
}
|
||||
|
||||
fn personality_timing_for_profile(profile: &RoleAppraisalProfile) -> PersonalityTiming {
|
||||
let work_drive = trait_match_score(
|
||||
&profile.traits,
|
||||
&[
|
||||
"objective",
|
||||
"diff",
|
||||
"implementation",
|
||||
"hands",
|
||||
"bloodhound",
|
||||
"craft",
|
||||
"act",
|
||||
"source_touch",
|
||||
"work",
|
||||
"task",
|
||||
],
|
||||
);
|
||||
let handsiness = trait_match_score(
|
||||
&profile.traits,
|
||||
&[
|
||||
"hands",
|
||||
"implementation",
|
||||
"diff_truth",
|
||||
"objective_pursuit",
|
||||
"bloodhound_pressure",
|
||||
"source_touch_precision",
|
||||
"small_reviewable_cut",
|
||||
"craft",
|
||||
],
|
||||
);
|
||||
let caution = trait_match_score(
|
||||
&profile.traits,
|
||||
&[
|
||||
"review",
|
||||
"gate",
|
||||
"caution",
|
||||
"guard",
|
||||
"risk",
|
||||
"verification",
|
||||
"truth",
|
||||
"falsification",
|
||||
"routing",
|
||||
"discipline",
|
||||
],
|
||||
);
|
||||
let rumination_bias = trait_match_score(
|
||||
&profile.traits,
|
||||
&[
|
||||
"dream",
|
||||
"memory",
|
||||
"reflection",
|
||||
"imagination",
|
||||
"future",
|
||||
"translation",
|
||||
"watch",
|
||||
"continuity",
|
||||
"self",
|
||||
],
|
||||
);
|
||||
let cooldown = (1.05 + profile.guardedness * 0.28 + caution * 0.24 + rumination_bias * 0.08
|
||||
- profile.reactivity * 0.16
|
||||
- profile.plasticity * 0.10
|
||||
- work_drive * 0.18
|
||||
- handsiness * 0.34)
|
||||
.clamp(0.55, 1.55);
|
||||
let mut basis = Vec::new();
|
||||
for item in profile.traits.iter().take(6) {
|
||||
basis.push(format!(
|
||||
"{}.{} activation {:.2} plasticity {:.2}",
|
||||
item.group, item.name, item.activation, item.plasticity
|
||||
));
|
||||
}
|
||||
PersonalityTiming {
|
||||
cooldown_multiplier: round3(cooldown),
|
||||
work_drive: round3(work_drive),
|
||||
handsiness: round3(handsiness),
|
||||
caution: round3(caution),
|
||||
rumination_bias: round3(rumination_bias),
|
||||
basis,
|
||||
}
|
||||
}
|
||||
|
||||
fn trait_match_score(traits: &[PersonalityTraitProjection], needles: &[&str]) -> f64 {
|
||||
let mut score = 0.0_f64;
|
||||
let mut weight = 0.0_f64;
|
||||
for item in traits {
|
||||
let haystack = format!("{} {}", item.group, item.name);
|
||||
let matched = needles
|
||||
.iter()
|
||||
.any(|needle| haystack.contains(&needle.replace('_', " ")));
|
||||
let matched = matched || needles.iter().any(|needle| haystack.contains(*needle));
|
||||
if matched {
|
||||
let item_weight = 0.7 + item.plasticity * 0.3;
|
||||
score += item.activation * item_weight;
|
||||
weight += item_weight;
|
||||
}
|
||||
}
|
||||
if weight <= f64::EPSILON {
|
||||
0.0
|
||||
} else {
|
||||
(score / weight).clamp(0.0, 1.0)
|
||||
}
|
||||
}
|
||||
|
||||
fn apply_mood_timing_from_appraisals(state: &mut EpiphanyHeartbeatStateEntry, appraisals: &Value) {
|
||||
let Some(items) = appraisals
|
||||
.get("participantAppraisals")
|
||||
.and_then(Value::as_array)
|
||||
else {
|
||||
return;
|
||||
};
|
||||
for participant in &mut state.participants {
|
||||
let Some(appraisal) = items
|
||||
.iter()
|
||||
.find(|item| item.get("roleId").and_then(Value::as_str) == Some(&participant.role_id))
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
let emotional = appraisal
|
||||
.get("emotionalAppraisal")
|
||||
.and_then(Value::as_object);
|
||||
let urgency = emotional
|
||||
.and_then(|value| value.get("urgency"))
|
||||
.and_then(Value::as_f64)
|
||||
.unwrap_or(0.0)
|
||||
.clamp(0.0, 1.0);
|
||||
let arousal = emotional
|
||||
.and_then(|value| value.get("arousal"))
|
||||
.and_then(Value::as_f64)
|
||||
.unwrap_or(0.0)
|
||||
.clamp(0.0, 1.0);
|
||||
let thought_pressure = emotional
|
||||
.and_then(|value| value.get("thoughtPressure"))
|
||||
.and_then(Value::as_f64)
|
||||
.unwrap_or(0.0)
|
||||
.clamp(0.0, 1.0);
|
||||
let guardedness = emotional
|
||||
.and_then(|value| value.get("guardedness"))
|
||||
.and_then(Value::as_f64)
|
||||
.unwrap_or(0.0)
|
||||
.clamp(0.0, 1.0);
|
||||
let reaction_intensity = appraisal
|
||||
.pointer("/candidateImplications/reactionIntensity")
|
||||
.and_then(Value::as_f64)
|
||||
.unwrap_or(0.0)
|
||||
.clamp(0.0, 1.0);
|
||||
let anxiety = (urgency * 0.32
|
||||
+ arousal * 0.22
|
||||
+ thought_pressure * 0.24
|
||||
+ guardedness * 0.12
|
||||
+ reaction_intensity * 0.10)
|
||||
.clamp(0.0, 1.0);
|
||||
let multiplier =
|
||||
(1.10 - urgency * 0.24 - anxiety * 0.38 - reaction_intensity * 0.12).clamp(0.55, 1.25);
|
||||
participant.extra.insert(
|
||||
"moodCooldownMultiplier".to_string(),
|
||||
serde_json::json!(round3(multiplier)),
|
||||
);
|
||||
participant.extra.insert(
|
||||
"moodTiming".to_string(),
|
||||
serde_json::json!({
|
||||
"schema_version": "epiphany.mood_timing.v0",
|
||||
"source": appraisal.get("appraisalId"),
|
||||
"cooldownMultiplier": round3(multiplier),
|
||||
"anxiety": round3(anxiety),
|
||||
"urgency": round3(urgency),
|
||||
"arousal": round3(arousal),
|
||||
"thoughtPressure": round3(thought_pressure),
|
||||
"guardedness": round3(guardedness),
|
||||
"reactionIntensity": round3(reaction_intensity),
|
||||
"contract": "Mood bends personality timing. Anxiety and urgency lower cooldown so the lane that needs the floor most gets it sooner."
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn personality_cooldown_multiplier(participant: &HeartbeatParticipant) -> f64 {
|
||||
participant
|
||||
.extra
|
||||
.get("personalityCooldownMultiplier")
|
||||
.and_then(Value::as_f64)
|
||||
.unwrap_or(1.0)
|
||||
.clamp(0.25, 3.0)
|
||||
}
|
||||
|
||||
fn mood_cooldown_multiplier(participant: &HeartbeatParticipant) -> f64 {
|
||||
participant
|
||||
.extra
|
||||
.get("moodCooldownMultiplier")
|
||||
.and_then(Value::as_f64)
|
||||
.unwrap_or(1.0)
|
||||
.clamp(0.25, 3.0)
|
||||
}
|
||||
|
||||
fn effective_cooldown_multiplier(participant: &HeartbeatParticipant) -> f64 {
|
||||
round3(personality_cooldown_multiplier(participant) * mood_cooldown_multiplier(participant))
|
||||
.clamp(0.20, 4.0)
|
||||
}
|
||||
|
||||
fn build_memory_resonance(records: &[RoleMemoryRecord]) -> Value {
|
||||
let mut pairs = Vec::new();
|
||||
for (left_index, left) in records.iter().enumerate() {
|
||||
|
|
@ -2523,6 +2801,7 @@ mod tests {
|
|||
schedule_id: "native-work".to_string(),
|
||||
source_scene_ref: "test/native".to_string(),
|
||||
defer_completion: true,
|
||||
agent_store: None,
|
||||
},
|
||||
)?;
|
||||
assert_eq!(work["event"]["selectedRole"], "implementation");
|
||||
|
|
@ -2540,6 +2819,7 @@ mod tests {
|
|||
schedule_id: "native-work-repeat".to_string(),
|
||||
source_scene_ref: "test/native".to_string(),
|
||||
defer_completion: false,
|
||||
agent_store: None,
|
||||
},
|
||||
)
|
||||
.unwrap_err();
|
||||
|
|
@ -2602,6 +2882,7 @@ mod tests {
|
|||
schedule_id: "pallas.turn-001".to_string(),
|
||||
source_scene_ref: "ghostlight/pallas-training-loop-v0".to_string(),
|
||||
defer_completion: true,
|
||||
agent_store: None,
|
||||
},
|
||||
)?;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ remembers doctrine; the branch remembers the blade.
|
|||
- The prompt doctrine pass is landed. Shared Epiphany prompts now carry distilled memory/evidence discipline. Rendered state intro/doctrine text lives in `epiphany-core/src/prompts/`, and lane/control prompt text lives in `vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml`: modeling is the Body, implementation is the Hands and GUI-launched main coding lane, verification is the Soul, reorientation is Life, coordinator remains the read-only Self, and CRRC owns the pre-compaction intervention template.
|
||||
- The Ghostlight memory pass is landed. `epiphany_specialists.toml` now has a shared persistent-memory projection prepended by the harness to fixed role specialists, reorientation workers, coordinator notes, and CRRC checkpoint interventions. The rendered base doctrine also states the Perfect Machine rule directly: prompt is projection, durable typed state is the mind, every lane must improve its own memory/model/prompt/evidence habit or name the repair, and each lane phrases that duty in its own organ language so the salience sticks.
|
||||
- The role self-memory persistence pass is native now. Each lane has a Ghostlight-shaped typed dossier in `state/agents.msgpack`, and specialists may return optional `selfPatch` requests beside their normal role result. `roleResult`/`roleAccept` project coordinator review as `selfPersistence`: accepted requests are role-matched, bounded lane memory/goal/value/private-note mutations; refused requests explain wrong role, project-truth smuggling, authority grabs, bloat, missing reason, or malformed records. GUI/coordinator accept paths apply accepted `selfPatch` requests through the native `epiphany-agent-memory-store` binary; project truth still belongs only in `EpiphanyThreadState`.
|
||||
- The heartbeat initiative pass is landed as a bounded tool seam. `state/agent-heartbeats.msgpack` tracks Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life as Ghostlight-style initiative participants with arena, participant kind, speed, next-ready time, reaction bias, interrupt threshold, load, status, constraints, history, and pending turns through `epiphany-core::EpiphanyHeartbeatStateEntry` and the native `epiphany-heartbeat-store` binary. Idle turns are for rumination: light thought shuffling, role-quality attention, and candidate selfPatch pressure. Sleep/dream cycle passes are the intended distillation window for durable self-memory and doctrine. JSON heartbeat state and Python wrapper state are gone; general CultCache schema sync, polyglot domain loading, and debug display tools belong in CultLib. This is a callable scheduler seam, not yet an always-on daemon; a heart valve, not a whole circulatory god.
|
||||
- The heartbeat initiative pass is landed as a bounded tool seam. `state/agent-heartbeats.msgpack` tracks Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life as Ghostlight-style initiative participants with arena, participant kind, speed, next-ready time, reaction bias, interrupt threshold, load, status, constraints, personality cooldown, mood cooldown, effective cooldown, history, and pending turns through `epiphany-core::EpiphanyHeartbeatStateEntry` and the native `epiphany-heartbeat-store` binary. Role dossiers set baseline timing; appraisal mood/anxiety bends it through urgency, arousal, thought pressure, guardedness, and reaction intensity, so Hands-like work pressure and high-need anxious lanes recover sooner without being heartbeaten while a prior turn is running. Idle turns are for rumination: light thought shuffling, role-quality attention, and candidate selfPatch pressure. Sleep/dream cycle passes are the intended distillation window for durable self-memory and doctrine. JSON heartbeat state and Python wrapper state are gone; general CultCache schema sync, polyglot domain loading, and debug display tools belong in CultLib. This is a callable scheduler seam, not yet an always-on daemon; a heart valve, not a whole circulatory god.
|
||||
- The first Ghostlight-derived timing slice is landed in Epiphany, but Ghostlight is reference lineage rather than a sibling runtime to preserve. `epiphany-heartbeat-store init --profile ghostlight-scene --scene-id <id> --scene-participant <id|name|speed|reaction|threshold|constraints>` creates a typed CultCache MessagePack scene heartbeat store whose participants are `arena=scene`, `participantKind=character`; `tick` emits `ghostlight.initiative_schedule.v0` receipts with `scene_turn` actions and local-affordance basis. The generic Epiphany maintenance lanes are not auto-patched into scene stores.
|
||||
- The first Void-derived routine slice is landed in Epiphany, but VoidBot is reference lineage rather than a runtime dependency. `epiphany-heartbeat-store routine --store .\state\agent-heartbeats.msgpack --artifact-dir .\.epiphany-heartbeats --agent-store .\state\agents.msgpack` reads typed role dossiers, computes bounded memory resonance, maintains incubation themes, runs analytic and associative cognition lanes, writes bridge syntheses/saturation/tension, projects the active thought cluster through each role's Ghostlight-shaped personality vectors, derives participant-local reactions, advances the sleep/dream cycle, updates the typed heartbeat store, and emits an auditable `epiphany.void_routine.v0` receipt. This mutates only heartbeat physiology fields: project truth and role memory mutation remain on their reviewed surfaces.
|
||||
- The first Void-derived routine slice is landed in Epiphany, but VoidBot is reference lineage rather than a runtime dependency. `epiphany-heartbeat-store routine --store .\state\agent-heartbeats.msgpack --artifact-dir .\.epiphany-heartbeats --agent-store .\state\agents.msgpack` reads typed role dossiers, computes bounded memory resonance, maintains incubation themes, runs analytic and associative cognition lanes, writes bridge syntheses/saturation/tension, projects the active thought cluster through each role's Ghostlight-shaped personality vectors, derives participant-local reactions, applies personality/mood timing, advances the sleep/dream cycle, updates the typed heartbeat store, and emits an auditable `epiphany.void_routine.v0` receipt. This mutates only heartbeat physiology fields: project truth and role memory mutation remain on their reviewed surfaces.
|
||||
- Manual Codex-run rumination still has an explicit aftercare rule until Epiphany owns the full sleep consolidator. In the intended Epiphany cycle, sub-agents ruminate when idle and distill when they sleep; in this supervising Codex thread, a heartbeat/routine vigil is only physiology until a separate closing pass reviews the receipts and decides whether map, handoff, evidence, or role self-memory should change.
|
||||
- The Face public-surface pass is landed as a bounded lane. Face's role dossier lives in `state/agents.msgpack`; `epiphany_specialists.toml` gives it a VoidBot-heartbeat-derived prompt stripped of moderation authority; `state/face-discord.toml` and the native `epiphany-face-discord` binary enforce that Face may interact only through #aquarium. Missing channel id or token writes candidate chat artifacts instead of posting elsewhere.
|
||||
- The first Epiphany-native character-loop pass is landed. `epiphany-character-loop turn --role face --stimulus <text>` loads Face's typed dossier from `state/agents.msgpack` and emits an auditable `epiphany.character_turn_packet.v0` packet with projected local context, visible stimulus, allowed outputs, and guardrails. The same packet builder works for other role ids, because every organ already has a Ghostlight-shaped dossier.
|
||||
|
|
@ -139,8 +139,8 @@ The current spine, blessed but not yet finished:
|
|||
- durable investigation checkpoint packet through typed state, prompt, scene, and context
|
||||
- distilled shared and config-backed prompt doctrine through the base prompt, rendered Epiphany state prompt files, modeling/Body, implementation/Hands, verification/Soul, reorientation/Life, coordinator/Self, and CRRC intervention surfaces
|
||||
- shared Ghostlight-derived persistent memory projection across Imagination, Body, Soul, Life, Self, CRRC checkpoint steering, and the GUI-launched Hands implementation lane
|
||||
- Ghostlight-derived heartbeat initiative scheduling through the native `epiphany-heartbeat-store` binary, with Self and Face included as first-class Epiphany maintenance participants, Ghostlight scene characters supported through the same timing law, idle rumination feeding candidate self-memory pressure, sleep/dream passes serving as the distillation window, and heartbeat state persisted through typed CultCache MessagePack stores
|
||||
- Void-derived native routine physiology through `epiphany-heartbeat-store routine`, with sleep cycle, memory resonance, incubation, analytic/associative cognition lanes, bridge judgment, candidate interventions, Ghostlight-style personality appraisals, derived reactions, and dream maintenance stored in the typed heartbeat store
|
||||
- Ghostlight-derived heartbeat initiative scheduling through the native `epiphany-heartbeat-store` binary, with Self and Face included as first-class Epiphany maintenance participants, Ghostlight scene characters supported through the same timing law, role-personality cooldowns, appraisal mood/anxiety cooldowns, effective recovery timing, idle rumination feeding candidate self-memory pressure, sleep/dream passes serving as the distillation window, and heartbeat state persisted through typed CultCache MessagePack stores
|
||||
- Void-derived native routine physiology through `epiphany-heartbeat-store routine`, with sleep cycle, memory resonance, incubation, analytic/associative cognition lanes, bridge judgment, candidate interventions, Ghostlight-style personality appraisals, mood/anxiety timing, derived reactions, and dream maintenance stored in the typed heartbeat store
|
||||
- Epiphany-native character-loop packet projection through `epiphany-character-loop`, with Face as the first public-surface actor over its typed role dossier
|
||||
- Face as the public #aquarium-only surface for translating agent thought-weather into short chats or candidate drafts, without moderator authority
|
||||
- Ghostlight-shaped role dossiers in `state/agents.msgpack`, plus `selfPatch` review projection through `roleResult`/`roleAccept` and accepted memory application through the native `epiphany-agent-memory-store` binary
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -135,7 +135,7 @@ accepted_design:
|
|||
- Specialist prompts are role-distilled instead of generic and their live text is config-backed in app-server: modeling/checkpoint is the Body of code, dataflow, seams, and frontier; research/scout is the Eyes prompt surface for existing work, vendor guidance, libraries, papers, and anti-Greenspun source selection; implementation is the Hands, the main coding lane and actuator rather than a `roleLaunch` specialist; verification/review is the Soul of promise, invariants, evidence, and user truth; reorientation is Life across compaction and source drift; coordinator is the read-only Self that routes attention without implementing, verifying, promoting, or accepting; Face is the public Discord #aquarium surface that translates agent thought-weather without moderating or leaking sealed thought.
|
||||
- Epiphany prompt surfaces now carry a shared Ghostlight-derived persistent memory projection before lane-specific text: prompt is not memory, durable typed state is the mind, personality and protected values are first-class salience handles, and every lane is explicitly responsible for making its own memory/model/prompt/evidence habit sharper or naming the needed repair. Each lane states self-improvement in its own rite-language: Imagination selects futures, Body clarifies anatomy, Eyes sees earlier, Hands touches source more precisely, Soul becomes harder to fool, Life loses less continuity, Self routes repair, and Face becomes clearer at turning inner weather into useful social presence.
|
||||
- Specialist self-memory now has a bounded Ghostlight-shaped CultCache persistence surface in `state/agents.msgpack`: Imagination, Body, Eyes, Hands, Soul, Life, Self, and Face each have an individual typed role dossier for identity, personality, semantic/episodic/relationship memory, goals, and values. These entries are lane memory only; project truth remains in authoritative `EpiphanyThreadState`.
|
||||
- `state/agent-heartbeats.msgpack`, `epiphany-core::EpiphanyHeartbeatStateEntry`, and the native `epiphany-heartbeat-store` binary are the Ghostlight-derived heartbeat initiative seam. The harness sets a target heartbeat rate; participants carry arena, participant kind, initiative speed, next-ready time, reaction bias, interrupt threshold, current load, status, and constraints; pending coordinator work can pull its owning lane through a reaction window; otherwise the earliest ready active participant wins the slot. If the winner has no routeable maintenance work, it ruminates on role quality and prepares bounded selfPatch pressure rather than pretending rumination has already consolidated doctrine. Sleep/dream cycle passes are the intended distillation window for reviewed self-memory and doctrine. Face can win `surfaceAgentThoughts` or `discordAquariumChat` work slots. Epiphany also owns native character-loop projection through `epiphany-character-loop`, so role dossiers can respond to visible stimuli without importing Ghostlight as runtime. The same heartbeat store now owns the Void-derived routine fields `sleep_cycle`, `memory_resonance`, `incubation`, `thought_lanes`, `bridge`, and `candidate_interventions` through the native `epiphany-heartbeat-store routine` command.
|
||||
- `state/agent-heartbeats.msgpack`, `epiphany-core::EpiphanyHeartbeatStateEntry`, and the native `epiphany-heartbeat-store` binary are the Ghostlight-derived heartbeat initiative seam. The harness sets a target heartbeat rate; participants carry arena, participant kind, initiative speed, next-ready time, reaction bias, interrupt threshold, current load, status, constraints, personality cooldown, mood cooldown, and effective cooldown; pending coordinator work can pull its owning lane through a reaction window; otherwise the earliest ready active participant wins the slot. Role dossiers set the personality baseline, appraisals bend it with mood/anxiety signals such as urgency, arousal, thought pressure, guardedness, and reaction intensity, and lower effective cooldown means the lane recovers sooner and gets the floor more often. If the winner has no routeable maintenance work, it ruminates on role quality and prepares bounded selfPatch pressure rather than pretending rumination has already consolidated doctrine. Sleep/dream cycle passes are the intended distillation window for reviewed self-memory and doctrine. Face can win `surfaceAgentThoughts` or `discordAquariumChat` work slots. Epiphany also owns native character-loop projection through `epiphany-character-loop`, so role dossiers can respond to visible stimuli without importing Ghostlight as runtime. The same heartbeat store now owns the Void-derived routine fields `sleep_cycle`, `memory_resonance`, `incubation`, `thought_lanes`, `bridge`, and `candidate_interventions` through the native `epiphany-heartbeat-store routine` command.
|
||||
- `state/ledgers.msgpack`, `epiphany-core::EpiphanyStateLedgerEntry`, the `epiphany-state-ledger-store` binary, and the native `epiphany-state` CLI now own durable branch and evidence ledgers. The old tracked JSON ledger files and the migration/projection CLI hatches are gone.
|
||||
- CultCache inspection, cross-language schema synchronization, and debug display tooling belong in CultLib, not in EpiphanyAgent. Epiphany should consume typed CultCache documents and expose product-specific status through its API, while general polyglot domain loading/inspection lives with the shared CultCache ecosystem.
|
||||
- VoidBot's current routine is reference lineage only. Epiphany's native routine pass lives in Rust as `epiphany-heartbeat-store routine`: it reads typed role dossiers, projects memory resonance, maintains incubation themes, runs analytic and associative cognition lanes, writes bridge syntheses/saturation/tension, produces reviewed candidate interventions, advances the sleep/dream cycle, and writes an auditable routine receipt while leaving project truth and role memory mutation on their dedicated reviewed surfaces. Qdrant-backed memory vectors remain a future enhancement; the current native pass uses bounded local resonance over typed memories.
|
||||
|
|
@ -197,8 +197,8 @@ landed_baseline:
|
|||
- Phase 6 role self-memory slice: Ghostlight-shaped role dossiers live in typed CultCache `state/agents.msgpack`, specialists may request bounded `selfPatch` lane-memory mutations, coordinator review projects acceptance/refusal reasons through `selfPersistence`, and GUI/coordinator accept paths apply accepted requests with the native `epiphany-agent-memory-store` binary.
|
||||
- Phase 6 Face public-surface slice: Face's typed role dossier, Face prompt text, `state/face-discord.toml`, and the native `epiphany-face-discord` binary establish Face as the public #aquarium-only translator of Epiphany agent thought-weather, without VoidBot's moderation authority.
|
||||
- Phase 6 character-loop slice: native `epiphany-character-loop` loads any role's Ghostlight-shaped typed dossier from `state/agents.msgpack`, combines it with a visible stimulus, and emits an auditable `epiphany.character_turn_packet.v0` local projection for response, bubble, finding, silence, or bounded `selfPatch`. Face is the first intended public-surface consumer; Ghostlight is reference material, not a runtime dependency.
|
||||
- Phase 6 heartbeat initiative slice: `state/agent-heartbeats.msgpack`, `epiphany-core::EpiphanyHeartbeatStateEntry`, the native `epiphany-heartbeat-store` binary, and heartbeat smoke coverage borrow Ghostlight initiative scheduling so Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life compete for heartbeat slots; idle slots become bounded rumination instead of fake project work, and sleep/dream cycle passes are the intended distillation window for durable self-memory and doctrine. The live state surface now ticks/completes/applies heartbeat physiology through typed CultCache MessagePack instead of JSON or Python wrapper state. The same store can now initialize a `ghostlight-scene` profile for character scene turns.
|
||||
- Phase 6 cognition-lanes/Void routine slice: native `epiphany-heartbeat-store routine` rebuilds VoidBot-style sleep, resonance, incubation, parallel analytic/associative thought lanes, bridge judgment, candidate interventions, Ghostlight-style participant-local thought appraisal, derived reactions, and dream maintenance inside Epiphany's heartbeat store. It reads typed role dossiers from `state/agents.msgpack`, projects clustered thought state through each role's personality vectors, updates `state/agent-heartbeats.msgpack`, and emits an auditable `epiphany.void_routine.v0` receipt without importing VoidBot or granting speech/project authority. `epiphany-character-loop` also carries the same cognition lane/bridge/appraisal contract for role-local actor turns; reactions may pace, color, draft, or display behavior, but state mutation remains on reviewed `selfPatch` or project-state surfaces.
|
||||
- Phase 6 heartbeat initiative slice: `state/agent-heartbeats.msgpack`, `epiphany-core::EpiphanyHeartbeatStateEntry`, the native `epiphany-heartbeat-store` binary, and heartbeat smoke coverage borrow Ghostlight initiative scheduling so Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life compete for heartbeat slots; idle slots become bounded rumination instead of fake project work, and sleep/dream cycle passes are the intended distillation window for durable self-memory and doctrine. The live state surface now ticks/completes/applies heartbeat physiology through typed CultCache MessagePack instead of JSON or Python wrapper state. Role personality and current mood/anxiety both shape initiative recovery through personality, mood, and effective cooldown multipliers, so Hands-like work pressure and anxious high-need lanes can recover sooner without waking lanes whose previous turn is still running. The same store can now initialize a `ghostlight-scene` profile for character scene turns.
|
||||
- Phase 6 cognition-lanes/Void routine slice: native `epiphany-heartbeat-store routine` rebuilds VoidBot-style sleep, resonance, incubation, parallel analytic/associative thought lanes, bridge judgment, candidate interventions, Ghostlight-style participant-local thought appraisal, derived reactions, dream maintenance, and mood/anxiety timing inside Epiphany's heartbeat store. It reads typed role dossiers from `state/agents.msgpack`, projects clustered thought state through each role's personality vectors, updates `state/agent-heartbeats.msgpack`, and emits an auditable `epiphany.void_routine.v0` receipt without importing VoidBot or granting speech/project authority. `epiphany-character-loop` also carries the same cognition lane/bridge/appraisal contract for role-local actor turns; reactions may pace, color, draft, or display behavior, but state mutation remains on reviewed `selfPatch` or project-state surfaces.
|
||||
- Native runtime spine slice: `epiphany-core::EpiphanyRuntimeIdentity`, `EpiphanyRuntimeSession`, `EpiphanyRuntimeJob`, `EpiphanyRuntimeJobResult`, and `EpiphanyRuntimeEvent` plus the native `epiphany-runtime-spine` binary establish a CultCache-backed spine, native job/result lifecycle, status projection, and framed CultNet hello output so the old Codex app-server runtime can be starved down to a temporary evacuation bridge instead of remaining the throne.
|
||||
guardrails:
|
||||
- Use focused Rust app-server mapper/handler tests plus matching native `epiphany-core` smoke binaries before modifying update, distill, propose, promote, read-projection, or notification behavior. The old Python smoke shims have been cut.
|
||||
|
|
|
|||
Reference in a new issue