Defer cold feedback consideration until thread exists

This commit is contained in:
Meta Vens 2026-07-19 01:22:29 +01:00
commit aa3d233006
5 changed files with 70 additions and 13 deletions

View file

@ -65,7 +65,8 @@ fn main() -> Result<()> {
"epiphany",
"resident-feedback-consideration-v0",
AT,
)?;
)?
.ok_or_else(|| anyhow::anyhow!("fixture thread did not admit consideration"))?;
if request.source_visibility != feedback.source_visibility
|| request.data_classification != feedback.data_classification
|| request.source_room_id != feedback.source_room_id

View file

@ -205,7 +205,7 @@ pub fn commit_request(
persona_id: &str,
routing_policy_id: &str,
requested_at: &str,
) -> Result<ImaginationConsiderationRequest> {
) -> Result<Option<ImaginationConsiderationRequest>> {
chrono::DateTime::parse_from_rfc3339(requested_at)
.map_err(|_| anyhow!("consideration timestamp must be RFC3339"))?;
let mut cache = crate::runtime_spine_cache(runtime_store)?;
@ -213,9 +213,10 @@ pub fn commit_request(
let identity = cache
.get::<crate::EpiphanyRuntimeIdentity>(crate::RUNTIME_IDENTITY_KEY)?
.ok_or_else(|| anyhow!("consideration requires runtime identity"))?;
let thread = cache
.get::<crate::EpiphanyThreadStateEntry>(crate::THREAD_STATE_KEY)?
.ok_or_else(|| anyhow!("consideration requires thread state"))?;
let Some(thread) = cache.get::<crate::EpiphanyThreadStateEntry>(crate::THREAD_STATE_KEY)?
else {
return Ok(None);
};
let model = crate::runtime_current_repo_model(runtime_store)?
.ok_or_else(|| anyhow!("consideration requires Modeling map"))?;
let model_hash = crate::memory_graph_model_hash(&model)?;
@ -281,14 +282,14 @@ pub fn commit_request(
let mut replay = request;
replay.requested_at = existing.requested_at.clone();
return if replay == existing {
Ok(existing)
Ok(Some(existing))
} else {
bail!("consideration id collision")
};
}
let (entry, _) = cache.prepare_entry(&request_id, &request)?;
SingleFileMessagePackBackingStore::new(runtime_store).push(&entry)?;
Ok(request)
Ok(Some(request))
}
pub fn validate_current_request(
@ -485,6 +486,41 @@ pub fn request_candidate_modeling_review(
#[cfg(test)]
mod tests {
use super::*;
use std::collections::BTreeMap;
#[test]
fn cold_runtime_without_thread_defers_feedback_consideration() -> Result<()> {
let temp = tempfile::tempdir()?;
let runtime = temp.path().join("runtime.ccmp");
let feedback = temp.path().join("feedback.ccmp");
let mut cache = crate::runtime_spine_cache(&runtime)?;
cache.put(
crate::RUNTIME_IDENTITY_KEY,
&crate::EpiphanyRuntimeIdentity {
schema_version: crate::RUNTIME_SPINE_SCHEMA_VERSION.into(),
runtime_id: "runtime-cold".into(),
display_name: "Cold runtime".into(),
runtime_kind: "resident".into(),
created_at: "2026-07-18T00:00:00Z".into(),
updated_at: "2026-07-18T00:00:00Z".into(),
supported_document_types: Vec::new(),
metadata: BTreeMap::new(),
},
)?;
assert!(
commit_request(
&runtime,
&feedback,
"feedback-1",
"GameCult/Epiphany",
"epiphany",
"resident-feedback-consideration-v0",
"2026-07-18T00:01:00Z",
)?
.is_none()
);
Ok(())
}
fn request() -> ImaginationConsiderationRequest {
ImaginationConsiderationRequest {

View file

@ -794,7 +794,7 @@ pub fn ingest_resident_self_domain_pressure(
"admitted Persona feedback escaped its target runtime"
));
}
let request = crate::commit_imagination_consideration_request(
let Some(request) = crate::commit_imagination_consideration_request(
runtime_store,
persona_feedback_store,
&feedback.feedback_id,
@ -802,7 +802,10 @@ pub fn ingest_resident_self_domain_pressure(
&feedback.target_persona_id,
"resident-feedback-consideration-v0",
&requested_at,
)?;
)?
else {
continue;
};
inserted += usize::from(enqueue_resident_self_pressure_idempotent(
resident_store,
&ResidentSelfPressure {

View file

@ -2756,9 +2756,24 @@ daemon lifecycle physiology; explicit daemon lifecycle surfaces still do.
Focused proofs pass and the full core library reports 570 passed, zero failed,
one ignored.
Next action: commit and push the successor and CultCache dependency, revoke the
failed exact candidate authority, then cross the successor through Bifrost and
Idunn while braked. Verify the typed brake, exact
Candidate `86d702002acee8321438f32fb9cf69a29a667d70` built and sealed immutable
release `sha256-da19a70a7e8c0229cd59b292bf5867fd1e97fa40643ab772e918c5d49dd7ff22`
with witness
`sha256-62c65d813837dd4a939e941d798d0842ee5f6c77cddaa645f2c47a18b7c3ec44`.
It was not deployed. Projection and Heartbeat were healthy and braked, but
resident Self found a second cold-start path: feedback-driven Imagination
consideration required thread state before a thread existed. Idunn was
terminated through rollback; all services are inactive and no deployment or
active-release witness exists. The immutable package is evidence only.
That second path now treats absent thread state as a missing prerequisite: it
emits no request, writes nothing, preserves admitted feedback, and retries on a
later pulse. The causal smoke explicitly requires its fixture thread. Focused
Imagination tests, resident-Self tests, and all-bin compilation pass.
Next action: commit and push the second cold-start successor, revoke the failed
`86d70200` authority, then cross the new exact commit through Bifrost and Idunn
while braked. Verify the typed brake, exact
release/witness bindings, all three service owners, signed Idunn health, local
Qdrant/Ollama routes, and final deployment witness. Then run the Starfire-offline
rehearsal before 2026-07-22: organization feedback -> persistent Modeling map ->

View file

@ -785,4 +785,6 @@ current_status:
- Yggdrasil exact-SHA pressure release `586147a751c6eec2d59cd8dc10bd17ce0d02a4d1` proved useful GPU work but failed deployment honestly. GTX 1080 stayed near saturation at 2,419 MiB; bounded four-text requests completed continuously. Mind published 215 vectors, while workspace coverage completed 3,389 Ollama HTTP calls total (about 13.3k workspace chunks after Mind) before Idunn's 50-minute candidate-health deadline at 2026-07-17T01:23:50+02:00. Idunn then stopped the service, published no deployment witness, and reported no exact-candidate daemon-health proof; the Modeling collection remained at the inherited 22 points because the monolithic executor had not yet published its accumulated vectors. This is failure evidence for the execution/deployment contract, not for GPU acceleration. Total wall-time extension is forbidden as the repair.
- Exact Epiphany candidate `9165862cce09739a62b20c0c7728ccceb71cfc2f` crossed Bifrost and built immutable release `sha256-39eed3817a10325b39b7f223fb2919c5959c88443ef82d9cc1497f6af631f365` with witness `sha256-9ad9cfe17fcabffb84fb392cbd5ecc1e8823482a338b38ced52e1020532e80c6`, fourteen root-owned 0555 binaries, and app-owned release publication. It was not deployed: live startup exposed three authority faults, the candidate services and Idunn transaction were terminated through rollback, and neither `deployment.env` nor `active-release.env` exists. The immutable package and stable compiler cache remain reusable evidence, not active authority.
- The candidate faults are cut in source. Heartbeat now forms an owner-filtered typed view over its mixed CultCache store and commits exact owner rows with CAS while preserving readiness rows; CultCache supplies typed `load_envelope` for validated in-memory admission without backing-store publication. A cold resident runtime without thread state yields no direction request yet instead of a fatal error. An engaged `heartbeat.scheduler` brake blocks cognitive scheduling but no longer claims daemon service lifecycle physiology; only `daemon.lifecycle_poke`, `daemon.*`, wildcard, or an empty protected list blocks that owner. Focused shared-store/cold-Self/brake tests pass, and the full core library proves 570 passed, zero failed, one ignored.
next_action: "Commit and push the corrected successor and CultCache dependency, revoke the failed 9165862 authority, authorize the successor exact commit through Bifrost, and let Idunn deploy it on Yggdrasil under the engaged sleep brake. Require immutable package inspection, app-owned release publication, three healthy local service owners, signed aggregate health, and the final deployment.env witness. Then run the Starfire-offline rehearsal before 2026-07-22: persistent Modeling map -> autonomous bounded Imagination proposal, with classified organization feedback through Persona as an additional pressure path; explicit Mind adoption -> Hands consequence -> Bifrost release -> Idunn deployment remain separate gates. Prove replay/tamper refusal and that conversation alone grants no Mind, Hands, Persona-speech, release, or deployment authority. No host reboot is authorized."
- Candidate `86d702002acee8321438f32fb9cf69a29a667d70` built and sealed immutable release `sha256-da19a70a7e8c0229cd59b292bf5867fd1e97fa40643ab772e918c5d49dd7ff22` with witness `sha256-62c65d813837dd4a939e941d798d0842ee5f6c77cddaa645f2c47a18b7c3ec44`. Its first package attempt lost the builder's narrow release-root ownership to a predecessor cleanup race and published nothing; the retry crossed packaging and started all three braked services. Projection and Heartbeat stayed active, but resident Self exposed a second cold-start fatal path in feedback-driven Imagination consideration (`consideration requires thread state`). The Idunn transaction was terminated through rollback; services are inactive and no deployment or active-release witness exists. The package remains immutable evidence only.
- Feedback-driven Imagination consideration now shares the cold-runtime prerequisite semantics of admitted-model direction: absent thread state yields no request yet, preserves admitted feedback for later ingestion, and performs no write. Resident Self skips only that not-yet-constructible request and will retry it on a later pulse. The causal feedback smoke explicitly requires its fixture thread and all binaries compile. This is prerequisite absence, not feedback loss, Mind adoption, or action authority.
next_action: "Commit and push the second cold-start successor, revoke failed 86d70200 authority, authorize the new exact commit through Bifrost, and let Idunn deploy it on Yggdrasil under the engaged sleep brake. Require immutable package inspection, app-owned release publication, three healthy local service owners, signed aggregate health, and the final deployment.env witness. Then run the Starfire-offline rehearsal before 2026-07-22: persistent Modeling map -> autonomous bounded Imagination proposal, with classified organization feedback through Persona as an additional pressure path; explicit Mind adoption -> Hands consequence -> Bifrost release -> Idunn deployment remain separate gates. Prove replay/tamper refusal and that conversation alone grants no Mind, Hands, Persona-speech, release, or deployment authority. No host reboot is authorized."