Enroll a truthful host incarnation root

This commit is contained in:
Meta Vens 2026-07-16 01:00:51 +01:00
commit 9720efe054
7 changed files with 503 additions and 2 deletions

View file

@ -28,7 +28,9 @@ epiphany-openai-adapter = { path = "../epiphany-openai-adapter" }
epiphany-model-adapter = { path = "../epiphany-model-adapter" }
epiphany-tool-adapter = { path = "../epiphany-tool-adapter" }
epiphany-state-model = { path = "../epiphany-state-model" }
ed25519-dalek = "2"
ignore = "0.4.23"
rand_core = { version = "0.6", features = ["getrandom"] }
postgres = "0.19"
reqwest = { version = "0.12", features = ["blocking", "json"] }
rmp-serde = "1"
@ -47,7 +49,7 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread"] }
wiremock = "0.6"
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Threading"] }
windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_Security", "Win32_Security_Cryptography", "Win32_Storage_FileSystem", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Threading"] }
[target.'cfg(unix)'.dependencies]
libc = "0.2"

View file

@ -0,0 +1,467 @@
use anyhow::{Context, Result, anyhow, bail};
use cultcache_rs::{
CacheBackingStore, CultCacheEnvelope, DatabaseEntry, SingleFileMessagePackBackingStore,
};
use ed25519_dalek::{Signature, Signer, SigningKey, Verifier, VerifyingKey};
use rand_core::OsRng;
use sha2::{Digest, Sha256};
use std::path::{Path, PathBuf};
pub const HOST_IDENTITY_TYPE: &str = "epiphany.host_incarnation_identity.v0";
pub const HOST_IDENTITY_SCHEMA_VERSION: &str = "epiphany.host_incarnation_identity.v0";
pub const HOST_IDENTITY_KEY: &str = "host-incarnation";
pub const WINDOWS_HOST_IDENTITY_ASSURANCE: &str = "os_user_installation_bound_best_effort";
pub const LINUX_HOST_IDENTITY_ASSURANCE: &str = "os_installation_file_bound_cloneable_baseline";
const ID_DOMAIN: &[u8] = b"epiphany.host-incarnation.identity.v0\0";
const SIGNATURE_DOMAIN: &[u8] = b"epiphany.host-incarnation.signature.v0\0";
#[derive(Clone, Debug, PartialEq, DatabaseEntry)]
#[cultcache(
type = "epiphany.host_incarnation_identity.v0",
schema = "HostIncarnationIdentityEntry"
)]
pub struct HostIncarnationIdentityEntry {
#[cultcache(key = 0)]
pub schema_version: String,
#[cultcache(key = 1)]
pub identity_id: String,
#[cultcache(key = 2)]
pub public_key: Vec<u8>,
#[cultcache(key = 3)]
pub protected_private_seed: Vec<u8>,
#[cultcache(key = 4)]
pub protector_kind: String,
#[cultcache(key = 5)]
pub protector_binding: String,
#[cultcache(key = 6)]
pub protector_version: String,
#[cultcache(key = 7)]
pub assurance: String,
#[cultcache(key = 8)]
pub created_at: String,
#[cultcache(key = 9)]
pub enrollment_nonce: Vec<u8>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct HostIdentitySignature {
pub identity_id: String,
pub signature: Vec<u8>,
}
/// A deliberately narrow signing handle. The private seed is never exposed by
/// the public API and is unprotected only while this value exists.
pub struct HostIdentitySigner {
entry: HostIncarnationIdentityEntry,
signing_key: SigningKey,
}
impl HostIdentitySigner {
pub fn entry(&self) -> &HostIncarnationIdentityEntry {
&self.entry
}
pub fn sign(&self, purpose: &str, payload: &[u8]) -> Result<HostIdentitySignature> {
let message = signing_message(purpose, payload)?;
Ok(HostIdentitySignature {
identity_id: self.entry.identity_id.clone(),
signature: self.signing_key.sign(&message).to_bytes().to_vec(),
})
}
}
pub fn default_host_identity_store_path() -> Result<PathBuf> {
#[cfg(windows)]
{
let root = std::env::var_os("LOCALAPPDATA")
.ok_or_else(|| anyhow!("LOCALAPPDATA is unavailable; host identity path is unknown"))?;
return Ok(PathBuf::from(root)
.join("GameCult")
.join("Epiphany")
.join("host-identity.ccmp"));
}
#[cfg(target_os = "linux")]
{
let root = if let Some(root) = std::env::var_os("XDG_STATE_HOME") {
PathBuf::from(root)
} else {
let home = std::env::var_os("HOME")
.ok_or_else(|| anyhow!("HOME is unavailable; host identity path is unknown"))?;
PathBuf::from(home).join(".local").join("state")
};
return Ok(root
.join("gamecult")
.join("epiphany")
.join("host-identity.ccmp"));
}
#[allow(unreachable_code)]
Err(anyhow!(
"host identity enrollment is unsupported on this operating system"
))
}
pub fn enroll_default_host_identity() -> Result<HostIdentitySigner> {
enroll_host_identity_at(&default_host_identity_store_path()?)
}
pub fn open_default_host_identity() -> Result<HostIdentitySigner> {
open_host_identity_at(&default_host_identity_store_path()?)
}
/// Performs one immutable enrollment. Existing state is never reused by this
/// operation and malformed state is never replaced.
pub fn enroll_host_identity_at(store_path: &Path) -> Result<HostIdentitySigner> {
if store_path.exists() {
bail!(
"host identity store {} already exists; enrollment is immutable",
store_path.display()
);
}
prepare_parent(store_path)?;
let mut seed = [0_u8; 32];
rand_core::RngCore::fill_bytes(&mut OsRng, &mut seed);
let signing_key = SigningKey::from_bytes(&seed);
let mut nonce = [0_u8; 32];
rand_core::RngCore::fill_bytes(&mut OsRng, &mut nonce);
let public_key = signing_key.verifying_key().to_bytes();
let identity_id = identity_id(&public_key);
let binding = platform_binding()?;
let protected_private_seed = protect_seed(signing_key.as_bytes(), &binding)?;
let entry = HostIncarnationIdentityEntry {
schema_version: HOST_IDENTITY_SCHEMA_VERSION.to_string(),
identity_id,
public_key: public_key.to_vec(),
protected_private_seed,
protector_kind: platform_protector_kind().to_string(),
protector_binding: binding,
protector_version: "v1".to_string(),
assurance: platform_assurance().to_string(),
created_at: chrono::Utc::now().to_rfc3339(),
enrollment_nonce: nonce.to_vec(),
};
validate_entry(&entry)?;
let envelope = entry_envelope(&entry)?;
let backing = SingleFileMessagePackBackingStore::new(store_path);
if !backing.insert_entry_if_absent(envelope)? {
bail!("host identity enrollment lost an atomic create race; refusing to reuse state");
}
harden_store_permissions(store_path)?;
open_host_identity_at(store_path)
}
pub fn open_host_identity_at(store_path: &Path) -> Result<HostIdentitySigner> {
if !store_path.is_file() {
bail!(
"host identity store {} does not exist",
store_path.display()
);
}
let entries = SingleFileMessagePackBackingStore::new(store_path).pull_all()?;
if entries.len() != 1 {
bail!("host identity store must contain exactly one immutable envelope");
}
let envelope = &entries[0];
if envelope.r#type != HOST_IDENTITY_TYPE || envelope.key != HOST_IDENTITY_KEY {
bail!("host identity store contains an unexpected type or key");
}
let entry: HostIncarnationIdentityEntry = rmp_serde::from_slice(&envelope.payload)
.context("host identity payload is malformed MessagePack")?;
validate_entry(&entry)?;
if entry.protector_kind != platform_protector_kind() || entry.assurance != platform_assurance()
{
bail!("host identity protector does not belong to this platform implementation");
}
let current_binding = platform_binding()?;
if entry.protector_binding != current_binding {
bail!("host identity protector binding does not match this OS installation");
}
let seed = unprotect_seed(&entry.protected_private_seed, &current_binding)?;
let seed: [u8; 32] = seed
.try_into()
.map_err(|_| anyhow!("unprotected host identity seed has invalid length"))?;
let signing_key = SigningKey::from_bytes(&seed);
if signing_key.verifying_key().to_bytes().as_slice() != entry.public_key.as_slice() {
bail!("host identity private seed does not match the enrolled public key");
}
Ok(HostIdentitySigner { entry, signing_key })
}
pub fn verify_host_identity_signature(
entry: &HostIncarnationIdentityEntry,
purpose: &str,
payload: &[u8],
proof: &HostIdentitySignature,
) -> Result<()> {
validate_entry(entry)?;
if proof.identity_id != entry.identity_id {
bail!("host identity signature names a different identity");
}
let public_key: [u8; 32] = entry
.public_key
.as_slice()
.try_into()
.map_err(|_| anyhow!("host identity public key has invalid length"))?;
let signature = Signature::from_slice(&proof.signature)
.map_err(|_| anyhow!("host identity signature has invalid length"))?;
VerifyingKey::from_bytes(&public_key)?
.verify(&signing_message(purpose, payload)?, &signature)
.map_err(|_| anyhow!("host identity signature verification failed"))
}
fn validate_entry(entry: &HostIncarnationIdentityEntry) -> Result<()> {
if entry.schema_version != HOST_IDENTITY_SCHEMA_VERSION
|| entry.public_key.len() != 32
|| entry.enrollment_nonce.len() != 32
|| entry.protected_private_seed.is_empty()
|| entry.protector_version != "v1"
{
bail!("host identity entry violates its fixed schema");
}
chrono::DateTime::parse_from_rfc3339(&entry.created_at)
.map_err(|_| anyhow!("host identity created_at is not RFC3339"))?;
if identity_id(&entry.public_key) != entry.identity_id {
bail!("host identity id does not match its public key");
}
Ok(())
}
fn identity_id(public_key: &[u8]) -> String {
hex(&Sha256::digest([ID_DOMAIN, public_key].concat()))
}
fn signing_message(purpose: &str, payload: &[u8]) -> Result<Vec<u8>> {
if purpose.trim().is_empty() {
bail!("host identity signature purpose must not be empty");
}
let mut message =
Vec::with_capacity(SIGNATURE_DOMAIN.len() + purpose.len() + payload.len() + 16);
message.extend_from_slice(SIGNATURE_DOMAIN);
message.extend_from_slice(&(purpose.len() as u64).to_be_bytes());
message.extend_from_slice(purpose.as_bytes());
message.extend_from_slice(&(payload.len() as u64).to_be_bytes());
message.extend_from_slice(payload);
Ok(message)
}
fn entry_envelope(entry: &HostIncarnationIdentityEntry) -> Result<CultCacheEnvelope> {
Ok(CultCacheEnvelope {
key: HOST_IDENTITY_KEY.to_string(),
r#type: HOST_IDENTITY_TYPE.to_string(),
payload: rmp_serde::to_vec(entry)?,
stored_at: entry.created_at.clone(),
schema_id: Some(HOST_IDENTITY_SCHEMA_VERSION.to_string()),
})
}
fn prepare_parent(path: &Path) -> Result<()> {
let parent = path
.parent()
.ok_or_else(|| anyhow!("host identity path has no parent"))?;
std::fs::create_dir_all(parent)?;
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
std::fs::set_permissions(parent, std::fs::Permissions::from_mode(0o700))?;
}
Ok(())
}
fn harden_store_permissions(_path: &Path) -> Result<()> {
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
std::fs::set_permissions(_path, std::fs::Permissions::from_mode(0o600))?;
}
Ok(())
}
#[cfg(windows)]
fn platform_protector_kind() -> &'static str {
"windows_dpapi_current_user"
}
#[cfg(target_os = "linux")]
fn platform_protector_kind() -> &'static str {
"linux_file_mode_machine_id_binding"
}
#[cfg(windows)]
fn platform_assurance() -> &'static str {
WINDOWS_HOST_IDENTITY_ASSURANCE
}
#[cfg(target_os = "linux")]
fn platform_assurance() -> &'static str {
LINUX_HOST_IDENTITY_ASSURANCE
}
#[cfg(windows)]
fn platform_binding() -> Result<String> {
Ok("dpapi-current-user:epiphany-host-identity-v1".to_string())
}
#[cfg(target_os = "linux")]
fn platform_binding() -> Result<String> {
let machine_id = std::fs::read_to_string("/etc/machine-id")
.or_else(|_| std::fs::read_to_string("/var/lib/dbus/machine-id"))
.context("Linux machine-id is unavailable")?;
let machine_id = machine_id.trim();
if machine_id.is_empty() {
bail!("Linux machine-id is empty");
}
Ok(format!(
"machine-id-sha256:{}",
hex(&Sha256::digest(machine_id.as_bytes()))
))
}
#[cfg(windows)]
fn protect_seed(seed: &[u8; 32], binding: &str) -> Result<Vec<u8>> {
dpapi(seed, binding, true)
}
#[cfg(windows)]
fn unprotect_seed(protected: &[u8], binding: &str) -> Result<Vec<u8>> {
dpapi(protected, binding, false)
}
#[cfg(windows)]
fn dpapi(input: &[u8], binding: &str, protect: bool) -> Result<Vec<u8>> {
use windows_sys::Win32::Foundation::LocalFree;
use windows_sys::Win32::Security::Cryptography::{
CRYPT_INTEGER_BLOB, CRYPTPROTECT_UI_FORBIDDEN, CryptProtectData, CryptUnprotectData,
};
let mut input = input.to_vec();
let mut entropy = Sha256::digest(
[
b"epiphany-host-identity-dpapi-v1\0".as_slice(),
binding.as_bytes(),
]
.concat(),
)
.to_vec();
let input_blob = CRYPT_INTEGER_BLOB {
cbData: input.len() as u32,
pbData: input.as_mut_ptr(),
};
let entropy_blob = CRYPT_INTEGER_BLOB {
cbData: entropy.len() as u32,
pbData: entropy.as_mut_ptr(),
};
let mut output = CRYPT_INTEGER_BLOB {
cbData: 0,
pbData: std::ptr::null_mut(),
};
let ok = unsafe {
if protect {
CryptProtectData(
&input_blob,
std::ptr::null(),
&entropy_blob,
std::ptr::null(),
std::ptr::null(),
CRYPTPROTECT_UI_FORBIDDEN,
&mut output,
)
} else {
CryptUnprotectData(
&input_blob,
std::ptr::null_mut(),
&entropy_blob,
std::ptr::null(),
std::ptr::null(),
CRYPTPROTECT_UI_FORBIDDEN,
&mut output,
)
}
};
if ok == 0 {
return Err(std::io::Error::last_os_error())
.context("DPAPI host identity operation failed");
}
let bytes =
unsafe { std::slice::from_raw_parts(output.pbData, output.cbData as usize).to_vec() };
unsafe {
LocalFree(output.pbData.cast());
}
Ok(bytes)
}
#[cfg(target_os = "linux")]
fn protect_seed(seed: &[u8; 32], binding: &str) -> Result<Vec<u8>> {
// This is intentionally labeled a cloneable baseline, not encryption. File
// modes protect the seed locally; the binding detects a copied installation.
let mask = Sha256::digest(
[
b"epiphany-linux-host-seed-v1\0".as_slice(),
binding.as_bytes(),
]
.concat(),
);
Ok(seed
.iter()
.zip(mask)
.map(|(byte, mask)| byte ^ mask)
.collect())
}
#[cfg(target_os = "linux")]
fn unprotect_seed(protected: &[u8], binding: &str) -> Result<Vec<u8>> {
if protected.len() != 32 {
bail!("protected Linux host seed has invalid length");
}
let mask = Sha256::digest(
[
b"epiphany-linux-host-seed-v1\0".as_slice(),
binding.as_bytes(),
]
.concat(),
);
Ok(protected
.iter()
.zip(mask)
.map(|(byte, mask)| byte ^ mask)
.collect())
}
fn hex(bytes: &[u8]) -> String {
const DIGITS: &[u8; 16] = b"0123456789abcdef";
let mut output = String::with_capacity(bytes.len() * 2);
for byte in bytes {
output.push(DIGITS[(byte >> 4) as usize] as char);
output.push(DIGITS[(byte & 0xf) as usize] as char);
}
output
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn enrollment_is_immutable_and_signatures_are_purpose_bound() -> Result<()> {
let temp = tempfile::tempdir()?;
let store = temp.path().join("host-identity.ccmp");
let signer = enroll_host_identity_at(&store)?;
let proof = signer.sign("test-receipt", b"payload")?;
verify_host_identity_signature(signer.entry(), "test-receipt", b"payload", &proof)?;
assert!(
verify_host_identity_signature(signer.entry(), "other", b"payload", &proof).is_err()
);
assert!(enroll_host_identity_at(&store).is_err());
let reopened = open_host_identity_at(&store)?;
assert_eq!(reopened.entry(), signer.entry());
Ok(())
}
#[test]
fn malformed_existing_store_fails_closed_without_regeneration() -> Result<()> {
let temp = tempfile::tempdir()?;
let store = temp.path().join("host-identity.ccmp");
std::fs::write(&store, b"not a CultCache store")?;
let before = std::fs::read(&store)?;
assert!(open_host_identity_at(&store).is_err());
assert!(enroll_host_identity_at(&store).is_err());
assert_eq!(std::fs::read(&store)?, before);
Ok(())
}
}

