Preserve absent CultMesh bodies

This commit is contained in:
Meta Vens 2026-07-12 22:20:14 +01:00
commit e639d669d9
9 changed files with 66 additions and 13 deletions

View file

@ -180,9 +180,6 @@ impl Args {
}
}
if let Some(parent) = store.parent() {
std::fs::create_dir_all(parent)?;
}
let daemon_id = daemon_id.context("cluster daemon requires --daemon-id")?;
if !matches!(daemon_status.as_str(), "ready" | "degraded" | "down") {
anyhow::bail!("--daemon-status must be ready, degraded, or down");

View file

@ -3713,10 +3713,6 @@ impl Args {
));
}
if let Some(parent) = store.parent() {
std::fs::create_dir_all(parent)?;
}
let daemon_id = match daemon_id {
Some(daemon_id) => daemon_id,
None if matches!(

View file

@ -10429,10 +10429,6 @@ impl Args {
}
}
if let Some(parent) = store.parent() {
std::fs::create_dir_all(parent)?;
}
Ok(Self {
command,
store,

View file

@ -2629,6 +2629,10 @@ pub fn load_epiphany_cultmesh_status(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
) -> Result<Option<EpiphanyCultMeshStatusEntry>> {
let store_path = store_path.as_ref();
if !store_path.exists() {
return Ok(None);
}
let node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
node.get(EPIPHANY_CULTMESH_STATUS_KEY)
}
@ -5738,6 +5742,12 @@ pub fn query_epiphany_local_verse_context(
) -> Result<EpiphanyLocalVerseContext> {
let store_path = store_path.as_ref();
let runtime_id = runtime_id.into();
if !store_path.exists() {
anyhow::bail!(
"local Verse store does not exist at {}",
store_path.display()
);
}
let node = open_epiphany_cultmesh_node(store_path, runtime_id.clone())?;
let mut verse_policies = Vec::new();
for policy in epiphany_cultmesh_verse_policies() {
@ -5921,6 +5931,9 @@ pub fn load_epiphany_cultmesh_daemon_liveness(
> {
let store_path = store_path.as_ref();
let runtime_id = runtime_id.into();
if !store_path.exists() {
return Ok(Vec::new());
}
let node = open_epiphany_cultmesh_node(store_path, runtime_id.clone())?;
let mut rows = Vec::new();
for cluster in load_epiphany_cultmesh_cluster_topology(store_path, runtime_id.clone())? {
@ -5945,6 +5958,9 @@ pub fn load_epiphany_cultmesh_daemon_restart_policy_directory(
> {
let store_path = store_path.as_ref();
let runtime_id = runtime_id.into();
if !store_path.exists() {
return Ok(Vec::new());
}
let node = open_epiphany_cultmesh_node(store_path, runtime_id.clone())?;
let mut rows = Vec::new();
for cluster in load_epiphany_cultmesh_cluster_topology(store_path, runtime_id.clone())? {
@ -5972,6 +5988,9 @@ pub fn load_epiphany_cultmesh_eve_surface_directory(
> {
let store_path = store_path.as_ref();
let runtime_id = runtime_id.into();
if !store_path.exists() {
return Ok(Vec::new());
}
let node = open_epiphany_cultmesh_node(store_path, runtime_id.clone())?;
let mut rows = Vec::new();
for cluster in load_epiphany_cultmesh_cluster_topology(store_path, runtime_id.clone())? {
@ -6028,6 +6047,9 @@ pub fn load_epiphany_cultmesh_daemon_tool_directory(
> {
let store_path = store_path.as_ref();
let runtime_id = runtime_id.into();
if !store_path.exists() {
return Ok(Vec::new());
}
let node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
let mut rows = Vec::new();
let capabilities = node
@ -6457,6 +6479,10 @@ pub fn load_epiphany_cultmesh_cluster_topology(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
) -> Result<Vec<EpiphanyCultMeshClusterTopologyEntry>> {
let store_path = store_path.as_ref();
if !store_path.exists() {
return Ok(Vec::new());
}
let node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
let mut topology = Vec::new();
for cluster in epiphany_cultmesh_cluster_topology() {
@ -8053,8 +8079,13 @@ mod tests {
#[test]
fn diagnostic_loaders_do_not_materialize_missing_body_state() -> Result<()> {
let temp = tempfile::tempdir()?;
let store = temp.path().join("missing-local-verse.ccmp");
let missing_parent = temp.path().join("missing-body");
let store = missing_parent.join("missing-local-verse.ccmp");
assert_eq!(
load_epiphany_cultmesh_status(&store, "epiphany-test")?,
None
);
assert!(load_epiphany_cultmesh_cluster_topology(&store, "epiphany-test")?.is_empty());
assert!(load_epiphany_cultmesh_daemon_liveness(&store, "epiphany-test")?.is_empty());
assert!(
@ -8067,6 +8098,14 @@ mod tests {
!store.exists(),
"read-only diagnostic loaders must not create a CultCache store"
);
assert!(
!missing_parent.exists(),
"read-only diagnostic loaders must not create the store parent"
);
let error = query_epiphany_local_verse_context(&store, "epiphany-test")
.expect_err("a missing Verse cannot project a context");
assert!(error.to_string().contains("store does not exist"));
assert!(!missing_parent.exists());
Ok(())
}

View file

@ -217,3 +217,20 @@ opening CultMesh and refuses without creation. After explicit bootstrap, sync
still mirrors the seven persisted agent rows and report reads them without
mutation. The wrapper's `agent-state-soa` mode is an explicit sync-then-report
composition, not evidence that the report command owns refresh.
## Path selection/body existence split
The query, cluster-daemon, and daemon-supervisor argument parsers created the
selected CultMesh store parent unconditionally. Read-only queries, refused
daemon starts, refused supervisor commands, and invalid smoke overrides could
therefore alter the filesystem merely by naming a body that did not exist.
Several diagnostic loaders also opened a missing CultMesh node before learning
that there was nothing to read. The store path had become a conceptual
substitute for an initialized body.
Parser-side directory creation is deleted. Status and topology prerequisites
now preserve absence; the full Verse context query refuses a nonexistent store;
and the liveness, restart-policy, Eve-surface, and daemon-tool directories
return empty without opening CultMesh. A nested-parent unit check and rebuilt
CLI probe prove that query, cluster-daemon heartbeat, and supervisor status
fail on missing stores without creating either store or parent directory.

View file

@ -130,6 +130,11 @@
the persisted agent store. SoA report is filesystem-pure on a missing store.
Wrapper mode `agent-state-soa` explicitly composes sync then report; the
report itself never refreshes canonical state.
- Merely naming a CultMesh store does not create its body. Query, cluster-daemon,
and daemon-supervisor parsers perform no filesystem writes; missing status or
topology prerequisites preserve absence; full context query refuses a
nonexistent store; narrow diagnostic directories return empty without
opening CultMesh. Explicit bootstrap or a real writer owns body creation.
- Store/runtime overrides fail before fixture seeding or receipt construction.
- Negative proof: targeting `state/local-verse.ccmp` was rejected and its SHA-256 did not change.
- Positive proof: the built-in quarantined smoke completes successfully and reports its quarantine coordinates.

View file

@ -48,6 +48,9 @@ The confirmed conceptual substitutions have been cut:
- agent-state SoA sync requires bootstrap; report preserves missing filesystem
state. The wrapper explicitly composes sync then report rather than hiding a
refresh inside readback.
- query, cluster-daemon, and daemon-supervisor argument parsing no longer creates
store parents. Missing-store reads/prerequisites preserve filesystem absence;
explicit bootstrap or a real writer owns CultMesh body creation.
The presentation boundary is now plain: `swarm overview` is a generic compact read-only projection. Gjallar is a downstream TUI application on Nightwing and is not an Epiphany organ, provider, owner, runtime, or architectural dependency. Eve/CultUI graphs may be lowered or composited downstream without Epiphany caring which presentation client does it.

Binary file not shown.

View file

@ -70,7 +70,7 @@ data_flow:
- move historical proof to git, commits, smoke artifacts, or distilled evidence rather than plan prose
active_subgoals:
- Use `notes/conceptual-substitution-audit-2026-07-12.md` plus `notes/receipt-writer-provenance-audit-2026-07-12.md` as the current authority-corrosion maps. Snapshot promotion, synthetic smoke escape, unbound operator completion, hidden service execution flags, provider/bootstrap collapse, central/all-provider publication, production-side implicit bootstrap, orphaned external response authority, bulk readiness authority, public topology-derived provider builders, bootstrap/template-authored operator observation, writerless operator-status schema authority, and SoA projection body creation are cut. Provider responses and readiness without observers are test-only; the ownerless operator-status family is deleted; templates are private; query mutations require the body; missing reads preserve filesystem absence. Next audit remaining projections, caches, schedulers, adapters, and non-receipt smokes for borrowed authority or path escape.
- Use `notes/conceptual-substitution-audit-2026-07-12.md` plus `notes/receipt-writer-provenance-audit-2026-07-12.md` as the current authority-corrosion maps. Snapshot promotion, synthetic smoke escape, unbound operator completion, hidden service execution flags, provider/bootstrap collapse, central/all-provider publication, production-side implicit bootstrap, orphaned external response authority, bulk readiness authority, public topology-derived provider builders, bootstrap/template-authored operator observation, writerless operator-status schema authority, SoA projection body creation, and path-selection-as-body-creation are cut. Provider responses and readiness without observers are test-only; the ownerless operator-status family is deleted; templates are private; query mutations require the body; missing reads and refused daemon/supervisor starts preserve parent-directory absence. Next audit remaining projections, caches, schedulers, adapters, and non-receipt smokes for borrowed authority or path escape.
- `swarm-overview` is an Epiphany-local, renderer-neutral diagnostic projection over provider-owned typed state. It owns no lifecycle, discovery, composition, or mutation authority. Epiphany publishes clean provider-owned Eve surfaces; Odin may discover them; downstream lowerers and compositors remain outside Epiphany's concern.
- Idunn owns daemon survival and service lifecycle physiology. Codex/operator sessions may inspect, generate runbooks, and route explicit operator authority, but keeping daemons alive belongs to Idunn-owned service lifecycle receipts, scheduler policy, audits, and aftercare. Do not let Self, diagnostic projections, or ad hoc wrapper summaries become a second daemon-keeper. Global tool readbacks for Self `service-health`, `service-policy-directory`, and `swarm-online-runbook` state `lifecycleOwner=Idunn` and `hostedBody=Epiphany` without service mutation or private-state exposure.
- Use `notes/epiphany-cultmesh-dreaming-roadmap.md` as the design authority for distributed Epiphany dreaming. Public dreams are separately authored typed documents distributed through CultMesh/CultNet; private state remains local and cannot be shared by flipping a visibility flag. Foreign dreams are external thought weather until a reviewed local adoption receipt digests them into memory, planning, doctrine, or governance.