Type heartbeat cognition bridge

This commit is contained in:
Meta Vens 2026-05-18 10:50:27 +01:00
commit fafc34c300
8 changed files with 233 additions and 220 deletions

View file

@ -96,10 +96,16 @@ pub fn run_void_routine_store(
&resonance_view,
&incubation,
);
let candidate_interventions = build_candidate_interventions(&bridge, &incubation);
let appraisals =
build_agent_appraisals(&appraisal_profiles, &thought_lanes, &incubation, &bridge);
let reactions = build_agent_reactions(&appraisals, &bridge);
let bridge_view =
serde_json::to_value(&bridge).context("failed to project typed heartbeat bridge")?;
let candidate_interventions = build_candidate_interventions(&bridge_view, &incubation);
let appraisals = build_agent_appraisals(
&appraisal_profiles,
&thought_lanes,
&incubation,
&bridge_view,
);
let reactions = build_agent_reactions(&appraisals, &bridge_view);
apply_mood_timing_from_appraisals(&mut state, &appraisals);
let sleep_cycle = update_sleep_cycle(
previous_cognition
@ -1355,7 +1361,7 @@ fn build_memory_resonance(records: &[RoleMemoryRecord]) -> HeartbeatMemoryResona
fn build_incubation(
previous: &Option<Value>,
bridge: &Option<Value>,
bridge: &Option<HeartbeatCognitionBridge>,
candidate_interventions: &Option<HeartbeatCandidateInterventions>,
resonance: &HeartbeatMemoryResonance,
records: &[RoleMemoryRecord],
@ -1673,11 +1679,11 @@ fn build_thought_lanes(
}
fn build_thought_bridge(
previous: &Option<Value>,
previous: &Option<HeartbeatCognitionBridge>,
thought_lanes: &Value,
resonance: &Value,
incubation: &Value,
) -> Value {
) -> HeartbeatCognitionBridge {
let analytic_count = thought_lanes
.pointer("/analytic/activeThreads")
.and_then(Value::as_array)
@ -1745,42 +1751,42 @@ fn build_thought_bridge(
};
let mut syntheses = previous
.as_ref()
.and_then(|value| value.get("recentSyntheses"))
.or_else(|| {
previous
.as_ref()
.and_then(|value| value.get("recent_syntheses"))
})
.and_then(Value::as_array)
.cloned()
.map(|value| value.recent_syntheses.clone())
.unwrap_or_default();
syntheses.push(serde_json::json!({
"timestamp": now_iso(),
"summary": if let Some(theme) = &strongest_theme {
syntheses.push(HeartbeatBridgeSynthesis {
timestamp: now_iso(),
summary: if let Some(theme) = &strongest_theme {
bridge_summary(theme, speak_decision)
} else {
"No strong convergence yet; hold the lanes open without forcing speech.".to_string()
},
"dominantTopics": strongest_theme
dominant_topics: strongest_theme
.as_ref()
.and_then(|theme| theme.get("themeId"))
.cloned()
.map(|topic| vec![topic])
.and_then(Value::as_str)
.map(|topic| vec![topic.to_string()])
.unwrap_or_default(),
"laneBalance": lane_balance,
"speakDecision": speak_decision,
"themeStatus": strongest_status,
"noveltyToSelf": round3(strongest_novelty_to_self),
"noveltyToRoom": round3(strongest_novelty_to_room),
"saturationScore": round3(strongest_saturation),
"saturationNote": synthesis_saturation_note(strongest_status, strongest_saturation, strongest_novelty_to_self),
}));
lane_balance: lane_balance.to_string(),
speak_decision: speak_decision.to_string(),
theme_status: strongest_status.to_string(),
novelty_to_self: round3(strongest_novelty_to_self),
novelty_to_room: round3(strongest_novelty_to_room),
saturation_score: round3(strongest_saturation),
saturation_note: synthesis_saturation_note(
strongest_status,
strongest_saturation,
strongest_novelty_to_self,
)
.unwrap_or_default()
.to_string(),
});
syntheses.reverse();
syntheses.truncate(8);
syntheses.reverse();
let source_coverage = incubation
.get("sourceCoverage")
.cloned()
.and_then(|value| serde_json::from_value(value).ok())
.unwrap_or_else(empty_source_coverage);
let topic_saturation = topic_saturation_from_syntheses_and_themes(
&syntheses,
@ -1799,31 +1805,32 @@ fn build_thought_bridge(
.unwrap_or(&[]),
);
serde_json::json!({
"schema_version": "epiphany.cognition_bridge.v0",
"updatedAt": now_iso(),
"recentSyntheses": syntheses,
"sourceCoverage": source_coverage,
"topicSaturation": topic_saturation,
"refractoryTopics": refractory_topics,
"unresolvedTensions": [{
"topic": "thought authority boundary",
"summary": "Cognition lanes may shape attention and drafts, but only reviewed Epiphany state surfaces change project truth.",
"openedAt": now_iso(),
HeartbeatCognitionBridge {
schema_version: "epiphany.cognition_bridge.v0".to_string(),
updated_at: now_iso(),
recent_syntheses: syntheses,
source_coverage,
topic_saturation,
refractory_topics,
unresolved_tensions: vec![HeartbeatUnresolvedTension {
topic: "thought authority boundary".to_string(),
summary: "Cognition lanes may shape attention and drafts, but only reviewed Epiphany state surfaces change project truth.".to_string(),
opened_at: now_iso(),
}],
"decision": {
"laneBalance": lane_balance,
"speakDecision": speak_decision,
"reason": bridge_decision_reason(
decision: HeartbeatBridgeDecision {
lane_balance: lane_balance.to_string(),
speak_decision: speak_decision.to_string(),
reason: bridge_decision_reason(
strongest_status,
strongest_novelty_to_self,
strongest_novelty_to_room,
strongest_saturation,
strongest_refractory,
speak_decision,
),
)
.to_string(),
},
})
}
}
fn build_candidate_interventions(
@ -2161,17 +2168,14 @@ fn reaction_recommended_use(role_id: &str, mode: &str) -> &'static str {
}
}
fn topic_saturation_from_syntheses_and_themes(syntheses: &[Value], themes: &[Value]) -> Vec<Value> {
fn topic_saturation_from_syntheses_and_themes(
syntheses: &[HeartbeatBridgeSynthesis],
themes: &[Value],
) -> Vec<HeartbeatTopicSaturation> {
let mut counts: BTreeMap<String, usize> = BTreeMap::new();
for synthesis in syntheses {
for topic in synthesis
.get("dominantTopics")
.and_then(Value::as_array)
.into_iter()
.flatten()
.filter_map(Value::as_str)
{
*counts.entry(topic.to_string()).or_default() += 1;
for topic in &synthesis.dominant_topics {
*counts.entry(topic.clone()).or_default() += 1;
}
}
for theme in themes {
@ -2190,34 +2194,33 @@ fn topic_saturation_from_syntheses_and_themes(syntheses: &[Value], themes: &[Val
counts
.into_iter()
.filter(|(_, count)| *count > 1)
.map(|(topic, count)| {
serde_json::json!({
"topic": topic,
"dominance": round3((count as f64 / syntheses.len().max(1) as f64).min(1.0)),
"recentMentions": count,
"coolingAdvice": "Require fresh evidence or a new angle before surfacing this topic again.",
})
.map(|(topic, count)| HeartbeatTopicSaturation {
topic,
dominance: round3((count as f64 / syntheses.len().max(1) as f64).min(1.0)),
recent_mentions: count,
cooling_advice:
"Require fresh evidence or a new angle before surfacing this topic again."
.to_string(),
})
.collect()
}
fn refractory_topics_from_themes(previous_bridge: &Option<Value>, themes: &[Value]) -> Vec<Value> {
fn refractory_topics_from_themes(
previous_bridge: &Option<HeartbeatCognitionBridge>,
themes: &[Value],
) -> Vec<HeartbeatRefractoryTopic> {
let previous_topics = previous_bridge
.as_ref()
.and_then(|value| value.get("refractoryTopics"))
.or_else(|| {
previous_bridge
.as_ref()
.and_then(|value| value.get("refractory_topics"))
})
.and_then(Value::as_array)
.cloned()
.map(|value| value.refractory_topics.clone())
.unwrap_or_default();
let now = chrono::Utc::now();
themes
.iter()
.filter_map(|theme| {
let status = theme.get("status").and_then(Value::as_str).unwrap_or("incubating");
let status = theme
.get("status")
.and_then(Value::as_str)
.unwrap_or("incubating");
let saturation = theme
.get("saturationScore")
.and_then(Value::as_f64)
@ -2231,16 +2234,8 @@ fn refractory_topics_from_themes(previous_bridge: &Option<Value>, themes: &[Valu
.unwrap_or("unnamed-theme");
let previous_penalty = previous_topics
.iter()
.find(|entry| {
theme_similarity(
topic,
"",
entry.get("topic").and_then(Value::as_str).unwrap_or(""),
"",
) >= 0.48
})
.and_then(|entry| entry.get("penalty"))
.and_then(Value::as_f64)
.find(|entry| theme_similarity(topic, "", &entry.topic, "") >= 0.48)
.map(|entry| entry.penalty)
.unwrap_or(0.18);
let penalty = round3(
theme
@ -2256,13 +2251,15 @@ fn refractory_topics_from_themes(previous_bridge: &Option<Value>, themes: &[Valu
} else {
2
};
Some(serde_json::json!({
"topic": topic,
"penalty": penalty,
"coolsUntil": (now + Duration::hours(hours)).to_rfc3339_opts(chrono::SecondsFormat::Secs, false).replace('Z', "+00:00"),
"reason": build_refractory_reason(theme),
"lastTriggeredAt": now_iso(),
}))
Some(HeartbeatRefractoryTopic {
topic: topic.to_string(),
penalty,
cools_until: (now + Duration::hours(hours))
.to_rfc3339_opts(chrono::SecondsFormat::Secs, false)
.replace('Z', "+00:00"),
reason: build_refractory_reason(theme),
last_triggered_at: now_iso(),
})
})
.take(6)
.collect()
@ -2289,13 +2286,13 @@ fn build_source_coverage(records: &[RoleMemoryRecord]) -> Value {
})
}
fn empty_source_coverage() -> Value {
serde_json::json!({
"schema_version": "epiphany.source_coverage.v0",
"updatedAt": now_iso(),
"roles": [],
"memoryKinds": [],
})
fn empty_source_coverage() -> HeartbeatSourceCoverage {
HeartbeatSourceCoverage {
schema_version: "epiphany.source_coverage.v0".to_string(),
updated_at: now_iso(),
roles: Vec::new(),
memory_kinds: Vec::new(),
}
}
fn unique_strings_from_value(value: Option<&Value>) -> Vec<String> {
@ -2337,7 +2334,7 @@ fn novelty_to_self(
summary: &str,
source_memory_ids: &[String],
previous_themes: &[Value],
bridge: &Option<Value>,
bridge: &Option<HeartbeatCognitionBridge>,
) -> f64 {
let mut strongest_match = 0.0_f64;
for theme in previous_themes {
@ -2356,33 +2353,15 @@ fn novelty_to_self(
}
for synthesis in bridge
.as_ref()
.and_then(|value| value.get("recentSyntheses"))
.or_else(|| {
bridge
.as_ref()
.and_then(|value| value.get("recent_syntheses"))
})
.and_then(Value::as_array)
.into_iter()
.flatten()
.flat_map(|value| value.recent_syntheses.iter())
.take(6)
{
strongest_match = strongest_match.max(theme_similarity(
theme_id,
summary,
synthesis
.get("dominantTopics")
.and_then(Value::as_array)
.into_iter()
.flatten()
.filter_map(Value::as_str)
.collect::<Vec<_>>()
.join(" / ")
.as_str(),
synthesis
.get("summary")
.and_then(Value::as_str)
.unwrap_or(""),
synthesis.dominant_topics.join(" / ").as_str(),
&synthesis.summary,
));
}
(1.0 - strongest_match).clamp(0.0, 1.0)
@ -2392,7 +2371,7 @@ fn novelty_to_room(
theme_id: &str,
summary: &str,
previous_candidate_interventions: &Option<HeartbeatCandidateInterventions>,
bridge: &Option<Value>,
bridge: &Option<HeartbeatCognitionBridge>,
) -> f64 {
let mut score = 0.64_f64;
for intervention in previous_candidate_interventions
@ -2413,33 +2392,15 @@ fn novelty_to_room(
}
for synthesis in bridge
.as_ref()
.and_then(|value| value.get("recentSyntheses"))
.or_else(|| {
bridge
.as_ref()
.and_then(|value| value.get("recent_syntheses"))
})
.and_then(Value::as_array)
.into_iter()
.flatten()
.flat_map(|value| value.recent_syntheses.iter())
.take(6)
{
let similarity = theme_similarity(
theme_id,
summary,
synthesis
.get("dominantTopics")
.and_then(Value::as_array)
.into_iter()
.flatten()
.filter_map(Value::as_str)
.collect::<Vec<_>>()
.join(" / ")
.as_str(),
synthesis
.get("summary")
.and_then(Value::as_str)
.unwrap_or(""),
synthesis.dominant_topics.join(" / ").as_str(),
&synthesis.summary,
);
if similarity >= 0.42 {
score = score.min(0.44);
@ -2459,7 +2420,7 @@ fn saturation_metrics(
summary: &str,
source_memory_ids: &[String],
previous_themes: &[Value],
bridge: &Option<Value>,
bridge: &Option<HeartbeatCognitionBridge>,
support_count: usize,
) -> SaturationMetrics {
let mut recent_match_count = 0_usize;
@ -2480,33 +2441,15 @@ fn saturation_metrics(
}
for synthesis in bridge
.as_ref()
.and_then(|value| value.get("recentSyntheses"))
.or_else(|| {
bridge
.as_ref()
.and_then(|value| value.get("recent_syntheses"))
})
.and_then(Value::as_array)
.into_iter()
.flatten()
.flat_map(|value| value.recent_syntheses.iter())
.take(5)
{
let similarity = theme_similarity(
theme_id,
summary,
synthesis
.get("dominantTopics")
.and_then(Value::as_array)
.into_iter()
.flatten()
.filter_map(Value::as_str)
.collect::<Vec<_>>()
.join(" / ")
.as_str(),
synthesis
.get("summary")
.and_then(Value::as_str)
.unwrap_or(""),
synthesis.dominant_topics.join(" / ").as_str(),
&synthesis.summary,
);
if similarity >= 0.42 {
recent_match_count += 1;
@ -2514,28 +2457,11 @@ fn saturation_metrics(
}
let existing_topic_saturation = bridge
.as_ref()
.and_then(|value| value.get("topicSaturation"))
.or_else(|| {
bridge
.as_ref()
.and_then(|value| value.get("topic_saturation"))
})
.and_then(Value::as_array)
.into_iter()
.flatten()
.flat_map(|value| value.topic_saturation.iter())
.filter_map(|entry| {
let similarity = theme_similarity(
theme_id,
summary,
entry.get("topic").and_then(Value::as_str).unwrap_or(""),
"",
);
(similarity >= 0.42).then(|| {
entry
.get("dominance")
.and_then(Value::as_f64)
.unwrap_or(0.0)
})
let similarity = theme_similarity(theme_id, summary, &entry.topic, "");
(similarity >= 0.42).then_some(entry.dominance)
})
.fold(0.0_f64, f64::max);
SaturationMetrics {
@ -2547,38 +2473,27 @@ fn saturation_metrics(
}
}
fn refractory_penalty(theme_id: &str, summary: &str, bridge: &Option<Value>) -> f64 {
fn refractory_penalty(
theme_id: &str,
summary: &str,
bridge: &Option<HeartbeatCognitionBridge>,
) -> f64 {
let mut penalty = 0.0_f64;
let now = chrono::Utc::now();
for topic in bridge
.as_ref()
.and_then(|value| value.get("refractoryTopics"))
.or_else(|| {
bridge
.as_ref()
.and_then(|value| value.get("refractory_topics"))
})
.and_then(Value::as_array)
.into_iter()
.flatten()
.flat_map(|value| value.refractory_topics.iter())
{
let cools_until = topic
.get("coolsUntil")
.and_then(Value::as_str)
.and_then(|value| chrono::DateTime::parse_from_rfc3339(value).ok())
let cools_until = chrono::DateTime::parse_from_rfc3339(&topic.cools_until)
.ok()
.map(|value| value.with_timezone(&chrono::Utc));
if cools_until.is_some_and(|deadline| deadline < now) {
continue;
}
let similarity = theme_similarity(
theme_id,
summary,
topic.get("topic").and_then(Value::as_str).unwrap_or(""),
topic.get("reason").and_then(Value::as_str).unwrap_or(""),
);
let similarity = theme_similarity(theme_id, summary, &topic.topic, &topic.reason);
if similarity >= 0.48 {
penalty = penalty
.max(topic.get("penalty").and_then(Value::as_f64).unwrap_or(0.18) * similarity);
penalty = penalty.max(topic.penalty * similarity);
}
}
penalty.clamp(0.0, 0.45)

View file

@ -65,7 +65,7 @@ pub struct EpiphanyHeartbeatCognitionEntry {
#[cultcache(key = 8, default)]
pub thought_lanes: Option<Value>,
#[cultcache(key = 9, default)]
pub bridge: Option<Value>,
pub bridge: Option<HeartbeatCognitionBridge>,
#[cultcache(key = 10, default)]
pub candidate_interventions: Option<HeartbeatCandidateInterventions>,
#[cultcache(key = 11, default)]
@ -166,6 +166,94 @@ pub struct HeartbeatSleepCycle {
pub last_distillation_summary: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatCognitionBridge {
#[serde(rename = "schema_version")]
pub schema_version: String,
pub updated_at: String,
pub recent_syntheses: Vec<HeartbeatBridgeSynthesis>,
pub source_coverage: HeartbeatSourceCoverage,
pub topic_saturation: Vec<HeartbeatTopicSaturation>,
pub refractory_topics: Vec<HeartbeatRefractoryTopic>,
pub unresolved_tensions: Vec<HeartbeatUnresolvedTension>,
pub decision: HeartbeatBridgeDecision,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatBridgeSynthesis {
pub timestamp: String,
pub summary: String,
pub dominant_topics: Vec<String>,
pub lane_balance: String,
pub speak_decision: String,
pub theme_status: String,
pub novelty_to_self: f64,
pub novelty_to_room: f64,
pub saturation_score: f64,
pub saturation_note: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatSourceCoverage {
#[serde(rename = "schema_version")]
pub schema_version: String,
pub updated_at: String,
pub roles: Vec<HeartbeatSourceRoleCount>,
pub memory_kinds: Vec<HeartbeatMemoryKindCount>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatSourceRoleCount {
pub role_id: String,
pub count: usize,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatMemoryKindCount {
pub kind: String,
pub count: usize,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatTopicSaturation {
pub topic: String,
pub dominance: f64,
pub recent_mentions: usize,
pub cooling_advice: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatRefractoryTopic {
pub topic: String,
pub penalty: f64,
pub cools_until: String,
pub reason: String,
pub last_triggered_at: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatUnresolvedTension {
pub topic: String,
pub summary: String,
pub opened_at: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatBridgeDecision {
pub lane_balance: String,
pub speak_decision: String,
pub reason: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HeartbeatMemoryResonancePair {

View file

@ -82,7 +82,7 @@ pub fn heartbeat_status_projection(
"memoryResonance": cognition.as_ref().and_then(|entry| entry.memory_resonance.as_ref()).and_then(typed_json),
"incubation": cognition.as_ref().and_then(|entry| entry.incubation.clone()),
"thoughtLanes": cognition.as_ref().and_then(|entry| entry.thought_lanes.clone()),
"bridge": cognition.as_ref().and_then(|entry| entry.bridge.clone()),
"bridge": cognition.as_ref().and_then(|entry| entry.bridge.as_ref()).and_then(typed_json),
"candidateInterventions": cognition.as_ref().and_then(|entry| entry.candidate_interventions.as_ref()).and_then(typed_json),
"appraisals": cognition.as_ref().and_then(|entry| entry.appraisals.as_ref()).and_then(typed_json),
"reactions": cognition.as_ref().and_then(|entry| entry.reactions.as_ref()).and_then(typed_json),

View file

@ -135,7 +135,9 @@ fn legacy_heartbeat_cognition_entry(
.and_then(|value| serde_json::from_value(value).ok()),
incubation: legacy.incubation,
thought_lanes: legacy.thought_lanes,
bridge: legacy.bridge,
bridge: legacy
.bridge
.and_then(|value| serde_json::from_value(value).ok()),
candidate_interventions: legacy
.candidate_interventions
.and_then(|value| serde_json::from_value(value).ok()),

View file

@ -207,10 +207,7 @@ fn import_bridge_pressure(
let Some(bridge) = cognition.bridge.as_ref() else {
return;
};
let decision = bridge
.pointer("/decision/speakDecision")
.and_then(Value::as_str)
.unwrap_or("silence");
let decision = bridge.decision.speak_decision.as_str();
if decision == "silence" {
return;
}
@ -219,10 +216,11 @@ fn import_bridge_pressure(
EpiphanyMemoryProfile::AgencyPressure,
"heartbeat bridge pressure",
);
let reason = bridge
.pointer("/decision/reason")
.and_then(Value::as_str)
.unwrap_or("Bridge pressure has no explicit reason.");
let reason = if bridge.decision.reason.trim().is_empty() {
"Bridge pressure has no explicit reason."
} else {
bridge.decision.reason.as_str()
};
let node = EpiphanyMemoryNode {
id: memory_graph_node_id(&domain_id, "bridge-pressure", decision, None),
domain_id: domain_id.clone(),
@ -359,8 +357,10 @@ fn incubation_lifecycle(status: &str) -> EpiphanyMemoryLifecycle {
mod tests {
use super::*;
use crate::heartbeat_state::HEARTBEAT_COGNITION_SCHEMA_VERSION;
use crate::heartbeat_state::HeartbeatBridgeDecision;
use crate::heartbeat_state::HeartbeatCandidateIntervention;
use crate::heartbeat_state::HeartbeatCandidateInterventions;
use crate::heartbeat_state::HeartbeatCognitionBridge;
use crate::heartbeat_state::HeartbeatMemoryResonance;
use crate::heartbeat_state::HeartbeatMemoryResonancePair;
use crate::memory_graph::validate_memory_graph_snapshot;
@ -403,12 +403,14 @@ mod tests {
}]
})),
thought_lanes: None,
bridge: Some(serde_json::json!({
"decision": {
"speakDecision": "hold",
"reason": "The thought is live but not ready for speech."
}
})),
bridge: Some(HeartbeatCognitionBridge {
decision: HeartbeatBridgeDecision {
speak_decision: "hold".to_string(),
reason: "The thought is live but not ready for speech.".to_string(),
..Default::default()
},
..Default::default()
}),
candidate_interventions: Some(HeartbeatCandidateInterventions {
schema_version: "epiphany.candidate_interventions.v0".to_string(),
updated_at: "2026-05-18T00:00:00Z".to_string(),

View file

@ -72,6 +72,7 @@ remembers doctrine; the branch remembers the blade.
- Heartbeat cognition candidate interventions now live as typed review-gated speech candidates instead of `Option<Value>` item lists. The memory graph heartbeat profile reads typed candidate items directly; legacy cognition migration parses old candidate JSON only when loading prior stores.
- Heartbeat cognition memory resonance now lives as typed resonance pairs instead of an `Option<Value>` blob. Incubation and memory graph import read typed pairs directly; temporary JSON projection remains only for still-untyped thought-lane/bridge builders and status/artifact output.
- Heartbeat cognition sleep cycle now lives as typed physiology state instead of an `Option<Value>` blob. Legacy sleep JSON is parsed only during old-store migration; status and routine artifacts receive JSON projections.
- Heartbeat cognition bridge judgment now lives as typed durable state instead of an `Option<Value>` blob: syntheses, source coverage, topic saturation, refractory topics, tensions, and speech decision are typed fields. The memory graph heartbeat profile reads typed bridge decisions directly; only incubation and thought lanes remain as live cognition JSON pockets.
- Heartbeat durable document/schema types now live in `epiphany-core/src/heartbeat_state/heartbeat_documents.rs`, role/default construction lives in `epiphany-core/src/heartbeat_state/heartbeat_roles.rs`, persistence/validation lives in `epiphany-core/src/heartbeat_state/heartbeat_store.rs`, and status/artifact JSON projection lives in `epiphany-core/src/heartbeat_state/heartbeat_projection.rs`. The root `heartbeat_state.rs` keeps scheduling and Void cognition orchestration for the next cuts. Focused heartbeat tests and `epiphany-core` check pass after the splits.
- Heartbeat role/default and store seams now have module-local unit tests: fixed lane catalog, Ghostlight scene role projection, and typed state/cognition CultCache round-trip. Keep future heartbeat cuts aligned to those seam tests instead of growing root integration-only coverage.
- Heartbeat adaptive pacing now lives in `epiphany-core/src/heartbeat_state/heartbeat_pacing.rs`, including running-turn count and effective cooldown multipliers. It has a module-local unit test for pending-turn counting; root scheduling calls the pacing seam instead of owning pressure/concurrency math directly.

Binary file not shown.

View file

@ -65,6 +65,11 @@ objective:
Heartbeat cognition sleep cycle is typed physiology state; old JSON sleep
blobs are parsed only during legacy-store migration and status/artifacts
receive JSON projections.
Heartbeat cognition bridge judgment is typed durable state: syntheses,
source coverage, saturation, refractory topics, tensions, and speech
decision are typed fields. Incubation/thought lanes are the remaining live
cognition JSON pockets, with bridge consuming them through explicit
temporary projections until their own cuts land.
constraints:
- No frontier-scale training tithe.