View file

@ -15,6 +15,7 @@ mod distillation;
mod eyes_gateway;
mod hands_gateway;
mod heartbeat_state;
mod host_identity;
mod memory_graph;
mod mind_gateway;
mod organ_dependencies;
@ -648,6 +649,13 @@ pub use heartbeat_state::validate_heartbeat_state;
pub use heartbeat_state::write_heartbeat_cognition_entry;
pub use heartbeat_state::write_heartbeat_stale_turn_repair_receipt;
pub use heartbeat_state::write_heartbeat_state_entry;
pub use host_identity::{
HOST_IDENTITY_KEY, HOST_IDENTITY_SCHEMA_VERSION, HOST_IDENTITY_TYPE, HostIdentitySignature,
HostIdentitySigner, HostIncarnationIdentityEntry, LINUX_HOST_IDENTITY_ASSURANCE,
WINDOWS_HOST_IDENTITY_ASSURANCE, default_host_identity_store_path,
enroll_default_host_identity, enroll_host_identity_at, open_default_host_identity,
open_host_identity_at, verify_host_identity_signature,
};
pub use memory_graph::EpiphanyMemoryEdgeKind;
pub use memory_graph::EpiphanyMemoryEmbeddingManifest;
pub use memory_graph::EpiphanyMemoryGraphEntry;

