From f00c8279c966c43c6ac899d9b16280f373b45941 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 9 Aug 2026 07:38:57 +0100 Subject: [PATCH] Make operator status build-free --- Cargo.toml | 15 ++++- epiphany-core/src/bin/epiphany-mvp-status.rs | 56 +++++++++++++------ epiphany-core/src/packaged_release.rs | 15 ++++- notes/epiphany-current-algorithmic-map.md | 25 +++++++++ notes/fresh-workspace-handoff.md | 34 +++++++++++ state/ledgers.msgpack | Bin 588964 -> 589748 bytes state/map.yaml | 16 +++--- 7 files changed, 131 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e53b6c05..b596230e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,11 +33,11 @@ ed25519-dalek = "2" epiphany-core = { path = "epiphany-core" } epiphany-model-adapter = { path = "epiphany-model-adapter" } epiphany-openai-adapter = { path = "epiphany-openai-adapter" } -epiphany-openai-runtime = { path = "epiphany-openai-runtime" } +epiphany-openai-runtime = { path = "epiphany-openai-runtime", optional = true } epiphany-self-policy = { path = "epiphany-self-policy", optional = true } epiphany-state-model = { path = "epiphany-state-model" } epiphany-tool-adapter = { path = "epiphany-tool-adapter" } -epiphany-tool-mcp-runtime = { path = "epiphany-tool-mcp-runtime" } +epiphany-tool-mcp-runtime = { path = "epiphany-tool-mcp-runtime", optional = true } http = "1" ignore = "0.4.23" postgres = "0.19" @@ -59,6 +59,9 @@ zeroize = "1" semantic-recovery-smoke = [] workspace-coverage-recovery-smoke = [] coordinator-runtime = ["dep:epiphany-self-policy"] +openai-runtime = ["dep:epiphany-openai-runtime"] +tool-mcp-runtime = ["dep:epiphany-tool-mcp-runtime"] +release-runtime = ["coordinator-runtime", "openai-runtime", "tool-mcp-runtime"] [profile.release] incremental = true @@ -138,6 +141,7 @@ path = "epiphany-core/src/bin/epiphany-persona-feedback-ingress.rs" [[bin]] name = "epiphany-persona-service" path = "epiphany-openai-runtime/src/bin/epiphany-persona-service.rs" +required-features = ["openai-runtime"] [[bin]] name = "epiphany-persona-mouth-identity" @@ -156,6 +160,11 @@ name = "epiphany-mvp-coordinator" path = "epiphany-core/src/bin/epiphany-mvp-coordinator.rs" required-features = ["coordinator-runtime"] +[[bin]] +name = "epiphany-mvp-status" +path = "epiphany-core/src/bin/epiphany-mvp-status.rs" +required-features = ["coordinator-runtime"] + [[bin]] name = "epiphany-frontier-proposal" path = "epiphany-core/src/bin/epiphany-frontier-proposal.rs" @@ -167,7 +176,9 @@ path = "epiphany-core/src/bin/epiphany-hands-action.rs" [[bin]] name = "epiphany-model-runtime" path = "epiphany-openai-runtime/src/bin/epiphany-model-runtime.rs" +required-features = ["openai-runtime"] [[bin]] name = "epiphany-tool-mcp-runtime" path = "epiphany-tool-mcp-runtime/src/main.rs" +required-features = ["tool-mcp-runtime"] diff --git a/epiphany-core/src/bin/epiphany-mvp-status.rs b/epiphany-core/src/bin/epiphany-mvp-status.rs index 5e591203..a698e781 100644 --- a/epiphany-core/src/bin/epiphany-mvp-status.rs +++ b/epiphany-core/src/bin/epiphany-mvp-status.rs @@ -166,6 +166,7 @@ struct Args { stderr: PathBuf, interrupt_binding: Option, interrupt_reason: Option, + include_auxiliary_status: bool, } impl Args { @@ -187,6 +188,7 @@ impl Args { .join("epiphany-mvp-status-server.stderr.log"), interrupt_binding: None, interrupt_reason: None, + include_auxiliary_status: true, }; while let Some(arg) = args.next() { match arg.as_str() { @@ -205,6 +207,7 @@ impl Args { "--interrupt-reason" => { parsed.interrupt_reason = Some(take_string(&mut args, "--interrupt-reason")?) } + "--coordinator-only" => parsed.include_auxiliary_status = false, _ => return Err(anyhow!("unknown argument: {arg}")), } } @@ -216,7 +219,7 @@ fn run_status(args: &Args) -> Result { if args.interrupt_binding.is_some() { return run_native_interrupt(args); } - run_native_status(args, true) + run_native_status(args, args.include_auxiliary_status) } fn run_native_interrupt(args: &Args) -> Result { @@ -271,6 +274,7 @@ pub fn native_coordinator_json(runtime_store: &Path, thread_id: &str) -> Result< .join("epiphany-mvp-status-server.stderr.log"), interrupt_binding: None, interrupt_reason: None, + include_auxiliary_status: false, }, false, ) @@ -687,7 +691,15 @@ fn native_auxiliary_status(root: &Path) -> Result { "--limit", "8", ], - )?; + ) + .unwrap_or_else(|error| { + json!({ + "status": "unavailable", + "surface": "heartbeat", + "reason": error.to_string(), + "authority": "auxiliary projection is optional and cannot summon a build" + }) + }); let latest_discord_persona = native_json( "epiphany-persona-discord", &[ @@ -1427,22 +1439,16 @@ pub fn native_json(bin_name: &str, args: &[&str]) -> Result { .join("debug") .join(format!("{bin_name}.exe")); let exe = sibling.filter(|path| path.exists()).unwrap_or(configured); - let output = if exe.exists() { - Command::new(&exe).args(args).output() - } else { - let mut command = Command::new("cargo"); - command - .arg("run") - .arg("--quiet") - .arg("--manifest-path") - .arg("epiphany-core/Cargo.toml") - .arg("--bin") - .arg(bin_name) - .arg("--") - .args(args) - .output() + if !exe.exists() { + return Err(anyhow!( + "optional projection executable is absent: {}", + exe.display() + )); } - .with_context(|| format!("failed to run {bin_name}"))?; + let output = Command::new(&exe) + .args(args) + .output() + .with_context(|| format!("failed to run {bin_name}"))?; if !output.status.success() { return Err(anyhow!( "{} failed: {}{}", @@ -1469,6 +1475,21 @@ mod native_interrupt_tests { use super::*; use epiphany_state_model::{EpiphanyJobBinding, EpiphanyJobKind}; + #[test] + fn operator_projection_has_no_build_authority() { + let source = include_str!("epiphany-mvp-status.rs"); + let native_json = source + .split("pub fn native_json") + .nth(1) + .expect("native_json source"); + let native_json = native_json + .split("fn take_string") + .next() + .expect("native_json boundary"); + assert!(!native_json.contains("Command::new(\"cargo\")")); + assert!(source.contains("\"--coordinator-only\"")); + } + #[test] fn native_operator_contract_has_one_store_and_no_codex_state_field() { let source = include_str!("epiphany-mvp-status.rs"); @@ -1514,6 +1535,7 @@ mod native_interrupt_tests { stderr: PathBuf::new(), interrupt_binding: Some("modeling-worker".to_string()), interrupt_reason: Some("native status proof".to_string()), + include_auxiliary_status: false, }; let result = run_status(&args)?; assert_eq!(result["source"], "native"); diff --git a/epiphany-core/src/packaged_release.rs b/epiphany-core/src/packaged_release.rs index 764073b3..5abc46c9 100644 --- a/epiphany-core/src/packaged_release.rs +++ b/epiphany-core/src/packaged_release.rs @@ -120,6 +120,7 @@ pub fn required_packaged_release_binaries(target_triple: &str) -> Vec<(&'static file_name("epiphany-persona-discord-permit-identity"), ), ("coordinator", file_name("epiphany-mvp-coordinator")), + ("coordinator-status", file_name("epiphany-mvp-status")), ("frontier-proposal", file_name("epiphany-frontier-proposal")), ("hands-action", file_name("epiphany-hands-action")), ("model-runtime", file_name("epiphany-model-runtime")), @@ -515,7 +516,7 @@ fn release_build_command( .arg("--package") .arg("epiphany-release-bundle") .arg("--features") - .arg("epiphany-release-bundle/coordinator-runtime"); + .arg("epiphany-release-bundle/release-runtime"); for (_, file_name) in required { let binary_name = Path::new(file_name) .file_stem() @@ -592,6 +593,7 @@ fn required_release_build_target(role: &str) -> Result<(&'static str, &'static s Ok(("epiphany-core", "epiphany-persona-discord-permit-identity")) } "coordinator" => Ok((".", "epiphany-mvp-coordinator")), + "coordinator-status" => Ok((".", "epiphany-mvp-status")), "frontier-proposal" => Ok(("epiphany-core", "epiphany-frontier-proposal")), "hands-action" => Ok(("epiphany-core", "epiphany-hands-action")), "model-runtime" => Ok(("epiphany-openai-runtime", "epiphany-model-runtime")), @@ -1154,7 +1156,7 @@ mod tests { .collect::>(); assert_eq!(envs.get("CARGO_INCREMENTAL"), Some(&Some("0".to_string()))); - assert_eq!(args.iter().filter(|arg| *arg == "--bin").count(), 23); + assert_eq!(args.iter().filter(|arg| *arg == "--bin").count(), 24); assert_eq!(args.iter().filter(|arg| *arg == "--package").count(), 1); assert!( args.windows(2) @@ -1163,12 +1165,16 @@ mod tests { assert!(!args.iter().any(|arg| arg == "epiphany-core")); assert!( args.windows(2) - .any(|pair| pair == ["--features", "epiphany-release-bundle/coordinator-runtime"]) + .any(|pair| pair == ["--features", "epiphany-release-bundle/release-runtime"]) ); assert!( args.windows(2) .any(|pair| pair == ["--bin", "epiphany-mvp-coordinator"]) ); + assert!( + args.windows(2) + .any(|pair| pair == ["--bin", "epiphany-mvp-status"]) + ); assert!( args.windows(2) .any(|pair| pair == ["--bin", "epiphany-state"]) @@ -1298,6 +1304,9 @@ mod tests { let core_manifest = fs::read_to_string(core.join("Cargo.toml")).expect("core manifest"); assert!(root_manifest.contains("coordinator-runtime = [\"dep:epiphany-self-policy\"]")); + assert!(root_manifest.contains( + "release-runtime = [\"coordinator-runtime\", \"openai-runtime\", \"tool-mcp-runtime\"]" + )); assert!(root_manifest.contains("required-features = [\"coordinator-runtime\"]")); assert!(core_manifest.contains("autobins = false")); assert!(!core_manifest.contains("name = \"epiphany-mvp-coordinator\"")); diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index a1c43e78..80b3d125 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -1985,3 +1985,28 @@ local Verse without stopping its resident process. Publication changes release availability; it does not own executable replacement. Continuity now owns the next boundary: supervised stop, authenticated body replacement, restart on the same typed stores, and proof that Self resumes the existing frontier. + +### Operator projection and resident topology ownership + +`epiphany-mvp-status` owns read-only coordinator projection. It may execute an +already-present optional projection helper, but it cannot construct one. +Missing Heartbeat, Persona, or Void helpers therefore derive an unavailable +auxiliary panel. `--coordinator-only` omits those panels and reads the accepted +coordinator state directly; observation can no longer summon Cargo. The status +binary is an explicit release sibling so deployed operator sight is part of the +authenticated body rather than a workstation accident. + +Resident Self has four distinct store roles. `release_store` authenticates the +running body; `runtime_store` owns nervous-system and coordinator state; +`local_verse_store` owns the coordination providers and brake; and +`agent_memory_store` owns Mind material. These paths may share a directory, but +they are not interchangeable. In c005, the accepted Eyes-to-Hands chain owns +the `/state/eyes-tools/` runtime, local Verse, and Mind. The main local Verse +still owns release publication. The old `/state/runtime.cc` is no longer a +resident cognition owner; it is retained evidence only. + +Docker SIGTERM currently reaches `epiphany-swarm` PID 1, but `serve` owns an +unconditional loop followed by blocking `thread::sleep` and installs no signal +observer. Docker therefore escalates to SIGKILL and records exit 137. Graceful +shutdown work must assign one signal owner, make sleep interruptible, and define +how an active exact child is drained or terminalized before claiming closure. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index f4e97082..06bbff40 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1,5 +1,39 @@ # Fresh workspace handoff +## Resident continuity, topology repair, and build-free status — 2026-08-09 + +Authenticated release `sha256-d1392730...` is now the running c005 body. The +old body and the first replacement container are retained as rollback receipts. +Both Docker stops sent SIGTERM and ended in exit 137 after timeout, proving that +`epiphany-swarm serve` has no graceful signal owner even while idle. + +The first replacement preserved resident Self revision 6, sleeping state, no +active turn, and no prepared recovery, but native status exposed a live topology +fault: resident Self used `/state/runtime.cc`, whose next action was +`launchResearch`, while the accepted coordinated cognition chain lives in +`/state/eyes-tools/runtime.cc`. The resident was rebound without copying or +merging state. Release authentication remains `/state/local-verse.cc`; runtime, +coordination Verse, and Mind now use the established `/state/eyes-tools/` +stores. The current container ID begins `f0303137`; rollback container +`epiphany-linux-resident-self-c005-wrong-runtime-0934` preserves the bad binding. + +Post-rebind operator projection derives `awaitFrontierProposal`, terminal +frontier planning, accepted Research, and `modelingResultAcceptedAfterResearch`. +Route `817bf422...` appears only as the route named by relinquishment receipt +`repo-frontier-relinquishment-7b846272...`; it is not actionable or recreated. +The obsolete root runtime hash remained +`c10caa321322632111a4e8f69550be4c799d78c92a78780a3066bbf6ad0a7c7c`. + +The diagnostic itself exposed hidden build authority: standalone +`epiphany-mvp-status` invoked Cargo whenever optional Heartbeat/Persona/Void +helpers were absent. That fallback is deleted. Optional panels now report +unavailable, `--coordinator-only` performs the exact routing read, and status is +the 24th explicit packaged binary. Heavy OpenAI and MCP runtime dependencies are +feature-admitted so coordinator/status iteration does not compile them. Focused +proof passes 19/19 release tests and 3/3 status tests; warm runs complete in +about 1-4 seconds. Exact 24-binary packaging remains next, followed by graceful +shutdown ownership, restart proof, retention, logs, and endurance. + ## Deterministic warm release published — 2026-08-09 Exact pushed source `9b8df0b487eaae12e35dbe53a82faae1a1e39954` diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 2118ded94bee88974ebcc3e9b8e0301da1bd9725..d04587088804f9734228993e17fe44d51c1c3d5e 100644 GIT binary patch delta 746 zcmZWnKZ_GV6nCSZ0SnCfzHx2& zJ+hC`sT_?5nIyMClzzq=C56WvGRkYPSZE<}9(oFk4sFGyJ=9Y!Rmv$cFa#kjIR}10 zFcUThJXGG@0V>c6Pd2CI?&ckogij@IaZo1A@;qNul8hT8A*TGzaH}MzBPl zm&BvN(*_|~<%L%j0@mnaPo&*R%R>1Xl}v|gNSN6T-!_1B~3mG%ajMK6?bjHUDl4hmy}um_|k0M7-i$ZFde1c z|HWq0UcbHCx^;Jt!SH~>(leAkD3_H==clA@W#s*Qx7&v}6ZdPV2WMs^0p32ldm5C9EK{PWEvj8zG5VHX> L`}V0!9Q?lk