Delete fabricated operator status writer
This commit is contained in:
parent
631fb60520
commit
60911fda96
9 changed files with 19 additions and 130 deletions
|
|
@ -3,9 +3,7 @@ use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_TIER;
|
|||
use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID;
|
||||
use epiphany_core::EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION;
|
||||
use epiphany_core::EpiphanyCultMeshStatusEntry;
|
||||
use epiphany_core::default_epiphany_cultmesh_operator_status;
|
||||
use epiphany_core::epiphany_cultmesh_operator_snapshot_from_status_json;
|
||||
use epiphany_core::load_epiphany_cultmesh_operator_status;
|
||||
use epiphany_core::load_epiphany_cultmesh_status;
|
||||
use epiphany_core::load_latest_epiphany_cultmesh_operator_snapshot;
|
||||
use epiphany_core::write_epiphany_cultmesh_continuity_contracts;
|
||||
|
|
@ -14,7 +12,6 @@ use epiphany_core::write_epiphany_cultmesh_global_room_policies;
|
|||
use epiphany_core::write_epiphany_cultmesh_hands_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_mind_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_operator_snapshot;
|
||||
use epiphany_core::write_epiphany_cultmesh_operator_status;
|
||||
use epiphany_core::write_epiphany_cultmesh_soul_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_status;
|
||||
use epiphany_core::write_epiphany_cultmesh_substrate_gate_contracts;
|
||||
|
|
@ -45,11 +42,6 @@ fn main() -> Result<()> {
|
|||
write_epiphany_cultmesh_hands_contracts(&store, "epiphany-cultmesh-smoke")?;
|
||||
write_epiphany_cultmesh_soul_contracts(&store, "epiphany-cultmesh-smoke")?;
|
||||
write_epiphany_cultmesh_continuity_contracts(&store, "epiphany-cultmesh-smoke")?;
|
||||
let operator_status = default_epiphany_cultmesh_operator_status(
|
||||
"epiphany-cultmesh-smoke",
|
||||
"2026-05-27T00:00:00Z",
|
||||
);
|
||||
write_epiphany_cultmesh_operator_status(&store, operator_status.clone())?;
|
||||
let operator_snapshot = epiphany_cultmesh_operator_snapshot_from_status_json(
|
||||
"epiphany-cultmesh-smoke",
|
||||
"cultmesh-smoke-status",
|
||||
|
|
@ -90,11 +82,6 @@ fn main() -> Result<()> {
|
|||
if loaded != Some(status) {
|
||||
anyhow::bail!("CultMesh smoke failed to round-trip Epiphany status document");
|
||||
}
|
||||
let loaded_operator_status =
|
||||
load_epiphany_cultmesh_operator_status(&store, "epiphany-cultmesh-smoke")?;
|
||||
if loaded_operator_status != Some(operator_status) {
|
||||
anyhow::bail!("CultMesh smoke failed to round-trip Epiphany operator status document");
|
||||
}
|
||||
let loaded_operator_snapshot =
|
||||
load_latest_epiphany_cultmesh_operator_snapshot(&store, "epiphany-cultmesh-smoke")?;
|
||||
if loaded_operator_snapshot != Some(operator_snapshot) {
|
||||
|
|
|
|||
|
|
@ -1,106 +0,0 @@
|
|||
use anyhow::Context;
|
||||
use anyhow::Result;
|
||||
use chrono::Utc;
|
||||
use epiphany_core::default_epiphany_cultmesh_operator_status;
|
||||
use epiphany_core::load_epiphany_cultmesh_operator_status;
|
||||
use epiphany_core::write_epiphany_cultmesh_operator_status;
|
||||
use serde_json::json;
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = Args::parse()?;
|
||||
match args.command.as_str() {
|
||||
"write" => {
|
||||
let status = default_epiphany_cultmesh_operator_status(
|
||||
args.runtime_id.clone(),
|
||||
Utc::now().to_rfc3339(),
|
||||
);
|
||||
let written = write_epiphany_cultmesh_operator_status(&args.store, status)?;
|
||||
println!(
|
||||
"{}",
|
||||
serde_json::to_string_pretty(&json!({
|
||||
"status": "written",
|
||||
"store": args.store,
|
||||
"document": written,
|
||||
}))?
|
||||
);
|
||||
}
|
||||
"read" => {
|
||||
let loaded = load_epiphany_cultmesh_operator_status(&args.store, &args.runtime_id)?;
|
||||
println!(
|
||||
"{}",
|
||||
serde_json::to_string_pretty(&json!({
|
||||
"status": if loaded.is_some() { "ready" } else { "missing" },
|
||||
"store": args.store,
|
||||
"document": loaded,
|
||||
}))?
|
||||
);
|
||||
}
|
||||
"smoke" => {
|
||||
let status = default_epiphany_cultmesh_operator_status(
|
||||
args.runtime_id.clone(),
|
||||
"2026-05-27T00:00:00Z",
|
||||
);
|
||||
write_epiphany_cultmesh_operator_status(&args.store, status.clone())?;
|
||||
let loaded = load_epiphany_cultmesh_operator_status(&args.store, &args.runtime_id)?;
|
||||
if loaded != Some(status) {
|
||||
anyhow::bail!("operator status did not round-trip through CultMesh");
|
||||
}
|
||||
println!(
|
||||
"{}",
|
||||
serde_json::to_string_pretty(&json!({
|
||||
"status": "ok",
|
||||
"store": args.store,
|
||||
"runtimeId": args.runtime_id,
|
||||
}))?
|
||||
);
|
||||
}
|
||||
other => anyhow::bail!("unknown command {other:?}; use write, read, or smoke"),
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
struct Args {
|
||||
command: String,
|
||||
store: PathBuf,
|
||||
runtime_id: String,
|
||||
}
|
||||
|
||||
impl Args {
|
||||
fn parse() -> Result<Self> {
|
||||
let mut values = env::args().skip(1);
|
||||
let command = values.next().unwrap_or_else(|| "read".to_string());
|
||||
let mut store = PathBuf::from(".epiphany-run/cultmesh/operator-status.ccmp");
|
||||
let mut store_explicit = false;
|
||||
let mut runtime_id = "epiphany-local".to_string();
|
||||
|
||||
while let Some(arg) = values.next() {
|
||||
match arg.as_str() {
|
||||
"--store" => {
|
||||
store = PathBuf::from(values.next().context("missing --store value")?);
|
||||
store_explicit = true;
|
||||
}
|
||||
"--runtime-id" => {
|
||||
runtime_id = values.next().context("missing --runtime-id value")?;
|
||||
}
|
||||
_ => anyhow::bail!("unknown argument {arg:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
if command == "smoke" {
|
||||
if store_explicit {
|
||||
anyhow::bail!(
|
||||
"operator-status smoke accepts no store override and writes only beneath .epiphany-smoke"
|
||||
);
|
||||
}
|
||||
store = PathBuf::from(".epiphany-smoke/cultmesh/operator-status.ccmp");
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
command,
|
||||
store,
|
||||
runtime_id,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -2671,6 +2671,7 @@ pub fn load_epiphany_cultmesh_status(
|
|||
node.get(EPIPHANY_CULTMESH_STATUS_KEY)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn default_epiphany_cultmesh_operator_status(
|
||||
runtime_id: impl Into<String>,
|
||||
generated_at_utc: impl Into<String>,
|
||||
|
|
@ -2707,6 +2708,7 @@ pub fn default_epiphany_cultmesh_operator_status(
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn write_epiphany_cultmesh_operator_status(
|
||||
store_path: impl AsRef<Path>,
|
||||
status: EpiphanyCultMeshOperatorStatusEntry,
|
||||
|
|
|
|||
|
|
@ -370,6 +370,7 @@ pub use cultmesh_integration::EpiphanyLocalVerseContractSummary;
|
|||
pub use cultmesh_integration::EpiphanyLocalVerseWorkLoopSummary;
|
||||
pub use cultmesh_integration::EpiphanyServiceExecutionAuditCheck;
|
||||
pub use cultmesh_integration::EpiphanyServiceExecutionAuditReport;
|
||||
#[cfg(test)]
|
||||
pub use cultmesh_integration::default_epiphany_cultmesh_operator_status;
|
||||
pub use cultmesh_integration::default_epiphany_cultmesh_swarm_brake;
|
||||
pub use cultmesh_integration::epiphany_cluster_service_execution_audit_report;
|
||||
|
|
@ -511,6 +512,7 @@ pub use cultmesh_integration::write_epiphany_cultmesh_mind_contracts;
|
|||
pub use cultmesh_integration::write_epiphany_cultmesh_operator_run_intent;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_operator_run_receipt;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_operator_snapshot;
|
||||
#[cfg(test)]
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_operator_status;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_persona_speech_audit;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_repo_work_map_entry;
|
||||
|
|
|
|||
Reference in a new issue