View file

@ -1807,6 +1807,17 @@ not itself authorize recovery. Next build the enrolled OS-host identity and
specialized reserved launch/heartbeat and termination documents; only then wire
the Body recovery CAS.
The enrolled host-incarnation foundation is also implemented. Its single
non-workspace CultCache record owns an Ed25519 public identity and protected
private seed; opening validates the exact type/key/schema, platform binding,
public/private match, and immutable singleton shape. Enrollment refuses any
existing store and never regenerates malformed state. Windows uses CurrentUser
DPAPI with UI disabled and the deliberately limited assurance label
`os_user_installation_bound_best_effort`; Linux uses 0700/0600 state plus
machine-id binding and declares its cloneable baseline. No code calls this
physical-machine identity. Next remove reserved coverage authority from generic
lifecycle/heartbeat and replace it with identity-bound signed documents.
The deployment next action is unchanged and permission-bound. Do not reboot
without exact live operator approval. With that approval, run the real
reboot/logon recovery proof already specified above.

Binary file not shown.

View file

@ -725,4 +725,5 @@ current_status:
- The `epiphany.surface.*` Hello fiction is cut. Commit `65445623` remains the completed local Persona projection repair: `epiphany.persona_surface.v0` is a strict, content-free MVP-status projection over typed Persona artifact references, and its schemas remain useful discoverable vocabulary for local projection validation. It is not a CultNet runtime capability. All seventeen unbacked `epiphany.surface.*` mutation contracts and their dead runtime constants are removed; no surface type may appear in Hello until an owning provider can prove `provider publish -> typed CultMesh document -> Snapshot -> schema validation -> Eve lowering`, with a real typed dispatcher and receipt path for every advertised action. Runtime Hello and runtime status derive the current executable contract list. They ignore stale `supported_document_types` persisted in runtime identity, so the live canonical store's historical field cannot decide present wire authority or status. A canonical real hello-frame proved zero `epiphany.surface.*` capabilities. The adjacent generic central Eve substitution is also cut: `epiphany-cluster-daemon` owns liveness only; the central provider publisher and heartbeat call are deleted. Live Odin, Eve, and daemon-tool directories ignore provenance-free v0 rows, and explicit bootstrap retires stale rows of exactly those three families. Topology `eve_surface_id` is stable address/routing metadata only, not availability or composition proof. Provider discovery may return only after an owning provider emits a provenance-bearing typed contract; advertised actions additionally require a real dispatcher and receipt path. This does not displace the reboot/logon deployment proof as the current next action.
- Historical Windows SCM material in this map is rejected-path evidence, not live authority. Arbitrary console `sc.exe` installation, elevated service execution runbooks/audits, cluster-service install/start/stop/control, `swarm-online-runbook`, service-manager action queues, and their wrapper routes no longer describe deployable physiology or actionable next work. Their receipts may remain sealed historical evidence, but they cannot decide liveness, readiness, recovery, or operator action. The console binaries never implemented the Windows service-control dispatcher and therefore could not honestly own SCM service state.
- Static cluster topology owns declared faculty routing only, not attendance. Explicit bootstrap may persist seven declared faculty routes, desired private-Verse addresses, and daemon/Eve targets. Only persisted provider-authored daemon status creates an observed daemon row. The synthetic `unknown_daemon_status` path is deleted; fresh bootstrap therefore means seven declared targets and zero observed daemons. Topology, liveness, restart-policy, swarm overview/triage, compact swarm output, prompt context, and wrapper summaries distinguish `declared*` counts/routes from `observedDaemonCount`; a heartbeat does not become an agent count. Restart-policy rows may carry `daemonStatus=unobserved` solely for Idunn desired-state reconciliation. Configured ids, routes, topology row counts, and policy targets are forbidden from proving deployed daemons, active private Verses, agent presence, Eve availability, or readiness.
next_action: Strengthen native process observation with host incarnation, boot incarnation, and exact process-instance identity; Windows OpenProcess/access failure must remain Unknown rather than Dead, and PID reuse must be distinguishable. Bind those identities into reserved managed-service launch receipts, then let Idunn publish one immutable termination observation for the exact prior workspace-coverage projector launch before spawning a replacement. Only that termination proof plus the current replacement launch and correlated ready heartbeat may authorize abandoned-claim recovery. Do not use timeout, heartbeat staleness, a newer launch, Qdrant state, or PID absence without instance identity as death evidence. The separate real reboot/logon proof remains permission-bound and must not run without exact live operator approval.
- Native process and host incarnation foundations are now separate authorities. Process identity is PID plus native creation token plus canonical executable, with exact alive/exited/replaced/missing/inaccessible/indeterminate observations and optional proven boot incarnation; the PID-only compatibility projection cannot report death. Host identity is one immutable non-workspace CultCache enrollment with an Ed25519 identity/signing handle, purpose-bound signatures, fail-closed open, and no silent regeneration. Windows protects its seed with CurrentUser DPAPI and honestly labels assurance `os_user_installation_bound_best_effort`; Linux uses 0700/0600 state plus machine-id binding and labels the baseline cloneable. Neither claims physical-chassis identity. These foundations do not themselves authorize service recovery.
next_action: Replace generic lifecycle and heartbeat authority for the reserved workspace-coverage projector with mandatory specialized launch and provider-heartbeat documents bound to the current managed-policy envelope, enrolled host record, proven boot, exact process incarnation, executable bytes, and signatures. The generic writers must reject the reserved coverage identities. Then let Idunn publish one immutable termination observation for the exact prior launch before spawning its replacement. Only exact termination plus the replacement's signed ready heartbeat may authorize one Body claim/attempt recovery CAS. Do not use timeout, heartbeat staleness, a newer launch, Qdrant state, or PID absence without full instance identity as death evidence. The separate reboot/logon proof remains permission-bound.

View file

@ -65,3 +65,15 @@ The legacy PID-only projection is display-only and can emit only `Alive` or
PID-incarnation replacement, and exact child exit. Next add enrolled OS-host
identity, then reserved launch/heartbeat and immutable termination documents
before any recovery CAS.
## Enrolled host incarnation (2026-07-16)
The host root is now a dedicated non-workspace CultCache document with one
immutable Ed25519 enrollment and a narrow signing handle. Existing, malformed,
unprotectable, or binding-mismatched state fails closed; enrollment never
silently regenerates identity. Windows stores it under LocalAppData, protects
the seed with CurrentUser DPAPI, and labels its limited assurance honestly.
Linux uses the XDG/home state root, 0700/0600 permissions and machine-id binding,
explicitly labeled cloneable. This is enrolled OS-installation continuity, not
a claim about physical chassis. Purpose-bound signature and immutable/fail-
closed tests pass. The next cut is specialized reserved launch/heartbeat state.