Build the resident organizational Self

This commit is contained in:
Meta Vens 2026-07-18 17:16:30 +01:00
commit 0a3c364a6c
19 changed files with 10875 additions and 1039 deletions

1
.gitignore vendored
View file

@ -6,7 +6,6 @@ epiphany-openai-adapter/Cargo.lock
epiphany-openai-codex-spine/target/
epiphany-openai-codex-spine/Cargo.lock
epiphany-openai-runtime/target/
epiphany-openai-runtime/Cargo.lock
epiphany-codex-bridge/target/
epiphany-codex-bridge/Cargo.lock
apps/epiphany-gui/node_modules/

View file

@ -57,6 +57,7 @@ fn main() -> Result<()> {
let mut action_id: Option<String> = None;
let mut limit = 8_usize;
let mut agent_store: Option<PathBuf> = None;
let mut resident_self_store: Option<PathBuf> = None;
let mut apply_rumination = false;
let mut profile = "epiphany".to_string();
let mut scene_id = "ghostlight.scene".to_string();
@ -123,6 +124,9 @@ fn main() -> Result<()> {
"--action-id" => action_id = Some(next_value(&mut args, "--action-id")?),
"--limit" => limit = next_value(&mut args, "--limit")?.parse()?,
"--agent-store" => agent_store = Some(next_path(&mut args, "--agent-store")?),
"--resident-self-store" => {
resident_self_store = Some(next_path(&mut args, "--resident-self-store")?)
}
"--apply-rumination" => apply_rumination = true,
"--profile" => profile = next_value(&mut args, "--profile")?,
"--scene-id" => scene_id = next_value(&mut args, "--scene-id")?,
@ -219,6 +223,7 @@ fn main() -> Result<()> {
source_scene_ref,
defer_completion,
agent_store: agent_store.clone(),
resident_self_store: resident_self_store.clone(),
},
)?;
if apply_rumination {
@ -288,6 +293,7 @@ fn main() -> Result<()> {
schedule_id,
source_scene_ref,
agent_store,
resident_self_store,
},
)?;
println!("{}", result);
@ -638,6 +644,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
source_scene_ref: "smoke/coordinator".to_string(),
defer_completion: true,
agent_store: Some(temp_agent_store.clone()),
resident_self_store: None,
},
)?;
let blocked_repeat = tick_heartbeat_store(
@ -652,6 +659,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
source_scene_ref: "smoke/coordinator".to_string(),
defer_completion: true,
agent_store: Some(temp_agent_store.clone()),
resident_self_store: None,
},
)
.err()
@ -681,6 +689,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
source_scene_ref: "smoke/idle".to_string(),
defer_completion: false,
agent_store: Some(temp_agent_store.clone()),
resident_self_store: None,
},
)?;
@ -732,6 +741,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
schedule_id: "smoke-relaxed-pump".to_string(),
source_scene_ref: "smoke/relaxed".to_string(),
agent_store: Some(temp_agent_store.clone()),
resident_self_store: None,
},
)?;
let alarmed_store_path = temp_dir.join("alarmed-heartbeats.msgpack");
@ -752,6 +762,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
schedule_id: "smoke-alarmed-pump".to_string(),
source_scene_ref: "smoke/alarmed".to_string(),
agent_store: Some(temp_agent_store.clone()),
resident_self_store: None,
},
)?;
let stale_store_path = temp_dir.join("stale-heartbeats.msgpack");
@ -768,6 +779,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
source_scene_ref: "smoke/stale".to_string(),
defer_completion: true,
agent_store: Some(temp_agent_store.clone()),
resident_self_store: None,
},
)?;
let stale_repair = recover_stale_heartbeat_store(
@ -791,6 +803,7 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
source_scene_ref: "smoke/stale".to_string(),
defer_completion: true,
agent_store: Some(temp_agent_store.clone()),
resident_self_store: None,
},
)?;
let initiative_errors = validate_schedule_shape(&work["schedule"])

View file

