From e639d669d9004f11ad9745f3b705f99c9ff5a7c2 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 22:20:14 +0100 Subject: [PATCH] Preserve absent CultMesh bodies --- .../src/bin/epiphany-cluster-daemon.rs | 3 -- .../src/bin/epiphany-daemon-supervisor.rs | 4 -- epiphany-core/src/bin/epiphany-verse-query.rs | 4 -- epiphany-core/src/cultmesh_integration.rs | 41 +++++++++++++++++- ...onceptual-substitution-audit-2026-07-12.md | 17 ++++++++ notes/epiphany-current-algorithmic-map.md | 5 +++ notes/fresh-workspace-handoff.md | 3 ++ state/ledgers.msgpack | Bin 439822 -> 440262 bytes state/map.yaml | 2 +- 9 files changed, 66 insertions(+), 13 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-cluster-daemon.rs b/epiphany-core/src/bin/epiphany-cluster-daemon.rs index 98efdd68..9ce0f1f7 100644 --- a/epiphany-core/src/bin/epiphany-cluster-daemon.rs +++ b/epiphany-core/src/bin/epiphany-cluster-daemon.rs @@ -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"); diff --git a/epiphany-core/src/bin/epiphany-daemon-supervisor.rs b/epiphany-core/src/bin/epiphany-daemon-supervisor.rs index cbc48ef6..1bc7eb7e 100644 --- a/epiphany-core/src/bin/epiphany-daemon-supervisor.rs +++ b/epiphany-core/src/bin/epiphany-daemon-supervisor.rs @@ -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!( diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index e5eddbfe..41d1b1fa 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -10429,10 +10429,6 @@ impl Args { } } - if let Some(parent) = store.parent() { - std::fs::create_dir_all(parent)?; - } - Ok(Self { command, store, diff --git a/epiphany-core/src/cultmesh_integration.rs b/epiphany-core/src/cultmesh_integration.rs index cade43bd..5147d83d 100644 --- a/epiphany-core/src/cultmesh_integration.rs +++ b/epiphany-core/src/cultmesh_integration.rs @@ -2629,6 +2629,10 @@ pub fn load_epiphany_cultmesh_status( store_path: impl AsRef, runtime_id: impl Into, ) -> Result> { + 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 { 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, runtime_id: impl Into, ) -> Result> { + 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(()) } diff --git a/notes/conceptual-substitution-audit-2026-07-12.md b/notes/conceptual-substitution-audit-2026-07-12.md index a4faee9e..6b5df1ab 100644 --- a/notes/conceptual-substitution-audit-2026-07-12.md +++ b/notes/conceptual-substitution-audit-2026-07-12.md @@ -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. diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 19e5ddbb..5fdf63fb 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -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. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index cb5ca178..6e904869 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -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. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 1ea5091da47124c4ca57610f4949b0d8a60a44b1..40c90acafc2439bf010279f98745c75e6f88e87a 100644 GIT binary patch delta 456 zcmXAl!AcxK5QZ~rvX_uc@DRj9fyeCVI1mHtCE!WOQ3Sp9^i=OQ_I9n+)v|Lkkb~kO zCzpKyUqBENd;#Ah_ds638a))%{B-^QSM}@P#?$|e`%lIDx*At|r%!K&zwaKliu0ma z|G6AoEeC~G-`BL>YQ6ij91OdMkGGF?RqvJ6*K)T$s&~hAwfcK9*!)&pA7p{Kk!hJQ zpcPNCG^uQ;?MlmNdSMLb8MzyQ4LJ#N*&3Wt9D#|eAJ=Q^mvh4jIYA@{6eq~=GK!Fd z7}cIJO4^5+PszuL%0_b95t>t=NvA$7wBAf2CGl3DtR%!96U-Ua`U1f;38Te*a5)69 z6a^RZ3U&#ME+_qM6d~fmD`gZoRwmr;n|B^th^Ts7zT!ZRUN>hVH`4hg`yhY|v{_6O z6q>0~M@I}s17*sHaPa*wjiCNgLGTS5?m*OYb#piT@Y(r=X1ruVn$a1mt)9!xq(4-@ MpmSiSXwSBv0f=FvYybcN delta 57 zcmX^1UaIen)CLJgZUajzBeSSu3~XCoZ&qe3WMmX>p32ldm5C9EK{PWEvj8#c_Nh#4 Gm74)M6%wQX diff --git a/state/map.yaml b/state/map.yaml index c075c06b..b5f69d7a 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -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.