@ -29,6 +29,9 @@ use epiphany_core::put_substrate_gate_repo_access_grant_receipt;
use epiphany_core::runtime_spine_status;
use epiphany_core::select_and_commit_repo_frontier_route;
use epiphany_core::substrate_gate_coordinator_implementation_grant;
use epiphany_core::{
LaunchedCoordinator, capture_process_instance, claim_resident_self_preparation_as_child,
};
use serde_json::Value;
use serde_json::json;
use std::collections::BTreeMap;
@ -86,6 +89,9 @@ struct Args {
supersede_failed_results: bool,
auto_tools: bool,
proposal_modeling_request_id: Option<String>,
resident_binding: BTreeMap<String, String>,
resident_state_store: Option<PathBuf>,
resident_preparation_id: Option<String>,
}
impl Args {
@ -119,6 +125,9 @@ impl Args {
supersede_failed_results: false,
auto_tools: true,
proposal_modeling_request_id: None,
resident_binding: BTreeMap::new(),
resident_state_store: None,
resident_preparation_id: None,
};
while let Some(arg) = args.next() {
match arg.as_str() {
@ -143,6 +152,27 @@ impl Args {
parsed.proposal_modeling_request_id =
Some(take_string(&mut args, "--proposal-modeling-request-id")?);
}
flag @ ("--resident-grant-id"
| "--resident-launch-digest"
| "--resident-policy-digest"
| "--resident-argv-digest"
| "--resident-objective-digest"
| "--resident-release-commit"
| "--resident-release-manifest-digest"
| "--resident-executable-digest") => {
parsed.resident_binding.insert(
flag.trim_start_matches("--resident-").to_string(),
take_string(&mut args, flag)?,
);
}
"--resident-state-store" => {
parsed.resident_state_store =
Some(take_path(&mut args, "--resident-state-store")?)
}
"--resident-preparation-id" => {
parsed.resident_preparation_id =
Some(take_string(&mut args, "--resident-preparation-id")?)
}
"--cwd" => parsed.cwd = take_path(&mut args, "--cwd")?,
"--codex-home" => parsed.codex_home = take_path(&mut args, "--codex-home")?,
"--artifact-dir" => parsed.artifact_dir = take_path(&mut args, "--artifact-dir")?,
@ -190,6 +220,27 @@ impl Args {
fn run_coordinator(args: &Args) -> Result<Value> {
let root = env::current_dir().context("failed to resolve current dir")?;
match (&args.resident_state_store, &args.resident_preparation_id) {
(Some(store), Some(preparation_id)) => {
let identity = capture_process_instance(std::process::id())?;
claim_resident_self_preparation_as_child(
store,
preparation_id,
&LaunchedCoordinator {
process_id: identity.process_id,
process_creation_token: identity.creation_token,
process_executable_path: identity.executable_path,
},
chrono::Utc::now().timestamp_millis().max(0) as u64,
)?;
}
(None, None) => {}
_ => {
return Err(anyhow!(
"resident coordinator bootstrap requires both state store and preparation id"
));
}
}
let local_verse_store = status_cli::absolute_path(&args.local_verse_store)?;
assert_local_verse_brake_released(&local_verse_store, "epiphany-mvp-coordinator")?;
let cwd = status_cli::absolute_path(&args.cwd)?;
@ -659,6 +710,17 @@ fn run_coordinator(args: &Args) -> Result<Value> {
),
("autoTools".to_string(), args.auto_tools.to_string()),
]),
resident_grant_id: args.resident_binding.get("grant-id").cloned(),
resident_launch_digest: args.resident_binding.get("launch-digest").cloned(),
resident_policy_digest: args.resident_binding.get("policy-digest").cloned(),
resident_argv_digest: args.resident_binding.get("argv-digest").cloned(),
resident_objective_digest: args.resident_binding.get("objective-digest").cloned(),
resident_release_commit: args.resident_binding.get("release-commit").cloned(),
resident_release_manifest_digest: args
.resident_binding
.get("release-manifest-digest")
.cloned(),
resident_executable_digest: args.resident_binding.get("executable-digest").cloned(),
};
put_coordinator_run_receipt(&runtime_store, &coordinator_run_receipt)?;
let summary = json!({

View file

@ -50,7 +50,6 @@ fn main() -> Result<()> {
store: &store,
runtime_id: &runtime,
target_triple: &target,
toolchain_fingerprint: &rustc,
})?;
let witness_sha256 = epiphany_packaged_release_witness_sha256(&witness)?;
println!(

File diff suppressed because it is too large Load diff

View file

@ -37,9 +37,11 @@ use heartbeat_roles::display_name_for_role;
pub use heartbeat_roles::ghostlight_scene_heartbeat_state;
pub use heartbeat_roles::initialize_ghostlight_scene_heartbeat_store;
pub use heartbeat_roles::initialize_heartbeat_store;
pub use heartbeat_store::commit_heartbeat_state_transaction;
pub use heartbeat_store::heartbeat_state_cache;
pub use heartbeat_store::load_heartbeat_cognition_entry;
pub use heartbeat_store::load_heartbeat_state_entry;
pub use heartbeat_store::load_heartbeat_state_transaction;
pub use heartbeat_store::load_latest_heartbeat_stale_turn_repair_receipt;
pub use heartbeat_store::validate_heartbeat_cognition;
pub use heartbeat_store::validate_heartbeat_state;
@ -178,8 +180,14 @@ pub fn tick_heartbeat_store(
options: HeartbeatTickOptions,
) -> Result<Value> {
let store_path = store_path.as_ref();
let mut state = load_heartbeat_state_entry(store_path)?
.unwrap_or_else(|| default_heartbeat_state(options.target_heartbeat_rate));
if options.resident_self_store.as_deref() == Some(store_path) {
return Err(anyhow!(
"heartbeat and resident Self require physically separate CultCache stores"
));
}
let (loaded_state, expected_state) = load_heartbeat_state_transaction(store_path)?;
let mut state =
loaded_state.unwrap_or_else(|| default_heartbeat_state(options.target_heartbeat_rate));
if options.target_heartbeat_rate > 0.0 {
state.target_heartbeat_rate = options.target_heartbeat_rate;
}
@ -194,8 +202,74 @@ pub fn tick_heartbeat_store(
apply_mood_timing_from_appraisals(&mut state, &appraisals);
}
apply_initiative_heat_policy(&mut state);
let result = tick_once(&mut state, &options)?;
write_heartbeat_state_entry(store_path, &state)?;
if let Some(resident_store) = options.resident_self_store.as_deref()
&& crate::pending_resident_self_pressure(resident_store)?
&& let Some(pending) = state
.participants
.iter()
.find(|participant| participant.role_id == "coordinator")
.and_then(|participant| participant.pending_turn.as_ref())
{
crate::heartbeat_issue_resident_self_grant(
resident_store,
&pending.schedule_id,
&pending.action_id,
Utc::now().timestamp_millis().max(0) as u64,
)?;
}
let mut resident_ack_to_consume = None;
if let Some(resident_store) = options.resident_self_store.as_deref()
&& let Some(pending) = state
.participants
.iter()
.find(|participant| participant.role_id == "coordinator")
.and_then(|participant| participant.pending_turn.as_ref())
&& let Some(ack) = crate::pending_resident_self_ack_for(
resident_store,
&pending.schedule_id,
&pending.action_id,
)?
{
let index = participant_index_by_role(&state, "coordinator")?;
complete_pending_turn(&mut state, index)?;
resident_ack_to_consume = Some((resident_store.to_path_buf(), ack.ack_id));
}
let mut effective_options = options.clone();
if let Some(resident_store) = options.resident_self_store.as_deref()
&& crate::pending_resident_self_pressure(resident_store)?
{
effective_options.coordinator_action = Some("resident-self-pressure".to_string());
effective_options.target_role = Some("coordinator".to_string());
effective_options.defer_completion = true;
}
let result = tick_once(&mut state, &effective_options)?;
commit_heartbeat_state_transaction(store_path, expected_state, &state)?;
if result["event"]["selectedRole"] == "coordinator"
&& effective_options.defer_completion
&& let Some(resident_store) = effective_options.resident_self_store.as_deref()
{
let schedule_id = result["event"]["schedule_id"]
.as_str()
.or_else(|| result["event"]["scheduleId"].as_str())
.unwrap_or(&effective_options.schedule_id);
let action_id = result["event"]["action_id"]
.as_str()
.or_else(|| result["event"]["actionId"].as_str())
.unwrap_or_default();
crate::heartbeat_issue_resident_self_grant(
resident_store,
schedule_id,
action_id,
Utc::now().timestamp_millis().max(0) as u64,
)?;
}
if let Some((resident_store, ack_id)) = resident_ack_to_consume {
crate::heartbeat_consume_resident_self_ack(
&resident_store,
&ack_id,
Utc::now().timestamp_millis().max(0) as u64,
)?;
}
let artifact_dir = artifact_dir.as_ref();
fs::create_dir_all(artifact_dir)
@ -226,6 +300,51 @@ pub fn pump_heartbeat_store(
options: HeartbeatPumpOptions,
) -> Result<Value> {
let store_path = store_path.as_ref();
if let Some(resident_store) = options.resident_self_store.as_deref() {
let heartbeat = load_heartbeat_state_entry(store_path)?;
let pending_ack = if let Some(pending) = heartbeat
.as_ref()
.and_then(|state| {
state
.participants
.iter()
.find(|p| p.role_id == "coordinator")
})
.and_then(|p| p.pending_turn.as_ref())
{
crate::pending_resident_self_ack_for(
resident_store,
&pending.schedule_id,
&pending.action_id,
)?
.is_some()
} else {
false
};
if crate::pending_resident_self_pressure(resident_store)? || pending_ack {
let tick = tick_heartbeat_store(
store_path,
artifact_dir.as_ref(),
HeartbeatTickOptions {
target_heartbeat_rate: options.base_heartbeat_rate.max(0.001),
coordinator_action: None,
target_role: None,
urgency: options.external_urgency,
schedule_id: format!("{}.resident-self", options.schedule_id),
source_scene_ref: options.source_scene_ref.clone(),
defer_completion: true,
agent_store: options.agent_store.clone(),
resident_self_store: Some(resident_store.to_path_buf()),
},
)?;
return Ok(serde_json::json!({
"schema_version": "epiphany.adaptive_heartbeat_pump.v0", "storeFile": store_path,
"artifactDir": artifact_dir.as_ref(), "sourceSceneRef": options.source_scene_ref,
"scheduleId": options.schedule_id, "launched": 1, "ticks": [tick],
"residentSelfDelegatedToTransactionalTick": true, "errors": []
}));
}
}
let mut state = load_heartbeat_state_entry(store_path)?
.unwrap_or_else(|| default_heartbeat_state(options.base_heartbeat_rate.max(0.001)));
if options.base_heartbeat_rate > 0.0 {
@ -283,6 +402,7 @@ pub fn pump_heartbeat_store(
source_scene_ref: options.source_scene_ref.clone(),
defer_completion: true,
agent_store: options.agent_store.clone(),
resident_self_store: options.resident_self_store.clone(),
};
match tick_once(&mut state, &tick_options) {
Ok(result) => {
@ -3548,6 +3668,7 @@ mod tests {
source_scene_ref: "test/native".to_string(),
defer_completion: true,
agent_store: None,
resident_self_store: None,
},
)?;
assert_eq!(work["event"]["selectedRole"], "implementation");
@ -3579,6 +3700,7 @@ mod tests {
source_scene_ref: "test/native".to_string(),
defer_completion: false,
agent_store: None,
resident_self_store: None,
},
)
.unwrap_err();
@ -3637,6 +3759,7 @@ mod tests {
source_scene_ref: "test/high-heat".to_string(),
defer_completion: true,
agent_store: None,
resident_self_store: None,
},
)?;
assert_eq!(
@ -3669,6 +3792,7 @@ mod tests {
source_scene_ref: "test/high-heat".to_string(),
defer_completion: true,
agent_store: None,
resident_self_store: None,
},
)
.unwrap_err();
@ -3698,6 +3822,7 @@ mod tests {
source_scene_ref: "test/stale".to_string(),
defer_completion: true,
agent_store: None,
resident_self_store: None,
},
)?;
let mut state = load_heartbeat_state_entry(&store_path)?.expect("heartbeat state");
@ -3752,6 +3877,7 @@ mod tests {
source_scene_ref: "test/stale".to_string(),
defer_completion: true,
agent_store: None,
resident_self_store: None,
},
)?;
assert_eq!(next["event"]["selectedRole"], "implementation");
@ -3800,6 +3926,7 @@ mod tests {
source_scene_ref: "ghostlight/pallas-training-loop-v0".to_string(),
defer_completion: true,
agent_store: None,
resident_self_store: None,
},
)?;
@ -3850,6 +3977,7 @@ mod tests {
source_scene_ref: "test/Persona-mentioned".to_string(),
defer_completion: true,
agent_store: None,
resident_self_store: None,
},
)?;
@ -3908,6 +4036,7 @@ mod tests {
source_scene_ref: "test/Persona-mentioned-memory".to_string(),
defer_completion: true,
agent_store: Some(agent_store),
resident_self_store: None,
},
)?;

View file

@ -862,6 +862,7 @@ pub struct HeartbeatTickOptions {
pub source_scene_ref: String,
pub defer_completion: bool,
pub agent_store: Option<std::path::PathBuf>,
pub resident_self_store: Option<std::path::PathBuf>,
}
#[derive(Clone, Debug, PartialEq)]
@ -878,6 +879,7 @@ pub struct HeartbeatPumpOptions {
pub schedule_id: String,
pub source_scene_ref: String,
pub agent_store: Option<std::path::PathBuf>,
pub resident_self_store: Option<std::path::PathBuf>,
}
#[derive(Clone, Debug, PartialEq)]

View file

@ -17,8 +17,8 @@ use super::participant_arena;
use super::participant_kind;
use anyhow::Result;
use anyhow::anyhow;
use cultcache_rs::CultCache;
use cultcache_rs::SingleFileMessagePackBackingStore;
use cultcache_rs::{CultCache, CultCacheEnvelope, DatabaseEntry};
use serde_json::Value;
use std::path::Path;
@ -58,6 +58,44 @@ pub fn write_heartbeat_state_entry(
cache.put(HEARTBEAT_STATE_KEY, state)
}
pub fn load_heartbeat_state_transaction(
store_path: impl AsRef<Path>,
) -> Result<(
Option<EpiphanyHeartbeatStateEntry>,
Option<CultCacheEnvelope>,
)> {
let cache = heartbeat_state_cache(store_path)?;
let envelope = cache.snapshot_envelopes().into_iter().find(|entry| {
entry.r#type == <EpiphanyHeartbeatStateEntry as DatabaseEntry>::TYPE
&& entry.key == HEARTBEAT_STATE_KEY
});
Ok((
cache.get::<EpiphanyHeartbeatStateEntry>(HEARTBEAT_STATE_KEY)?,
envelope,
))
}
pub fn commit_heartbeat_state_transaction(
store_path: impl AsRef<Path>,
expected: Option<CultCacheEnvelope>,
state: &EpiphanyHeartbeatStateEntry,
) -> Result<()> {
validate_heartbeat_state(state)?;
let cache = heartbeat_state_cache(store_path.as_ref())?;
let (replacement, _) = cache.prepare_entry(HEARTBEAT_STATE_KEY, state)?;
let backing = SingleFileMessagePackBackingStore::new(store_path.as_ref());
let committed = match expected {
Some(expected) => backing.compare_and_swap_entry(&expected, replacement)?,
None => backing.insert_entry_if_absent(replacement)?,
};
if !committed {
return Err(anyhow!(
"heartbeat state lost exact atomic compare-and-swap"
));
}
Ok(())
}
pub fn load_heartbeat_cognition_entry(
store_path: impl AsRef<Path>,
) -> Result<Option<EpiphanyHeartbeatCognitionEntry>> {

View file

@ -30,6 +30,7 @@ mod proposal;
mod repo_model_gateway;
mod repository_body_observer;
mod repository_readiness;
mod resident_self;
mod runtime_spine;
mod semantic_backend;
mod semantic_projector_service;
@ -852,6 +853,7 @@ pub use process_observation::native_boot_identity;
pub use process_observation::native_process_executable_path;
pub use process_observation::observe_native_process;
pub use process_observation::observe_process_instance;
pub use process_observation::terminate_process_instance;
pub use promotion::EpiphanyPromotionDecision;
pub use promotion::EpiphanyPromotionInput;
pub use promotion::EpiphanyStateReplacementValidationInput;
@ -865,6 +867,7 @@ pub use proposal::propose_map_update;
pub use repo_model_gateway::*;
pub use repository_body_observer::*;
pub use repository_readiness::*;
pub use resident_self::*;
pub use runtime_spine::COORDINATOR_RUN_RECEIPT_SCHEMA_VERSION;
pub use runtime_spine::COORDINATOR_RUN_RECEIPT_TYPE;
pub use runtime_spine::EpiphanyCoordinatorRunReceipt;
@ -923,6 +926,7 @@ pub use runtime_spine::commit_repo_model_admission;
pub use runtime_spine::commit_repo_model_claim_challenge;
pub use runtime_spine::commit_repo_model_claim_repair_request;
pub use runtime_spine::complete_runtime_job;
pub use runtime_spine::coordinator_run_receipts;
pub use runtime_spine::create_runtime_job;
pub use runtime_spine::create_runtime_session;
pub use runtime_spine::ensure_runtime_repo_model;

View file

@ -3,7 +3,7 @@ use anyhow::{Context, Result, anyhow, bail};
use chrono::{DateTime, Utc};
use cultcache_rs::{DatabaseEntry, SingleFileMessagePackBackingStore};
use sha2::{Digest, Sha256};
use std::collections::BTreeSet;
use std::collections::{BTreeMap, BTreeSet};
use std::fs;
use std::path::{Path, PathBuf};
use uuid::Uuid;
@ -76,104 +76,85 @@ pub struct PackageReleaseRequest<'a> {
pub store: &'a Path,
pub runtime_id: &'a str,
pub target_triple: &'a str,
pub toolchain_fingerprint: &'a str,
}
pub fn required_packaged_release_binaries() -> Vec<(&'static str, &'static str)> {
pub fn required_packaged_release_binaries(target_triple: &str) -> Vec<(&'static str, String)> {
let file_name = |name: &str| target_binary_file_name(target_triple, name);
vec![
(
"supervisor",
if cfg!(windows) {
"epiphany-daemon-supervisor.exe"
} else {
"epiphany-daemon-supervisor"
},
),
("supervisor", file_name("epiphany-daemon-supervisor")),
(
"semantic-projector",
if cfg!(windows) {
"epiphany-memory-semantic-projector.exe"
} else {
"epiphany-memory-semantic-projector"
},
file_name("epiphany-memory-semantic-projector"),
),
(
"workspace-coverage-projector",
if cfg!(windows) {
"epiphany-workspace-coverage-projector.exe"
} else {
"epiphany-workspace-coverage-projector"
},
file_name("epiphany-workspace-coverage-projector"),
),
("semantic-query", file_name("epiphany-memory-semantic")),
("verse-query", file_name("epiphany-verse-query")),
("repository-body", file_name("epiphany-repository-body")),
("host-identity", file_name("epiphany-host-identity")),
("swarm", file_name("epiphany-swarm")),
("coordinator", file_name("epiphany-mvp-coordinator")),
("model-runtime", file_name("epiphany-model-runtime")),
(
"semantic-query",
if cfg!(windows) {
"epiphany-memory-semantic.exe"
} else {
"epiphany-memory-semantic"
},
),
(
"verse-query",
if cfg!(windows) {
"epiphany-verse-query.exe"
} else {
"epiphany-verse-query"
},
),
(
"repository-body",
if cfg!(windows) {
"epiphany-repository-body.exe"
} else {
"epiphany-repository-body"
},
),
(
"host-identity",
if cfg!(windows) {
"epiphany-host-identity.exe"
} else {
"epiphany-host-identity"
},
"tool-codex-mcp-spine",
file_name("epiphany-tool-codex-mcp-spine"),
),
]
}
fn target_binary_file_name(target_triple: &str, binary: &str) -> String {
if target_triple
.split('-')
.any(|component| component == "windows")
{
format!("{binary}.exe")
} else {
binary.to_string()
}
}
pub fn package_and_publish_epiphany_release(
request: PackageReleaseRequest<'_>,
) -> Result<EpiphanyPackagedReleaseEntry> {
let (source_commit_sha, source_commit_time) = clean_source_commit(request.repo)?;
require_nonempty("runtime id", request.runtime_id)?;
require_nonempty("target triple", request.target_triple)?;
require_nonempty("toolchain fingerprint", request.toolchain_fingerprint)?;
let toolchain = installed_toolchain()?;
fs::create_dir_all(request.destination)?;
let destination = canonical_path(request.destination)?;
let source_root = short_temporary_path("ep-src");
let source_guard = GitWorktreeGuard::create(request.repo, &source_root, &source_commit_sha)?;
let build_root = short_temporary_path("ep-build");
let _build_guard = DirectoryCleanup(build_root.clone());
build_required_release_siblings(&source_guard.path, &build_root, request.target_triple)?;
let built_dir = build_root.join(request.target_triple).join("release");
let built_binaries = build_required_release_siblings(
&source_guard.path,
&build_root,
request.target_triple,
&toolchain.cargo,
)?;
let staging = destination.join(format!(".staging-{}", Uuid::new_v4()));
fs::create_dir(&staging)?;
let result = (|| {
let mut binaries = Vec::new();
for (role, file_name) in required_packaged_release_binaries() {
let source = built_dir.join(file_name);
for (role, file_name) in required_packaged_release_binaries(request.target_triple) {
let source = built_binaries
.get(role)
.with_context(|| format!("required packaged sibling was not built: {role}"))?;
if !source.is_file() {
bail!("required packaged sibling is absent: {}", source.display());
}
let target = staging.join(file_name);
let target = staging.join(&file_name);
fs::copy(&source, &target)?;
binaries.push(binary_record(role, file_name, &target)?);
binaries.push(binary_record(role, &file_name, &target)?);
}
binaries.sort_by(|left, right| left.role.cmp(&right.role));
let release_id = release_id(
request.runtime_id,
&source_commit_sha,
request.target_triple,
request.toolchain_fingerprint,
&toolchain.fingerprint,
&binaries,
);
let final_root = destination.join(&source_commit_sha).join(&release_id);
@ -188,7 +169,7 @@ pub fn package_and_publish_epiphany_release(
source_commit_sha,
target_triple: request.target_triple.into(),
cargo_profile: "release".into(),
toolchain_fingerprint: request.toolchain_fingerprint.into(),
toolchain_fingerprint: toolchain.fingerprint,
created_at_utc: source_commit_time,
package_root: final_root.display().to_string(),
binaries,
@ -291,47 +272,79 @@ impl Drop for GitWorktreeGuard {
}
}
fn build_required_release_siblings(repo: &Path, target_dir: &Path, target: &str) -> Result<()> {
let manifest = repo.join("epiphany-core").join("Cargo.toml");
if !manifest.is_file() {
bail!(
"Epiphany release manifest is absent: {}",
manifest.display()
);
fn build_required_release_siblings(
repo: &Path,
target_root: &Path,
target: &str,
cargo: &std::ffi::OsStr,
) -> Result<BTreeMap<&'static str, PathBuf>> {
let mut manifests = BTreeSet::new();
for (role, _) in required_packaged_release_binaries(target) {
manifests.insert(required_release_build_target(role)?.0);
}
let mut command = std::process::Command::new("cargo");
command
.arg("build")
.arg("--release")
.arg("--manifest-path")
.arg(&manifest)
.arg("--target-dir")
.arg(target_dir)
.arg("--target")
.arg(target);
command.arg("--locked");
for (role, _) in required_packaged_release_binaries() {
let binary = required_release_binary(role)?;
command.arg("--bin").arg(binary);
let mut outputs = BTreeMap::new();
for manifest_dir in manifests {
let manifest = repo.join(manifest_dir).join("Cargo.toml");
if !manifest.is_file() {
bail!(
"Epiphany release manifest is absent: {}",
manifest.display()
);
}
let target_dir = release_manifest_target_dir(target_root, manifest_dir);
let mut command = std::process::Command::new(cargo);
command
.arg("build")
.arg("--release")
.arg("--manifest-path")
.arg(&manifest)
.arg("--target-dir")
.arg(&target_dir)
.arg("--target")
.arg(target)
.arg("--locked");
for (role, file_name) in required_packaged_release_binaries(target) {
let (owner, binary) = required_release_build_target(role)?;
if owner == manifest_dir {
command.arg("--bin").arg(binary);
outputs.insert(
role,
target_dir.join(target).join("release").join(file_name),
);
}
}
let status = command
.status()
.with_context(|| format!("failed to start {manifest_dir} release build"))?;
if !status.success() {
bail!("owned Epiphany release build failed for {manifest_dir}");
}
}
let status = command
.status()
.context("failed to start owned release build")?;
if !status.success() {
bail!("owned Epiphany release build failed");
}
Ok(())
Ok(outputs)
}
fn required_release_binary(role: &str) -> Result<&'static str> {
fn release_manifest_target_dir(target_root: &Path, manifest_dir: &str) -> PathBuf {
target_root.join(manifest_dir)
}
fn required_release_build_target(role: &str) -> Result<(&'static str, &'static str)> {
match role {
"supervisor" => Ok("epiphany-daemon-supervisor"),
"semantic-projector" => Ok("epiphany-memory-semantic-projector"),
"workspace-coverage-projector" => Ok("epiphany-workspace-coverage-projector"),
"semantic-query" => Ok("epiphany-memory-semantic"),
"verse-query" => Ok("epiphany-verse-query"),
"repository-body" => Ok("epiphany-repository-body"),
"host-identity" => Ok("epiphany-host-identity"),
"supervisor" => Ok(("epiphany-core", "epiphany-daemon-supervisor")),
"semantic-projector" => Ok(("epiphany-core", "epiphany-memory-semantic-projector")),
"workspace-coverage-projector" => {
Ok(("epiphany-core", "epiphany-workspace-coverage-projector"))
}
"semantic-query" => Ok(("epiphany-core", "epiphany-memory-semantic")),
"verse-query" => Ok(("epiphany-core", "epiphany-verse-query")),
"repository-body" => Ok(("epiphany-core", "epiphany-repository-body")),
"host-identity" => Ok(("epiphany-core", "epiphany-host-identity")),
"swarm" => Ok(("epiphany-core", "epiphany-swarm")),
"coordinator" => Ok(("epiphany-core", "epiphany-mvp-coordinator")),
"model-runtime" => Ok(("epiphany-openai-runtime", "epiphany-model-runtime")),
"tool-codex-mcp-spine" => Ok((
"epiphany-tool-codex-mcp-spine",
"epiphany-tool-codex-mcp-spine",
)),
_ => bail!("unknown required release role {role}"),
}
}
@ -355,7 +368,7 @@ pub fn validate_epiphany_packaged_release(entry: &EpiphanyPackagedReleaseEntry)
if !root.is_absolute() {
bail!("packaged release root must be absolute");
}
let required = required_packaged_release_binaries();
let required = required_packaged_release_binaries(&entry.target_triple);
if entry.binaries.len() != required.len() {
bail!("packaged release sibling set is incomplete");
}
@ -556,6 +569,39 @@ fn git(repo: &Path, args: &[&str]) -> Result<String> {
Ok(String::from_utf8(output.stdout)?.trim().to_string())
}
struct InstalledToolchain {
cargo: std::ffi::OsString,
fingerprint: String,
}
fn installed_toolchain() -> Result<InstalledToolchain> {
let cargo = std::env::var_os("CARGO").unwrap_or_else(|| "cargo".into());
let rustc = std::env::var_os("RUSTC").unwrap_or_else(|| "rustc".into());
let cargo_version = command_version(&cargo, "cargo")?;
let rustc_version = command_version(&rustc, "rustc")?;
Ok(InstalledToolchain {
cargo: cargo.clone(),
fingerprint: format!(
"cargo-command={}\ncargo-vV:\n{}\nrustc-command={}\nrustc-vV:\n{}",
Path::new(&cargo).display(),
cargo_version,
Path::new(&rustc).display(),
rustc_version
),
})
}
fn command_version(command: &std::ffi::OsStr, label: &str) -> Result<String> {
let output = std::process::Command::new(command).arg("-vV").output()?;
if !output.status.success() {
bail!(
"{label} -vV failed: {}",
String::from_utf8_lossy(&output.stderr)
);
}
Ok(String::from_utf8(output.stdout)?.trim().to_string())
}
fn binary_record(
role: &str,
file_name: &str,
@ -662,20 +708,78 @@ mod tests {
#[test]
fn every_required_release_role_has_a_build_target() {
for (role, _) in required_packaged_release_binaries() {
required_release_binary(role).expect("required release role must resolve");
for (role, _) in required_packaged_release_binaries("x86_64-unknown-linux-gnu") {
required_release_build_target(role).expect("required release role must resolve");
}
}
#[test]
fn binary_suffix_follows_requested_target_not_packager_host() {
let windows = required_packaged_release_binaries("x86_64-pc-windows-msvc");
assert!(windows.iter().all(|(_, name)| name.ends_with(".exe")));
let linux = required_packaged_release_binaries("x86_64-unknown-linux-gnu");
assert!(linux.iter().all(|(_, name)| !name.ends_with(".exe")));
}
#[test]
fn owning_manifests_have_isolated_build_roots() {
let root = Path::new("isolated-release-build");
let core = release_manifest_target_dir(root, "epiphany-core");
let model = release_manifest_target_dir(root, "epiphany-openai-runtime");
let tools = release_manifest_target_dir(root, "epiphany-tool-codex-mcp-spine");
assert_ne!(core, model);
assert_ne!(core, tools);
assert_ne!(model, tools);
assert!(core.starts_with(root) && model.starts_with(root) && tools.starts_with(root));
}
#[test]
fn resident_cognition_roles_keep_their_owning_manifests() {
let packaged_roles = required_packaged_release_binaries("x86_64-unknown-linux-gnu")
.into_iter()
.map(|(role, _)| role)
.collect::<BTreeSet<_>>();
for role in [
"swarm",
"coordinator",
"model-runtime",
"tool-codex-mcp-spine",
] {
assert!(packaged_roles.contains(role), "release omits {role}");
}
assert_eq!(
required_release_build_target("swarm").unwrap(),
("epiphany-core", "epiphany-swarm")
);
assert_eq!(
required_release_build_target("coordinator").unwrap(),
("epiphany-core", "epiphany-mvp-coordinator")
);
assert_eq!(
required_release_build_target("model-runtime").unwrap(),
("epiphany-openai-runtime", "epiphany-model-runtime")
);
assert_eq!(
required_release_build_target("tool-codex-mcp-spine").unwrap(),
(
"epiphany-tool-codex-mcp-spine",
"epiphany-tool-codex-mcp-spine"
)
);
}
fn fixture() -> (TempDir, EpiphanyPackagedReleaseEntry) {
let dir = TempDir::new().unwrap();
let root = dir.path().join("release");
fs::create_dir(&root).unwrap();
let mut binaries = Vec::new();
for (index, (role, name)) in required_packaged_release_binaries().into_iter().enumerate() {
let path = root.join(name);
for (index, (role, name)) in required_packaged_release_binaries("x86_64-unknown-linux-gnu")
.into_iter()
.enumerate()
{
let path = root.join(&name);
fs::write(&path, format!("binary-{index}")).unwrap();
binaries.push(binary_record(role, name, &path).unwrap());
binaries.push(binary_record(role, &name, &path).unwrap());
}
binaries.sort_by(|a, b| a.role.cmp(&b.role));
let id = release_id("runtime", &"a".repeat(40), "target", "rustc", &binaries);
@ -721,6 +825,23 @@ mod tests {
assert!(validate_epiphany_packaged_release(&e).is_err());
}
#[test]
fn missing_resident_cognition_binary_is_rejected() {
let (_d, mut e) = fixture();
e.binaries.retain(|binary| binary.role != "model-runtime");
assert!(validate_epiphany_packaged_release(&e).is_err());
}
#[test]
fn substituted_resident_cognition_binary_is_rejected() {
let (_d, mut e) = fixture();
let model = e
.binaries
.iter_mut()
.find(|binary| binary.role == "model-runtime")
.unwrap();
model.file_name = "epiphany-openai-runtime".into();
assert!(validate_epiphany_packaged_release(&e).is_err());
}
#[test]
fn counterfeit_release_id_is_rejected() {
let (_d, mut e) = fixture();
e.release_id = format!("sha256-{}", "0".repeat(64));

View file

@ -58,6 +58,13 @@ pub fn observe_process_instance(expected: &ProcessInstanceIdentity) -> ProcessIn
platform::observe(expected)
}
pub fn terminate_process_instance(expected: &ProcessInstanceIdentity) -> Result<()> {
if observe_process_instance(expected) != ProcessInstanceObservation::ExactAlive {
bail!("refusing to terminate a process whose exact incarnation is not proven alive");
}
platform::terminate(expected)
}
/// Returns a boot-incarnation token only when the platform can prove it.
pub fn native_boot_identity() -> Option<String> {
platform::boot_identity()
@ -96,7 +103,7 @@ mod platform {
};
use windows_sys::Win32::System::Threading::{
GetExitCodeProcess, GetProcessTimes, OpenProcess, PROCESS_QUERY_LIMITED_INFORMATION,
QueryFullProcessImageNameW, WaitForSingleObject,
PROCESS_TERMINATE, QueryFullProcessImageNameW, TerminateProcess, WaitForSingleObject,
};
#[repr(C)]
@ -287,6 +294,28 @@ mod platform {
}
}
pub(super) fn terminate(expected: &ProcessInstanceIdentity) -> Result<()> {
let raw = unsafe {
OpenProcess(
PROCESS_TERMINATE | PROCESS_QUERY_LIMITED_INFORMATION,
0,
expected.process_id,
)
};
if raw.is_null() {
bail!("failed to open exact process for termination");
}
let handle = OwnedHandle(raw);
if identity_from_handle(expected.process_id, &handle)? != *expected {
bail!("process incarnation changed before termination actuator acquired its handle");
}
let ok = unsafe { TerminateProcess(handle.0, 1) };
if ok == 0 {
bail!("failed to terminate exact process");
}
Ok(())
}
pub(super) fn boot_identity() -> Option<String> {
let mut information = SystemTimeOfDayInformation {
boot_time: 0,
@ -398,6 +427,42 @@ mod platform {
}
}
pub(super) fn terminate(expected: &ProcessInstanceIdentity) -> Result<()> {
#[cfg(target_os = "linux")]
{
let pidfd = unsafe {
libc::syscall(libc::SYS_pidfd_open, expected.process_id as i32, 0) as i32
};
if pidfd < 0 {
return Err(std::io::Error::last_os_error())
.context("pidfd_open exact coordinator");
}
if observe(expected) != ProcessInstanceObservation::ExactAlive {
unsafe { libc::close(pidfd) };
bail!("process incarnation changed before pidfd termination");
}
let result = unsafe {
libc::syscall(
libc::SYS_pidfd_send_signal,
pidfd,
libc::SIGTERM,
std::ptr::null::<libc::siginfo_t>(),
0,
)
};
unsafe { libc::close(pidfd) };
if result != 0 {
return Err(std::io::Error::last_os_error())
.context("pidfd_send_signal exact coordinator");
}
return Ok(());
}
#[cfg(not(target_os = "linux"))]
bail!(
"exact inherited process termination requires a native incarnation handle on this Unix platform"
)
}
pub(super) fn boot_identity() -> Option<String> {
std::fs::read_to_string("/proc/sys/kernel/random/boot_id")
.ok()
@ -426,6 +491,9 @@ mod platform {
.to_string(),
}
}
pub(super) fn terminate(_: &ProcessInstanceIdentity) -> Result<()> {
bail!("exact process termination is unsupported on this platform")
}
pub(super) fn boot_identity() -> Option<String> {
None
}

File diff suppressed because it is too large Load diff

View file

@ -603,6 +603,22 @@ pub struct EpiphanyCoordinatorRunReceipt {
pub sealed_artifact_refs: Vec<String>,
#[cultcache(key = 14, default)]
pub metadata: BTreeMap<String, String>,
#[cultcache(key = 15, default)]
pub resident_grant_id: Option<String>,
#[cultcache(key = 16, default)]
pub resident_launch_digest: Option<String>,
#[cultcache(key = 17, default)]
pub resident_policy_digest: Option<String>,
#[cultcache(key = 18, default)]
pub resident_argv_digest: Option<String>,
#[cultcache(key = 19, default)]
pub resident_objective_digest: Option<String>,
#[cultcache(key = 20, default)]
pub resident_release_commit: Option<String>,
#[cultcache(key = 21, default)]
pub resident_release_manifest_digest: Option<String>,
#[cultcache(key = 22, default)]
pub resident_executable_digest: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
@ -6255,6 +6271,15 @@ pub fn put_coordinator_run_receipt(
Ok(())
}
pub fn coordinator_run_receipts(
store_path: impl AsRef<Path>,
) -> Result<Vec<EpiphanyCoordinatorRunReceipt>> {
let mut cache = runtime_spine_cache(store_path)?;
cache.pull_all_backing_stores()?;
require_identity(&cache)?;
cache.get_all::<EpiphanyCoordinatorRunReceipt>()
}
pub fn complete_runtime_job(
store_path: impl AsRef<Path>,
options: RuntimeSpineJobResultOptions,
@ -10454,6 +10479,14 @@ pub(crate) mod tests {
artifact_refs: vec!["coordinator-summary.json".to_string()],
sealed_artifact_refs: vec!["epiphany-transcript.jsonl".to_string()],
metadata: BTreeMap::new(),
resident_grant_id: None,
resident_launch_digest: None,
resident_policy_digest: None,
resident_argv_digest: None,
resident_objective_digest: None,
resident_release_commit: None,
resident_release_manifest_digest: None,
resident_executable_digest: None,
},
)?;

8092
epiphany-openai-runtime/Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1709,11 +1709,13 @@ dependencies = [
"chrono",
"cultcache-rs-derive",
"fs2",
"redb",
"rmp-serde",
"serde",
"serde_bytes",
"serde_json",
"uuid",
"windows-sys 0.59.0",
]
[[package]]
@ -5433,6 +5435,15 @@ dependencies = [
"yasna",
]
[[package]]
name = "redb"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e925444704b5f17d32bf42f5b6e2df050bceebc3dcd6e71cc73dafe8092e839"
dependencies = [
"libc",
]
[[package]]
name = "redox_syscall"
version = "0.5.18"

View file

@ -1020,5 +1020,52 @@ signed ready heartbeat and commits failed history, epoch+1 successor, and an
immutable evidence-digest receipt in one Body CAS. PID reuse, access failure,
indeterminate observation, stale ready replay, and timeout remain inadmissible.
### Resident organizational Self
Resident wake scheduling has one owner. The standard heartbeat consumes one
pending typed pressure and atomically emits one single-consumption Self grant;
`epiphany-swarm` does not invent work from an idle loop. Accepted pressure is
bounded to operator objective, Body-map drift, Persona feedback, and
Imagination proposal documents. Those documents request attention only. They
cannot adopt Mind state, authorize Hands, publish a release, or deploy it.
Resident Self owns the grant-to-coordinator process transaction. Its inputs are
the authenticated packaged-release witness, separate resident/runtime/Verse/
Mind stores, the heartbeat grant, the swarm brake, and exact process
observations. It outputs an immutable preparation, child claim, exact active
turn lease, coordinator terminal receipt binding, and terminal acknowledgement
back to heartbeat. The active turn and cooldown are derived from that chain;
PID, exit code, journal output, and an unbound coordinator receipt are sight,
not completion authority.
Preparation and grant consumption share one CAS. The packaged coordinator must
claim the preparation before cognition, binding process id, creation token,
executable path and digest, grant, and launch digest. Resident Self then
acknowledges exactly that claim. Completion requires the same turn, grant,
launch digest, release identity, and coordinator receipt. Brake or timeout
drains the exact process and cannot silently abandon a live lease. A prepared
launch survives scheduler restart: an unclaimed preparation safely retries the
same grant and launch contract, while a claimed preparation reattaches only to
the exact process incarnation recorded by the packaged child before cognition.
Forbidden writers are the old source-tree/Cargo `epiphany-swarm` wrapper,
`epiphany-work` queue machinery, free-running heartbeat loops, Persona,
Imagination, Modeling, coordinator artifacts, process exit, systemd, and
presentation projections. Direct operator objectives and domain-derived
pressure use the same pressure -> heartbeat grant -> preparation -> child claim
-> lease -> exact receipt -> terminal acknowledgement path. The cut line removes
the former `online`, `run`, `run-queue`, and `pulse` authority and packages the
swarm, coordinator, model runtime, and tool spine as witnessed sibling binaries.
Verification belongs at the typed transition layer: CAS-loss and replay tests,
store-separation checks, packaged-witness authentication, brake/timeout process
timeline tests, child-claim-before-cognition proof, exact receipt substitution
rejection, and negative scans proving no runtime Cargo or historical queue path
survives. A nonblocking trust seam remains: the parent currently compares its
post-launch process observation with the child's atomic claim. The claim closes
child bootstrap authority, but a future hardening pass should replace parent
observation trust with an OS-authenticated parent/child launch channel where the
host supports one; it is not permission to accept PID-only identity.
This map must change when ownership changes. Historical scars belong in git,
evidence, or an explicitly archived note—not in the machine's Modeling state.

View file

@ -2444,6 +2444,58 @@ proposal -> explicit adoption/review -> Hands consequence -> Bifrost exact
release authority -> Idunn deployment receipt, plus the negative that
conversation alone cannot cross any later boundary.
Live observation on 2026-07-18 sharpened the deployment boundary. Exact release
`0601e280480cccc28209fbf0630e921f3ef9056d` kept its projector incarnation alive
and advanced the Qdrant workspace collection from 1,621 to 3,278 points after
the foreground Idunn deploy actuator was no longer present. `deployment.env`
remained absent and Idunn correctly raised `dependency-unavailable` because it
could not establish release freshness. A surviving candidate and advancing
checkpoint are resumable work evidence, not deployment admission. After the
provider reaches terminal projection, the same exact authorized release must
re-enter Idunn's deployment transaction and earn the typed deployment witness;
no observer, systemd state, Qdrant count, or journal line may synthesize it.
## Resident organizational Self ownership (2026-07-18)
The resident cognition cut now has a concrete authority boundary. Standard
heartbeat alone converts one pending typed pressure into one single-consumption
Self scheduling grant. Resident Self alone turns that grant into one exact
coordinator process lease. The coordinator, model runtime, and tool spine keep
their existing authorities; the resident scheduler does not absorb them.
Inputs are an authenticated packaged-release witness, physically separate
resident/runtime/Verse/Mind stores, the swarm brake, exact process observation,
and typed operator-objective, Body-map-drift, Persona-feedback, or
Imagination-proposal pressure. Outputs are immutable pressure/grant,
preparation, child-claim, active-lease, coordinator-receipt binding, and
heartbeat terminal-ack documents. Active status and cooldown are derived from
that chain. Process exit, logs, Persona speech, proposal text, systemd state,
Eve/Gjallar projection, and Qdrant progress are forbidden writers.
All wake sources share one path: pressure -> heartbeat grant -> prepared launch
-> packaged coordinator child claim before cognition -> exact process lease ->
bound coordinator terminal receipt -> terminal acknowledgement. Preparation
and grant consumption use one CAS; brake and timeout drain the exact observed
process; coordinator exit zero without its exact receipt fails. The old
source-tree/Cargo swarm wrapper and its `online`, `run`, `run-queue`, `pulse`,
and `epiphany-work` queue authority are outside the live body. Packaging now
requires witnessed sibling roles for swarm, coordinator, model runtime, and the
Codex MCP tool spine.
Verification must remain at these typed transitions: CAS/replay, store
separation, release witness, child-claim-before-cognition, exact process
identity, brake/timeout timelines, receipt substitution, and absence of runtime
Cargo/queue paths. One nonblocking hardening note remains: the parent currently
correlates its post-launch process observation with the child's atomic claim.
That is stronger than PID custody and fails closed, but it should eventually be
replaced by an OS-authenticated parent/child launch channel where available.
This is cognition bootstrap, not deployment admission. Ygg release
`0601e280480cccc28209fbf0630e921f3ef9056d` remains a live advancing candidate
until Idunn publishes the exact typed deployment witness; resident service
installation, writable domain custody, credentials, Persona/Discord ingress,
and the Starfire-offline rehearsal remain required.
The immediate live wound precedes that work. The workspace projector is the
lifetime owner of `workspace-coverage.cc`, but the supervisor currently opens
that private store to discover and perform recovery. Replace that transitive

Binary file not shown.

View file

@ -736,7 +736,8 @@ current_status:
- Workspace-coverage launch, heartbeat, and termination now serialize through one typed per-launch process-evidence head. Launch initializes generation 1 as `launched`; each signed heartbeat exact-CAS advances it to `heartbeat`; host-signed termination exact-CAS seals it as `terminated`. Termination v1 accepts exact launch plus enrolled host/boot/process proof before heartbeat sequence one and records heartbeat id/digest only when the head names current signed heartbeat evidence. A heartbeat cannot advance a terminated head. This removes the pre-readiness death strand without allowing heartbeat/termination split authority.
- The feature-gated native `epiphany-workspace-coverage-recovery-smoke` proves the real packaged supervisor/projector boundary in GUID-scoped repo/runtime/Body/Verse state. It warms local Ollama, derives only its exact fenced Qdrant collection names, publishes reserved policy, launches the initial child through fixed bootstrap, observes epoch 1 claim, kills only after exact native launch-incarnation revalidation, invokes Idunn reconcile, authenticates epoch 2 successor authority plus the immutable recovery receipt through freshly reopened stores, kills the replacement under the same identity fence, and verifies only its owned collections absent before success. Live proof `C:\Users\Meta\AppData\Local\Temp\epiphany-workspace-coverage-a577f820-b0e2-4733-b628-529ee3bdb143\proof.json` passed with receipt `2b44f28f-7c0f-4ad2-aefe-d7c8222e8642` and binds the executed binary, exact embedded smoke source, source head, and tracked-source diff digests. Operator orchestration, not the harness, restored local Qdrant to its prior stopped state. The run also repaired normal-user Windows boot identity and exact recovered-owner claim resumption.
- The 2026-07-16 deployability audit is historical evidence for wounds since cut: immutable packaged releases removed mutable sibling generations, repository readiness joined Body/Modeling/Mind authority, and release `0601e280480cccc28209fbf0630e921f3ef9056d` is running on Yggdrasil under Bifrost/Idunn while its first workspace projection advances. The machine is still not an autonomous organizational swarm: the deployed body hosts projectors and supervisor, not the resident coordinator/scheduler, model runtime, tool spine, writable Hands workspace, or Persona/Discord crossing. Health, heartbeat, systemd state, Qdrant existence, and Gjallar/Eve projections cannot substitute for those missing cognition organs or final deployment admission.
- Resident organizational Self now has a typed ownership cut in source. Standard heartbeat alone consumes pending operator-objective, Body-map-drift, Persona-feedback, or Imagination-proposal pressure and atomically emits one single-consumption scheduling grant. Resident Self alone owns grant consumption, immutable prepared launch, packaged coordinator child claim before cognition, one exact process lease, exact coordinator terminal-receipt binding, and terminal acknowledgement back to heartbeat. All wake sources share that path; pressure cannot adopt Mind state, invoke Hands, authorize release, or deploy. The old source-tree/Cargo swarm wrapper and its online/run/run-queue/pulse/epiphany-work queue path are forbidden writers and removed from the live mechanism. Packaged release witness roles now include swarm, coordinator, model runtime, and tool Codex MCP spine. Verification belongs to CAS/replay, physical store separation, witnessed binaries, child-claim and exact-process timelines, brake/timeout draining, receipt substitution rejection, and negative runtime-Cargo/queue scans. Nonblocking hardening remains: replace the parent's post-launch process observation correlation with an OS-authenticated parent/child launch channel where supported; PID alone remains inadmissible. This source cut is not Ygg service installation or deployment admission.
- Release `sha256-c94109f94ee42c1257089830f399cb87cd5ad672772c274194371995ce4df923` is the first deployed immutable sibling generation. Native packaging builds from detached exact source commit `dd80f4a51c18425a6665710698a357be61154abf`, initializes pinned submodules, uses the tracked lockfile under `--locked`, and publishes four exact binaries plus a typed CultCache witness/head only after atomic directory publication and byte verification. Task Scheduler pins release id/digest and the witnessed supervisor path; Idunn reauthenticates the complete set and reserved policy role paths. Current-boot proof: reconciler PID 21228 launched direct child 22736; witnessed Mind/Modeling queries ranked semantically; killing that exact-path child caused Idunn to launch PID 19748 with receipt `86a42d51-9930-4b5d-9e61-e74c82a0d808`, ready heartbeat `4fc91977-b635-474b-812b-c364847e2b4b`, and witnessed executable digest `sha256-1060dd64e8c2b520ec8744b67e8306db04a6618d463fc2117c352adf9e30e6b0`. This closes current-boot artifact generation and recurrence, not reboot/logon survival.
- Release `sha256-6f9ab4848207a110e7e3836f41e6a74c0f463369ad4b04ce2d0d3831a6b262ae` packages repository-readiness source commit `360dcb433dda9599fca14282592608d26b8b6cc8`; witnessed Idunn PID 29476 directly owns witnessed projector PID 22840 with launch receipt `50879209-b65f-4411-ae3f-6f647d37bf42` and ready heartbeat `134df620-9e20-4220-ad4e-117ea4ca8188`. Deployment exposed receipt-v2 migration pressure: v1 receipts became correctly ineligible, but the old Succeeded pulse shortcut kept both partitions idle. The shortcut is now cut in source. Valid v2 terminal evidence derives Ready; an exact same-obligation succeeded claim opens Repair only after its consumed grant/recovery authority and exact succeeded attempt are authenticated. Failed repair retries through execute at the next epoch. Forged predecessor authority cannot be laundered by a repair grant.
- 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.
next_action: "Commit and push the verified typed live-vs-recovery reconciliation split, then let exact Yggdrasil release 0601e280480cccc28209fbf0630e921f3ef9056d finish its detached checkpointed first projection and record terminal Idunn deployment admission without interrupting its sole store owner. Its current collection advanced from 193 to 1621 points while body.cc remained 612961 bytes and projector PID 145165 remained stable; deployment.env is still absent, so admission is pending. After terminal proof, authorize and Idunn-deploy the reconciliation commit and run exact kill/recovery replay. Then package the resident organizational swarm (scheduler/coordinator, model runtime, tool spine, Persona), provision its writable domain worktree and local credentials, wire VoidBot/Bifrost Discord feedback and separately authenticated operations, and complete a Starfire-offline rehearsal before 2026-07-22. Ordinary Persona conversation may create typed feedback pressure but cannot adopt Mind state, invoke Hands, authorize release, or deploy. No host reboot is authorized."
next_action: "Let exact Yggdrasil release 0601e280480cccc28209fbf0630e921f3ef9056d finish its detached checkpointed first projection without interrupting its sole store owner. Its collection advanced beyond 5256 points while projector PID 145165 remained stable. The foreground Idunn deploy actuator is no longer present and deployment.env remains absent; a surviving candidate is not deployment admission. After terminal provider proof, re-enter the same exact authorized release through Idunn and require its typed deployment witness. The resident organizational Self ownership cut is complete in source: standard heartbeat emits a single-consumption Self scheduling grant; resident Self transactionally owns one exact coordinator process lease; typed Body-map, Persona-feedback, and Imagination-proposal pressure can request scheduling but cannot adopt Mind state, invoke Hands, authorize release, or deploy. Next package and install this resident service body on Yggdrasil, provision its writable domain worktree and local credentials, wire VoidBot/Bifrost Discord feedback and separately authenticated operations, then complete a Starfire-offline rehearsal before 2026-07-22. After exact release admission, authorize and Idunn-deploy the live-vs-recovery reconciliation commit and run exact kill/recovery replay. No host reboot is authorized."