diff --git a/epiphany-core/src/bin/epiphany-daemon-survival-rehearsal-smoke.rs b/epiphany-core/src/bin/epiphany-daemon-survival-rehearsal-smoke.rs new file mode 100644 index 00000000..4d5502c3 --- /dev/null +++ b/epiphany-core/src/bin/epiphany-daemon-survival-rehearsal-smoke.rs @@ -0,0 +1,334 @@ +use anyhow::Context; +use anyhow::Result; +use anyhow::anyhow; +use chrono::Utc; +use serde_json::Value; +use serde_json::json; +use std::env; +use std::fs; +use std::path::Path; +use std::path::PathBuf; +use std::process::Command; + +fn main() -> Result<()> { + let args = Args::parse()?; + let result = run_smoke(args)?; + println!("{}", serde_json::to_string_pretty(&result)?); + Ok(()) +} + +#[derive(Clone, Debug)] +struct Args { + root: PathBuf, + smoke_root: PathBuf, +} + +impl Args { + fn parse() -> Result { + let mut root = env::current_dir().context("failed to resolve current directory")?; + let mut smoke_root = root.join(".epiphany-smoke"); + let mut args = env::args().skip(1).peekable(); + while let Some(arg) = args.next() { + match arg.as_str() { + "--root" => root = take_path(&mut args, "--root")?, + "--smoke-root" => smoke_root = take_path(&mut args, "--smoke-root")?, + other => return Err(anyhow!("unexpected argument {other:?}")), + } + } + Ok(Self { root, smoke_root }) + } +} + +fn run_smoke(args: Args) -> Result { + let root = args + .root + .canonicalize() + .with_context(|| format!("failed to resolve {}", args.root.display()))?; + let manifest = root.join("epiphany-core").join("Cargo.toml"); + if !manifest.exists() { + return Err(anyhow!( + "could not find epiphany-core manifest at {}", + manifest.display() + )); + } + fs::create_dir_all(&args.smoke_root) + .with_context(|| format!("failed to create {}", args.smoke_root.display()))?; + let stamp = Utc::now().format("%Y%m%d-%H%M%S").to_string(); + let smoke_dir = args + .smoke_root + .join(format!("daemon-survival-rehearsal-{stamp}")); + if smoke_dir.exists() { + fs::remove_dir_all(&smoke_dir) + .with_context(|| format!("failed to clear {}", smoke_dir.display()))?; + } + fs::create_dir_all(&smoke_dir) + .with_context(|| format!("failed to create {}", smoke_dir.display()))?; + + let local_verse = smoke_dir.join("local-verse.ccmp"); + let runtime_id = "epiphany-local"; + let daemon_id = "epiphany-daemon-self"; + let scheduler_id = "epiphany-daemon-survival-rehearsal"; + let restart_command = if cfg!(windows) { + "powershell.exe" + } else { + "sh" + }; + let restart_args = if cfg!(windows) { + vec!["-NoProfile", "-Command", "exit 0"] + } else { + vec!["-c", "exit 0"] + }; + + let mut policy_args = vec![ + "policy", + "--store", + path_str(&local_verse)?, + "--runtime-id", + runtime_id, + "--daemon-id", + daemon_id, + "--scheduler-id", + scheduler_id, + "--restart-command", + restart_command, + "--cwd", + path_str(&root)?, + "--cooldown-seconds", + "0", + "--reconcile-interval-seconds", + "0", + "--heartbeat-stale-seconds", + "3600", + ] + .into_iter() + .map(str::to_string) + .collect::>(); + for arg in &restart_args { + policy_args.push("--restart-arg".to_string()); + policy_args.push((*arg).to_string()); + } + let policy = cargo_json( + &manifest, + "epiphany-daemon-supervisor", + &string_refs(&policy_args), + &root, + )?; + + let serve_args = vec![ + "serve", + "--store", + path_str(&local_verse)?, + "--runtime-id", + runtime_id, + "--daemon-id", + daemon_id, + "--scheduler-id", + scheduler_id, + "--loop-interval-seconds", + "0", + "--max-iterations", + "2", + "--force", + ] + .into_iter() + .map(str::to_string) + .collect::>(); + let serve = cargo_json( + &manifest, + "epiphany-daemon-supervisor", + &string_refs(&serve_args), + &root, + )?; + + require_eq(&policy, &["status"], "written")?; + require_eq(&policy, &["daemonId"], daemon_id)?; + require_bool(&policy, &["privateStateExposed"], false)?; + require_eq(&serve, &["status"], "serveComplete")?; + require_u64(&serve, &["iterations"], 2)?; + require_bool(&serve, &["privateStateExposed"], false)?; + let outputs = serve + .get("outputs") + .and_then(Value::as_array) + .ok_or_else(|| anyhow!("serve output missing outputs array"))?; + if outputs.len() != 2 { + return Err(anyhow!("expected 2 serve outputs, got {}", outputs.len())); + } + for (idx, output) in outputs.iter().enumerate() { + require_eq(output, &["status"], "tickComplete")?; + require_eq(output, &["schedulerId"], scheduler_id)?; + require_u64(output, &["iteration"], (idx + 1) as u64)?; + require_u64(output, &["outcomeCount"], 1)?; + require_u64(output, &["restartedCount"], 1)?; + require_u64(output, &["refusedCount"], 0)?; + require_bool(output, &["privateStateExposed"], false)?; + let outcomes = output + .get("outcomes") + .and_then(Value::as_array) + .ok_or_else(|| anyhow!("tick output missing outcomes array"))?; + let outcome = outcomes + .first() + .ok_or_else(|| anyhow!("tick output missing first outcome"))?; + require_eq(outcome, &["status"], "restarted")?; + require_eq(outcome, &["daemonId"], daemon_id)?; + require_bool(outcome, &["privateStateExposed"], false)?; + } + + let receipt_directory = cargo_json( + &manifest, + "epiphany-verse-query", + &[ + "receipt-directory", + "--store", + path_str(&local_verse)?, + "--runtime-id", + runtime_id, + ], + &root, + )?; + require_bool(&receipt_directory, &["privateStateExposed"], false)?; + let scheduler_row = rows(&receipt_directory) + .iter() + .find(|row| row.get("family").and_then(Value::as_str) == Some("scheduler")) + .cloned() + .ok_or_else(|| anyhow!("receipt directory did not expose scheduler row"))?; + require_eq(&scheduler_row, &["status"], "tickComplete")?; + require_eq(&scheduler_row, &["route"], daemon_id)?; + require_bool(&scheduler_row, &["privateStateExposed"], false)?; + + let summary = json!({ + "schemaVersion": "epiphany.daemon_survival_rehearsal_smoke.v0", + "status": "ok", + "smokeDir": smoke_dir, + "localVerseStore": local_verse, + "runtimeId": runtime_id, + "daemonId": daemon_id, + "schedulerId": scheduler_id, + "policyStatus": policy["status"], + "policyId": policy["policyId"], + "serveStatus": serve["status"], + "serveIterations": serve["iterations"], + "schedulerReceiptId": scheduler_row["latestId"], + "schedulerReceiptStatus": scheduler_row["status"], + "restartCommand": restart_command, + "restartArgs": restart_args, + "boundedProofMode": true, + "serviceManagerMutated": false, + "requiresElevatedAuthority": false, + "unattendedDaemonSurvivalRehearsed": true, + "privateStateExposed": false, + }); + write_json(&smoke_dir.join("summary.json"), &summary)?; + Ok(summary) +} + +fn cargo_json(manifest: &Path, bin: &str, args: &[&str], cwd: &Path) -> Result { + let output = Command::new("cargo") + .arg("run") + .arg("--quiet") + .arg("--manifest-path") + .arg(manifest) + .arg("--bin") + .arg(bin) + .arg("--") + .args(args) + .current_dir(cwd) + .output() + .with_context(|| format!("failed to run cargo bin {bin}"))?; + if !output.status.success() { + return Err(anyhow!( + "{bin} failed with status {:?}\nstdout:\n{}\nstderr:\n{}", + output.status.code(), + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr) + )); + } + serde_json::from_slice(&output.stdout).with_context(|| { + format!( + "{bin} did not emit JSON on stdout:\n{}", + String::from_utf8_lossy(&output.stdout) + ) + }) +} + +fn string_refs(args: &[String]) -> Vec<&str> { + args.iter().map(String::as_str).collect() +} + +fn rows(value: &Value) -> Vec<&Value> { + value + .get("rows") + .and_then(Value::as_array) + .map(|rows| rows.iter().collect()) + .unwrap_or_default() +} + +fn write_json(path: &Path, value: &Value) -> Result<()> { + if let Some(parent) = path.parent() { + fs::create_dir_all(parent) + .with_context(|| format!("failed to create {}", parent.display()))?; + } + fs::write(path, serde_json::to_vec_pretty(value)?) + .with_context(|| format!("failed to write {}", path.display())) +} + +fn require_eq(value: &Value, path: &[&str], expected: &str) -> Result<()> { + let actual = path + .iter() + .try_fold(value, |current, key| current.get(*key)) + .and_then(Value::as_str) + .unwrap_or(""); + if actual == expected { + Ok(()) + } else { + Err(anyhow!( + "expected {} to be {expected:?}, got {actual:?}", + path.join(".") + )) + } +} + +fn require_bool(value: &Value, path: &[&str], expected: bool) -> Result<()> { + let actual = path + .iter() + .try_fold(value, |current, key| current.get(*key)) + .and_then(Value::as_bool); + if actual == Some(expected) { + Ok(()) + } else { + Err(anyhow!( + "expected {} to be {expected}, got {:?}", + path.join("."), + actual + )) + } +} + +fn require_u64(value: &Value, path: &[&str], expected: u64) -> Result<()> { + let actual = path + .iter() + .try_fold(value, |current, key| current.get(*key)) + .and_then(Value::as_u64); + if actual == Some(expected) { + Ok(()) + } else { + Err(anyhow!( + "expected {} to be {expected}, got {:?}", + path.join("."), + actual + )) + } +} + +fn take_path( + args: &mut std::iter::Peekable>, + flag: &str, +) -> Result { + args.next() + .map(PathBuf::from) + .with_context(|| format!("missing value for {flag}")) +} + +fn path_str(path: &Path) -> Result<&str> { + path.to_str() + .ok_or_else(|| anyhow!("path is not valid UTF-8: {}", path.display())) +} diff --git a/epiphany-core/src/bin/epiphany-repo-swarm-mvp-gate-smoke.rs b/epiphany-core/src/bin/epiphany-repo-swarm-mvp-gate-smoke.rs index 4a50dda0..e62514c5 100644 --- a/epiphany-core/src/bin/epiphany-repo-swarm-mvp-gate-smoke.rs +++ b/epiphany-core/src/bin/epiphany-repo-swarm-mvp-gate-smoke.rs @@ -23,6 +23,7 @@ struct Args { fresh_repo_summary: Option, readiness_summary: Option, bifrost_accounting_summary: Option, + daemon_survival_summary: Option, } impl Args { @@ -32,6 +33,7 @@ impl Args { let mut fresh_repo_summary = None; let mut readiness_summary = None; let mut bifrost_accounting_summary = None; + let mut daemon_survival_summary = None; let mut args = env::args().skip(1).peekable(); while let Some(arg) = args.next() { match arg.as_str() { @@ -47,6 +49,10 @@ impl Args { bifrost_accounting_summary = Some(take_path(&mut args, "--bifrost-accounting-summary")?) } + "--daemon-survival-summary" => { + daemon_survival_summary = + Some(take_path(&mut args, "--daemon-survival-summary")?) + } other => return Err(anyhow!("unexpected argument {other:?}")), } } @@ -56,6 +62,7 @@ impl Args { fresh_repo_summary, readiness_summary, bifrost_accounting_summary, + daemon_survival_summary, }) } } @@ -92,14 +99,19 @@ fn run_smoke(args: Args) -> Result { let bifrost_accounting_summary = args .bifrost_accounting_summary .unwrap_or_else(|| latest_summary(&args.smoke_root, "repo-bifrost-accounting-bundle-")); + let daemon_survival_summary = args + .daemon_survival_summary + .unwrap_or_else(|| latest_summary(&args.smoke_root, "daemon-survival-rehearsal-")); let fresh = read_json(&fresh_repo_summary)?; let readiness = read_json(&readiness_summary)?; let bifrost = read_json(&bifrost_accounting_summary)?; + let daemon_survival = read_json(&daemon_survival_summary)?; verify_fresh_repo(&fresh)?; verify_readiness(&readiness)?; verify_bifrost_accounting(&bifrost)?; + verify_daemon_survival(&daemon_survival)?; let gate_rows = vec![ green( @@ -149,16 +161,16 @@ fn run_smoke(args: Args) -> Result { "Bifrost", "readiness, artifact acceptance, and metrics accounting rows are closed", ), + green( + "long-running-daemon-proof", + "Idunn", + "bounded serve rehearsal wrote two scheduler pulses and sealed scheduler receipt", + ), warning( "idunn-elevated-service", "Idunn", "service install/start/remote deployment execution remains explicit operator authority", ), - warning( - "long-running-daemon-proof", - "Idunn", - "unattended daemon survival is planned and audited but not yet a green MVP gate", - ), ]; let green_gate_count = gate_rows .iter() @@ -192,9 +204,11 @@ fn run_smoke(args: Args) -> Result { "freshRepoSummary": fresh_repo_summary, "readinessSummary": readiness_summary, "bifrostAccountingSummary": bifrost_accounting_summary, + "daemonSurvivalSummary": daemon_survival_summary, "freshRepoSmokeDir": fresh["smokeDir"], "readinessSmokeDir": readiness["smokeDir"], "bifrostAccountingSmokeDir": bifrost["smokeDir"], + "daemonSurvivalSmokeDir": daemon_survival["smokeDir"], "mvpReady": false, "demoReady": true, "greenGateCount": green_gate_count, @@ -203,8 +217,7 @@ fn run_smoke(args: Args) -> Result { "gateRows": gate_rows, "gateTuiRows": gate_tui_rows, "knownRemainingAuthorityGates": [ - "Idunn elevated service install/start/remote deployment execution", - "unattended long-running daemon survival proof" + "Idunn elevated service install/start/remote deployment execution" ], "privateStateExposed": false, }); @@ -302,6 +315,23 @@ fn verify_bifrost_accounting(value: &Value) -> Result<()> { ) } +fn verify_daemon_survival(value: &Value) -> Result<()> { + require_eq( + value, + &["schemaVersion"], + "epiphany.daemon_survival_rehearsal_smoke.v0", + )?; + require_eq(value, &["status"], "ok")?; + require_eq(value, &["policyStatus"], "written")?; + require_eq(value, &["serveStatus"], "serveComplete")?; + require_eq(value, &["schedulerReceiptStatus"], "tickComplete")?; + require_bool(value, &["boundedProofMode"], true)?; + require_bool(value, &["serviceManagerMutated"], false)?; + require_bool(value, &["requiresElevatedAuthority"], false)?; + require_bool(value, &["unattendedDaemonSurvivalRehearsed"], true)?; + require_bool(value, &["privateStateExposed"], false) +} + fn green(gate: &str, owner: &str, evidence: &str) -> Value { json!({ "gate": gate, diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index f43881c8..1938c782 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -193,7 +193,8 @@ remembers doctrine; the branch remembers the blade. - `collaboration-feedback` is the compact public-feedback actuator; use it after or instead of manual `eve-connect` when Persona/human discussion should be routed to Imagination consensus discovery as typed local Verse receipts. Its JSON now points the next agent at Eve and Bifrost follow-on rites. - `bifrost-publication` is the compact non-mutating Bifrost publication proof; use it to prove body-change routing, credit, and GitHub publication receipt state without performing GitHub mutation. Its JSON now points back to compact swarm overview and tool-directory readback. - `bifrost-artifact-acceptance` and `bifrost-metrics` are compact Bifrost/Maintainer closure rites for the safe-family planning/accounting lanes. They write typed accepted-artifact and metrics receipts from explicit artifact/public-proof/review/model-spend/review-load/credit refs, verify latest receipt readback, and let `bifrost-ledger` close `artifact-acceptance-request` and `metrics-request` rows from Bifrost-owned receipts instead of request cargo. The request-family smokes now prove both states: `.epiphany-smoke\repo-artifact-acceptance-request-family-20260621-130520` and `.epiphany-smoke\repo-metrics-request-family-20260621-130635` first assert open request rows, then write final receipts and assert closed rows; wrapper proof `local-20260621-140740-750-2815f6f7` read the closed metrics row with `privateStateExposed=False`. `epiphany-repo-bifrost-accounting-bundle-smoke` consumes the closed family summaries and emits one operator-safe aggregate receipt; wrapper mode `tools/epiphany_local_run.ps1 -Mode bifrost-accounting-bundle` now builds/runs that verifier, accepts optional exact summary paths, writes normal operator run receipts, and proved bundle `.epiphany-smoke\repo-bifrost-accounting-bundle-20260621-132815` via wrapper artifact `local-20260621-142716-268-d6bc58b4` with final Bifrost receipt ids, `planningAuthorityOnly=true`, and `privateStateExposed=false`. -- `repo-swarm-mvp-gate` is the compact aggregate MVP proof rite. `epiphany-repo-swarm-mvp-gate-smoke` consumes the latest fresh-repo MVP, repo-work readiness, and Bifrost accounting-bundle summaries, verifies the green proof rows, and leaves Idunn elevated service execution plus unattended daemon survival as explicit warning gates instead of laundering them into completion. Wrapper mode `tools/epiphany_local_run.ps1 -Mode repo-swarm-mvp-gate` proved `.epiphany-smoke\repo-swarm-mvp-gate-20260621-134522` via wrapper artifact `local-20260621-144521-724-cdadf70f`: `demoReady=True`, `mvpReady=False`, `green=11`, `warnings=2`, `blockers=0`, and `privateStateExposed=False`. +- `daemon-survival-rehearsal` is the bounded Idunn physiology proof. `epiphany-daemon-survival-rehearsal-smoke` writes a durable restart policy for `epiphany-daemon-self`, runs `epiphany-daemon-supervisor serve --max-iterations 2 --force --loop-interval-seconds 0`, verifies two scheduler pulses and the scheduler receipt row, and keeps service-manager mutation/elevation/private-state exposure false. Wrapper proof `tools/epiphany_local_run.ps1 -Mode daemon-survival-rehearsal -SkipBuild` emitted `.epiphany-smoke\daemon-survival-rehearsal-20260621-135723` via artifact `local-20260621-145723-011-1175e273`. +- `repo-swarm-mvp-gate` is the compact aggregate MVP proof rite. `epiphany-repo-swarm-mvp-gate-smoke` consumes the latest fresh-repo MVP, repo-work readiness, Bifrost accounting-bundle, and daemon survival summaries, verifies the green proof rows, and leaves only Idunn elevated service execution as an explicit warning gate instead of laundering it into completion. Wrapper mode `tools/epiphany_local_run.ps1 -Mode repo-swarm-mvp-gate` proved `.epiphany-smoke\repo-swarm-mvp-gate-20260621-135754` via wrapper artifact `local-20260621-145752-946-d1d4d118`: `demoReady=True`, `mvpReady=False`, `green=12`, `warnings=1`, `blockers=0`, and `privateStateExposed=False`. - `bifrost-ledger` is the compact Bifrost/Imagination readback rite; use it after collaboration, publication, accepted-artifact, or metrics writes to see the latest body-change, public-proof, accepted-artifact, metrics, GitHub, feedback, consensus, credit/review-count, and accounting closure rows without opening the full local Verse. - `tool-directory` is the non-mutating daemon tool sight rite; it shows which globally available daemon-hosted tools any agent can invoke through typed intents and receipts, while still exposing host readiness. - `tool-invoke` now embeds compact readbacks for common daemon-hosted tools. Status calls return `daemonStatusReadback`, Eve calls return `eveConnectionReadback`, Self `service-health` returns Idunn-owned `serviceHealthReadback`, Self `service-policy-directory` returns Idunn-owned `servicePolicyDirectoryReadback`, Self `swarm-online-runbook` returns Idunn-owned `swarmOnlineRunbookReadback`, and Hands/Soul authority tools return `authorityToolReadback` with gate, input contract, receipt contract, intent/receipt routes, host cluster, and private-state seal. This proves global tool ergonomics without moving action, verification, or daemon lifecycle ownership into the wrapper; live proofs routed Persona to Hands `repo-action` (`local-20260619-021628-143-7bf7f2e0`), Soul `verify` (`local-20260619-021701-458-852cfa6f`), Self `swarm-online-runbook` (`local-20260619-032244-273-acb3c6a4`), and Self `service-policy-directory` (`local-20260619-035238-138-633f3ff0`) with `privateStateExposed=false`. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 7747b1ba..69b8e028 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 9ebd2a75..cf36bd29 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -627,7 +627,7 @@ current_status: - `epiphany-verse-query connect-eve` and `tools/epiphany_local_run.ps1 -Mode eve-connect` provide the compact Odin-to-Eve collaboration receipt. The command selects the daemon-published surface through the narrow Eve directory, writes connection intent/receipt documents, verifies latest receipt keys through narrow CultMesh loaders, defaults the wrapper target to `epiphany.cluster.persona`, and exposes no private state. - `epiphany-verse-query collaboration-feedback` and `tools/epiphany_local_run.ps1 -Mode collaboration-feedback` provide the public Persona feedback to Imagination consensus receipt path. The wrapper records the prerequisite Eve connection receipt, writes feedback plus Imagination consensus receipt documents, verifies latest keys through narrow CultMesh loaders, publishes follow-on command hints for wrapper feedback, Eve connection, direct Bifrost publication, and wrapper Bifrost publication, and exposes no private state. The command returns compact TUI rows for the feedback and Imagination consensus receipt with explicit `owner=Persona->Imagination` / `owner=Imagination`, `public=`, candidate action refs, consensus packet ref, adoption gate, and `private=false`; wrapper proof `local-20260618-224207-941-2ca01b41` prints both rows in `feedbackRows`, including Persona public discussion feedback routed to Imagination consensus discovery before Mind/Bifrost adoption. - `epiphany-verse-query bifrost-publication` and `tools/epiphany_local_run.ps1 -Mode bifrost-publication` provide the non-mutating Bifrost body-change publication proof path. It writes Bifrost intent, Bifrost publication receipt, and GitHub publication receipt documents from explicit review/verification/credit inputs, verifies latest keys through narrow CultMesh loaders, publishes follow-on command hints for swarm overview, tool directory, and wrapper Bifrost publication readback, and exposes no private state. - - `epiphany-verse-query bifrost-ledger` and `tools/epiphany_local_run.ps1 -Mode bifrost-ledger` provide the compact Bifrost ledger sight organ. It reads only the latest Bifrost body-change intent, Bifrost publication receipt, GitHub publication receipt, public-proof publication receipt, artifact-acceptance receipt, metrics receipt, repo-work readiness-review receipt, collaboration feedback, Imagination consensus receipt, and Mind-admitted repo-work map entries through narrow CultMesh loaders, returns agent-friendly ledger TUI rows, publishes follow-on command hints for swarm overview, tool directory, collaboration feedback, Bifrost publication, artifact acceptance, metrics, and ledger readback, and exposes no private state. Compact ledger rows carry explicit `owner=`, `public=`, and `private=false`, so body-change/public-feedback proof is inspectable without opening raw local Verse payloads or inferring authority from document names. Bifrost ledger readback derives six `BIFROST-ACCOUNTING` rows for `body-change-publication`, `public-proof-publication`, `repo-work-readiness-review`, `artifact-acceptance-request`, `metrics-request`, and `collaboration-consensus`, with closure status, ledger/receipt/public refs, review and credit receipt counts, artifact count, and private-state seal. Readiness-review accounting closes only when latest `epiphany.cultmesh.repo_work_readiness_review.v0` has four Maintainer/Soul/Mind/Bifrost review refs, readiness approval, zero missing required rows, present review artifact, and no durable-state/publication/merge/sync/deployment/service/Hands/private authority. Artifact-acceptance and metrics request rows are `open` when only Mind-admitted request map entries exist, and close only from typed Bifrost/Maintainer receipts: `epiphany-verse-query bifrost-artifact-acceptance` writes `gamecult.bifrost.artifact_acceptance_receipt` from explicit artifact/public-proof/ledger/review refs, while `epiphany-verse-query bifrost-metrics` writes `gamecult.bifrost.metrics_receipt` from explicit accepted-artifact, model-spend, review-load, credit-readback, public-proof, and metrics summary refs. Wrapper modes `bifrost-artifact-acceptance` and `bifrost-metrics` expose the same closure rites. Focused smokes `.epiphany-smoke\repo-artifact-acceptance-request-family-20260621-130520` and `.epiphany-smoke\repo-metrics-request-family-20260621-130635` now prove request rows open first and then close from final Bifrost receipts without private-state exposure; wrapper proof `local-20260621-140740-750-2815f6f7` printed the closed metrics row from the repo-local Verse target. `epiphany-repo-bifrost-accounting-bundle-smoke` consumes the closed request-family summaries as an operator-safe aggregate proof, and `tools/epiphany_local_run.ps1 -Mode bifrost-accounting-bundle` now wraps that verifier with optional exact summary path inputs and the normal operator run receipts. Wrapper proof `local-20260621-142716-268-d6bc58b4` built the verifier, emitted bundle `.epiphany-smoke\repo-bifrost-accounting-bundle-20260621-132815`, and verified artifact acceptance and metrics close statuses, final Bifrost receipt ids, closed accounting rows, `planningAuthorityOnly=true`, and `privateStateExposed=false`. `epiphany-repo-swarm-mvp-gate-smoke` now consumes the fresh-repo MVP, repo-work readiness, and Bifrost accounting-bundle summaries as one operator-safe MVP gate report; wrapper mode `tools/epiphany_local_run.ps1 -Mode repo-swarm-mvp-gate` proved `demoReady=true`, `mvpReady=false`, eleven green gates, two Idunn warning gates, zero blockers, and `privateStateExposed=false` in `.epiphany-smoke\repo-swarm-mvp-gate-20260621-134522` / wrapper artifact `local-20260621-144521-724-cdadf70f`. + - `epiphany-verse-query bifrost-ledger` and `tools/epiphany_local_run.ps1 -Mode bifrost-ledger` provide the compact Bifrost ledger sight organ. It reads only the latest Bifrost body-change intent, Bifrost publication receipt, GitHub publication receipt, public-proof publication receipt, artifact-acceptance receipt, metrics receipt, repo-work readiness-review receipt, collaboration feedback, Imagination consensus receipt, and Mind-admitted repo-work map entries through narrow CultMesh loaders, returns agent-friendly ledger TUI rows, publishes follow-on command hints for swarm overview, tool directory, collaboration feedback, Bifrost publication, artifact acceptance, metrics, and ledger readback, and exposes no private state. Compact ledger rows carry explicit `owner=`, `public=`, and `private=false`, so body-change/public-feedback proof is inspectable without opening raw local Verse payloads or inferring authority from document names. Bifrost ledger readback derives six `BIFROST-ACCOUNTING` rows for `body-change-publication`, `public-proof-publication`, `repo-work-readiness-review`, `artifact-acceptance-request`, `metrics-request`, and `collaboration-consensus`, with closure status, ledger/receipt/public refs, review and credit receipt counts, artifact count, and private-state seal. Readiness-review accounting closes only when latest `epiphany.cultmesh.repo_work_readiness_review.v0` has four Maintainer/Soul/Mind/Bifrost review refs, readiness approval, zero missing required rows, present review artifact, and no durable-state/publication/merge/sync/deployment/service/Hands/private authority. Artifact-acceptance and metrics request rows are `open` when only Mind-admitted request map entries exist, and close only from typed Bifrost/Maintainer receipts: `epiphany-verse-query bifrost-artifact-acceptance` writes `gamecult.bifrost.artifact_acceptance_receipt` from explicit artifact/public-proof/ledger/review refs, while `epiphany-verse-query bifrost-metrics` writes `gamecult.bifrost.metrics_receipt` from explicit accepted-artifact, model-spend, review-load, credit-readback, public-proof, and metrics summary refs. Wrapper modes `bifrost-artifact-acceptance` and `bifrost-metrics` expose the same closure rites. Focused smokes `.epiphany-smoke\repo-artifact-acceptance-request-family-20260621-130520` and `.epiphany-smoke\repo-metrics-request-family-20260621-130635` now prove request rows open first and then close from final Bifrost receipts without private-state exposure; wrapper proof `local-20260621-140740-750-2815f6f7` printed the closed metrics row from the repo-local Verse target. `epiphany-repo-bifrost-accounting-bundle-smoke` consumes the closed request-family summaries as an operator-safe aggregate proof, and `tools/epiphany_local_run.ps1 -Mode bifrost-accounting-bundle` now wraps that verifier with optional exact summary path inputs and the normal operator run receipts. Wrapper proof `local-20260621-142716-268-d6bc58b4` built the verifier, emitted bundle `.epiphany-smoke\repo-bifrost-accounting-bundle-20260621-132815`, and verified artifact acceptance and metrics close statuses, final Bifrost receipt ids, closed accounting rows, `planningAuthorityOnly=true`, and `privateStateExposed=false`. `epiphany-daemon-survival-rehearsal-smoke` now proves Idunn's bounded `serve` physiology can consume a durable restart policy, run two scheduler pulses, write scheduler receipts, and keep service-manager mutation/elevation/private-state exposure false; wrapper proof `local-20260621-145723-011-1175e273` emitted `.epiphany-smoke\daemon-survival-rehearsal-20260621-135723` with `serveIterations=2` and scheduler receipt `daemon-scheduler-receipt-epiphany-daemon-survival-rehearsal-2`. `epiphany-repo-swarm-mvp-gate-smoke` now consumes the fresh-repo MVP, repo-work readiness, Bifrost accounting-bundle, and daemon survival summaries as one operator-safe MVP gate report; wrapper mode `tools/epiphany_local_run.ps1 -Mode repo-swarm-mvp-gate` proved `demoReady=true`, `mvpReady=false`, twelve green gates, one Idunn elevated-service warning gate, zero blockers, and `privateStateExposed=false` in `.epiphany-smoke\repo-swarm-mvp-gate-20260621-135754` / wrapper artifact `local-20260621-145752-946-d1d4d118`. - `epiphany-verse-query receipt-directory` and `tools/epiphany_local_run.ps1 -Mode receipt-directory` provide the compact latest-witness directory over local Verse. It indexes operator run, daemon poke, daemon tool invocation, Eve connection, Bifrost publication, Imagination consensus, coordinator run, Hands gate, role review, work-loop, cluster service lifecycle, single-service lifecycle, cluster service execution runbook, single-service execution runbook, scheduler, Persona speech, and agent-state SoA witness families from typed local Verse projections; returns agent-friendly `OK`/`ABSENT`/`ATTN` TUI rows with owner, family, status, route, latest id, follow-up command, `presentRowCount`, and `absentRowCount`; preserves `missingRowCount` as compatibility for absent witnesses; flags sealed service lifecycle failure states such as `not-elevated`, `execution-refused-not-elevated`, and `incomplete` as attention without exposing receipt payloads; routes service lifecycle receipts by their typed receipt action through `service_execution_check_follow_up_command` (readiness to readiness, install to install execute, start/stop to control execute, status/reconcile to their readback rites, audit to audit), while cluster/single execution-runbook witnesses route to their runbook regeneration wrappers; and exposes no private state or receipt payload previews. The lifecycle projection now reads the typed receipt family, splits `cluster-service-lifecycle` from `service-lifecycle`, selects the latest attention receipt before falling back to latest overall, and exposes `service-id::action` route values such as `epiphany-cluster-daemon-services::cluster-windows-service-execution-audit`, so agents can see the owning lifecycle action without opening raw audit JSON. Compact receipt TUI rows append `followUp=`, artifact status, and SHA-256; wrapper proof `local-20260618-205920-451-383b0da7` now prints all seventeen compact rows in `receiptRows`, including missing Hands/role/work-loop gates, runbook hashes, scheduler follow-up, Bifrost/Imagination witnesses, and the active service lifecycle attention rows. It also exposes `cluster-service-execution-runbook` plus `service-execution-runbook` as display-only rows, so newer harmless planned/runbook lifecycle receipts cannot hide the active seven-service cluster wound. Receipt-directory JSON now carries Rust-owned `attentionRouteRows` derived from the same policy predicate as `attentionRowCount`, and the wrapper prints that field instead of rebuilding attention from ad hoc status strings; source smoke now proves a `cluster-windows-service-execution-readiness` receipt routes to `cluster-service-execution-readiness` and wrapper mode `cluster-service-execution-readiness` instead of laundering the row through audit. Live proof `local-20260618-212134-758-c7c56240` left the old degraded Hands daemon-poke receipt as an `OK` historical witness while attention routes named only the cluster and single-service lifecycle wounds. Daemon-poke rows now resolve historical receipt status against current daemon liveness: source smoke proves degraded remains degraded before heartbeat recovery and becomes `resolved` after current status returns ready, while live wrapper proof `local-20260618-212649-563-48647018` printed the old Hands poke receipt as `OK | Self | daemon-poke | resolved`. - `tools/epiphany_local_run.ps1 -Mode service-tick` is the wrapper-owned daemon scheduler pulse rite. It runs `epiphany-daemon-supervisor tick` through the same local Verse store, operator run intent/receipt, agent-state SoA refresh, and swarm-brake preflight as other service lifecycle modes, but leaves restart authority inside durable daemon restart policies. The receipt directory scheduler row now follows up with `tools/epiphany_local_run.ps1 -Mode service-tick` instead of passive service status. Proof seeded one disabled Persona restart policy as inert policy metadata, then the wrapper wrote `daemon-scheduler-receipt-epiphany-daemon-supervisor-0` with `status=tickComplete`, `outcomeCount=1`, `skippedCount=1`, `restartedCount=0`, `refusedCount=0`, and `privateStateExposed=false`; the follow-up receipt-directory proof reported the scheduler row as present with route `*`, follow-up command `service-tick`, and no private-state exposure. - `epiphany-cluster-daemon` is the first real per-cluster daemon heartbeat body. It runs as a narrow Rust binary parameterized by daemon id, publishes typed `epiphany.cultmesh.daemon_status.v0` heartbeats into the shared local Verse, can run once or loop, and exposes no private state. Durable restart policies for Self, Hands, Persona, Imagination, Eyes, Modeling, and Soul now invoke `epiphany-cluster-daemon heartbeat`, not the generic query/debug writer. A degraded proof showed `service-tick` invoking all seven daemon bodies through the supervisor and restoring ready liveness with sealed scheduler/poke receipts; a fresh tick no-ops when all heartbeats are current. `epiphany-daemon-supervisor cluster-service-runbook` and wrapper `-Mode cluster-service-runbook` write a non-mutating service runbook plus `daemon_service_lifecycle` receipt for all seven organ daemon `epiphany-cluster-daemon serve` commands. Direct `service-runbook` and `cluster-service-runbook` wrapper summaries now print local artifact SHA-256 plus follow-up/aftercare wrapper routes; live proofs `local-20260618-232133-314-4e55120e` and `local-20260618-232146-541-982dd60b` showed hashes `85a956f768e584a9d098f13a9bf03fc3560915821a2ae7eaab94889dd9ecda85` and `40616423a9210101486949d07291bf795175579a39e99de5e5a759f8e0d7a78c` without service mutation. Wrapper `service-plan` and `service-launch` now expose the native daemon-supervisor service lifecycle surfaces under the same brake gate; `service-launch` silences child stdout/stderr so the parent lifecycle receipt remains the only stdout JSON. Live proof `local-20260618-232935-349-7e3901c8` completed a bounded one-iteration launch with `exitCode=0` and no private-state exposure. `epiphany-daemon-supervisor cluster-service-install-plan` and wrapper `-Mode cluster-service-install-plan` write a non-mutating Windows install script plus lifecycle receipt for seven distinct per-organ Windows services. Wrapper `-Mode cluster-service-install-execute` requests execution through the same typed path and, in non-elevated shells, writes `execution-refused-not-elevated` with `executed=false` instead of mutating services. Direct cluster install wrapper summaries now include `artifactSha256=` and `followUp=tools/epiphany_local_run.ps1 -Mode cluster-service-install-execute`; live proofs `local-20260618-230937-335-71c4fdaa` and `local-20260618-230937-313-cb288388` showed the planned and non-elevated-refused cluster install artifact hash `c6b697e173eb319073da341fc90c2963bcd6bee63d804349205b6309c88df764`. `epiphany-daemon-supervisor cluster-service-audit` and wrapper `-Mode cluster-service-audit` read Windows service-manager state for those seven expected service names, writing an incomplete audit receipt when they are missing; direct audit summaries now point missing cluster services to `cluster-service-install-plan` plus `cluster-service-execution-audit` aftercare, with live proof `local-20260618-232200-992-b842ae01` reporting seven missing services and no mutation. `epiphany-daemon-supervisor cluster-service-start`/`cluster-service-stop` and wrapper `-Mode cluster-service-start-plan`, `cluster-service-stop-plan`, `cluster-service-start-execute`, and `cluster-service-stop-execute` record cluster lifecycle receipts for all seven services: plan modes emit seven `*-planned` rows without mutation, and explicit execute modes refuse as `execution-refused-not-elevated` with seven refused rows when the shell lacks service authority. The cluster install/audit/control wrapper summaries now print compact `serviceRows` for all seven daemon-owned Windows service names with daemon id, status or observed status, cluster id, executed flag, exit code, start type, and `private=false`; live proofs `local-20260618-211051-126-2a89d61c`, `local-20260618-211051-125-cd687ee2`, `local-20260618-211051-063-f0ff980d`, and `local-20260618-211118-108-df5cb8cd` show seven missing audit rows, seven ready/demand install-plan rows, seven start-planned rows, and seven stop-planned rows without service mutation. `cluster-service-execution-runbook` writes an admin-gated wrapper sequence for cluster-native readiness, cluster install, cluster start, cluster audit, cluster stop, and final cluster audit; the artifact now uses `Invoke-EpiphanyRunbookStep` to reset `$LASTEXITCODE`, catch thrown/nonzero failures, continue gathering receipts after a failed step, and always runs `cluster-service-execution-audit` from `finally`; generated child execution runbooks no longer use `Invoke-Expression`, and each step invokes the known wrapper `ScriptPath` with an explicit `Arguments` array. The wrapper calls `epiphany-daemon-supervisor cluster-service-execution-runbook` after artifact generation, so the runbook itself has a typed `daemon_service_lifecycle` receipt with action `cluster-windows-service-execution-runbook`, status `written`, artifact path, final-audit metadata, step-failure policy metadata, and `privateStateExposed=false`. Its wrapper JSON and typed receipt args expose `runbookTryModes`, `finalAuditMode=cluster-service-execution-audit`, `finalAuditRunsInFinally=true`, `stepFailurePolicy=continue-after-step-failure`, `continueAfterStepFailure=true`, `nonzeroExitFailsStep=true`, and `exitsNonzeroAfterFinalAudit=true`; direct wrapper summaries now print the exact `elevatedCommand=Start-Process PowerShell -Verb RunAs -Wait ...` invocation, `artifactSha256=`, and `aftercare=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`. Live proof `local-20260619-010940-407-b0744f08` generated the robust cluster artifact and printed hash `bf116ed4fd5bb2c9dc77f5032d19e792b012941a60b109389b79e5fcb0a2a5f6` without service mutation. `cluster-service-execution-audit` first requires the sealed `cluster-windows-service-execution-runbook` receipt, then checks the latest cluster-native readiness plus cluster install/start/audit/stop lifecycle receipts by receipt timestamp and reports `complete` only when the runbook and elevated effect receipts are sealed and successful. Audit check rows retain lifecycle `operatorArtifactRef`; wrapper summaries now print OK runbook witnesses with SHA-256 before compact failed-check anatomy. Live proof `local-20260618-170322-330-e6cb2117` printed `cluster-windows-service-execution-runbook=...\epiphany-cluster-daemon-services-execution-runbook.ps1:sha256=3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0` and the expected five failed checks without mutating Windows services. @@ -650,4 +650,4 @@ current_status: - Service lifecycle receipt history is now event-only: `load_epiphany_cultmesh_daemon_service_lifecycle_receipts` filters out the `epiphany-local/daemon-service-lifecycle-receipt/latest` mirror, while `load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt` remains the latest-state reader. Focused unit test `service_lifecycle_receipt_history_excludes_latest_mirror` proves two per-receipt writes return exactly two history records and latest points at the second. Fresh smoke `verse-query-lifecycle-history-filter-smoke` and live overview/triage `local-20260618-145632-497-efac6f0d` / `local-20260618-145632-321-867947af` prove compact swarm sights still expose service lifecycle attention plus the present elevated runbook artifact without daemon pokes or service mutation. Do not use a broad unscoped cargo test filter for this check on Windows; it fans out across bin harnesses and hit a broken pipe during this pass. - `epiphany-verse-query seed-compact` is the compact seed receipt for wrappers and read-only rites. The older `seed` command still prints the full local Verse context for explicit debugging, but compact wrapper modes now avoid full `seed`/final `query` readback after the combined overview proof exposed Windows debug stack overflow from full-context serialization pressure. last_completed_repo_swarm_cut: The artifact-acceptance and metrics request family smokes now prove the whole Bifrost accounting transition, not only the request side. Each smoke first asserts the Mind-admitted safe-family request row is `open`, then writes the final Bifrost/Maintainer receipt, rereads `bifrost-ledger`, and asserts the same lane is `closed` from explicit receipt evidence with `privateStateExposed=false`. Latest proofs `.epiphany-smoke\repo-artifact-acceptance-request-family-20260621-130520` and `.epiphany-smoke\repo-metrics-request-family-20260621-130635`; wrapper proof `local-20260621-140740-750-2815f6f7` printed the closed metrics row from a repo-local Verse target. - next_action: Continue repo-swarm MVP work from `notes/epiphany-repo-swarm-mvp-contract.md`. The aggregate MVP gate is now sealed: `tools/epiphany_local_run.ps1 -Mode repo-swarm-mvp-gate` reports `demoReady=true`, `mvpReady=false`, eleven green proof gates, two Idunn warning gates, zero blockers, and `privateStateExposed=false`. Useful next cuts are explicit elevated/operator Idunn execution proof only when the human grants that authority, unattended daemon survival proof, or another repo-owned safe action family only if it materially improves the MVP story. Persona-to-Imagination consensus readback, Mind-owned interpreter brief cargo, safe-family planning depth and closure, Gjallar closure/readiness/readiness-review rows, receipt-directory readiness-review indexing, Bifrost ledger accounting rows including readiness-review closure plus artifact/metrics final receipt closure, readiness wrapper mouth, repo deployment handoff/readback wrappers, readiness deployment-aftercare closure, readiness Idunn/tool-directory receipt validation, readiness Bifrost/GitHub publication-chain validation, readiness upstream-main sync validation, readiness review/adoption receipt validation, and aggregate fresh-repo/readiness/Bifrost MVP gate reporting are sealed; preserve Idunn service lifecycle ownership, Bifrost publication/upstream-main ownership, Mind durable-state admission, and existing CultMesh/Odin/Eve tool directories. Windows service install/start/deployment execution still requires explicit elevated operator authority. + next_action: Continue repo-swarm MVP work from `notes/epiphany-repo-swarm-mvp-contract.md`. The aggregate MVP gate is now sealed: `tools/epiphany_local_run.ps1 -Mode repo-swarm-mvp-gate` reports `demoReady=true`, `mvpReady=false`, twelve green proof gates, one Idunn elevated-service warning gate, zero blockers, and `privateStateExposed=false`. Useful next cuts are explicit elevated/operator Idunn execution proof only when the human grants that authority, or another repo-owned safe action family only if it materially improves the MVP story. Persona-to-Imagination consensus readback, Mind-owned interpreter brief cargo, safe-family planning depth and closure, Gjallar closure/readiness/readiness-review rows, receipt-directory readiness-review indexing, Bifrost ledger accounting rows including readiness-review closure plus artifact/metrics final receipt closure, readiness wrapper mouth, repo deployment handoff/readback wrappers, readiness deployment-aftercare closure, readiness Idunn/tool-directory receipt validation, readiness Bifrost/GitHub publication-chain validation, readiness upstream-main sync validation, readiness review/adoption receipt validation, aggregate fresh-repo/readiness/Bifrost MVP gate reporting, and bounded Idunn daemon survival rehearsal are sealed; preserve Idunn service lifecycle ownership, Bifrost publication/upstream-main ownership, Mind durable-state admission, and existing CultMesh/Odin/Eve tool directories. Windows service install/start/deployment execution still requires explicit elevated operator authority. diff --git a/tools/epiphany_local_run.ps1 b/tools/epiphany_local_run.ps1 index 53d88f5c..31c23acb 100644 --- a/tools/epiphany_local_run.ps1 +++ b/tools/epiphany_local_run.ps1 @@ -1,5 +1,5 @@ param( - [ValidateSet("status", "plan", "smoke", "run", "mvp", "agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "repo-swarm-mvp-gate", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "repo-persona-intake", "repo-swarm-run", "repo-work-queue-run", "repo-work-readiness", "repo-work-readiness-review", "repo-deployment-config-audit", "repo-deployment-runbook", "repo-deployment-aftercare-audit", "repo-work-service-plan", "repo-work-service-runbook", "repo-work-service-launch", "repo-work-service-audit", "swarm-online-runbook", "service-policy-directory", "service-plan", "service-launch", "service-runbook", "cluster-service-runbook", "cluster-service-install-plan", "cluster-service-install-execute", "cluster-service-audit", "cluster-service-start-plan", "cluster-service-stop-plan", "cluster-service-start-execute", "cluster-service-stop-execute", "cluster-service-execution-readiness", "cluster-service-execution-runbook", "cluster-service-execution-audit", "service-execution-runbook", "service-install-plan", "service-install-execute", "service-tick", "service-status", "service-reconcile", "service-execution-readiness", "service-execution-audit", "service-start-plan", "service-stop-plan", "service-start-execute", "service-stop-execute")] + [ValidateSet("status", "plan", "smoke", "run", "mvp", "agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "daemon-survival-rehearsal", "repo-swarm-mvp-gate", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "repo-persona-intake", "repo-swarm-run", "repo-work-queue-run", "repo-work-readiness", "repo-work-readiness-review", "repo-deployment-config-audit", "repo-deployment-runbook", "repo-deployment-aftercare-audit", "repo-work-service-plan", "repo-work-service-runbook", "repo-work-service-launch", "repo-work-service-audit", "swarm-online-runbook", "service-policy-directory", "service-plan", "service-launch", "service-runbook", "cluster-service-runbook", "cluster-service-install-plan", "cluster-service-install-execute", "cluster-service-audit", "cluster-service-start-plan", "cluster-service-stop-plan", "cluster-service-start-execute", "cluster-service-stop-execute", "cluster-service-execution-readiness", "cluster-service-execution-runbook", "cluster-service-execution-audit", "service-execution-runbook", "service-install-plan", "service-install-execute", "service-tick", "service-status", "service-reconcile", "service-execution-readiness", "service-execution-audit", "service-start-plan", "service-stop-plan", "service-start-execute", "service-stop-execute")] [string]$Mode = "smoke", [string]$Root = (Resolve-Path ".").Path, [string]$Workspace = "", @@ -58,6 +58,7 @@ param( [string]$RepoSwarmMvpFreshRepoSummaryPath = "", [string]$RepoSwarmMvpReadinessSummaryPath = "", [string]$RepoSwarmMvpBifrostAccountingSummaryPath = "", + [string]$RepoSwarmMvpDaemonSurvivalSummaryPath = "", [string]$ToolCapabilityId = "epiphany.cluster.hands.tool.repo-action", [string]$ToolRequestingAgentId = "epiphany.Persona", [string]$ToolRequestingClusterId = "epiphany.cluster.persona", @@ -335,6 +336,7 @@ $statusExe = Join-Path $TargetDir "debug\epiphany-mvp-status.exe" $operatorRunExe = Join-Path $TargetDir "debug\epiphany-operator-run.exe" $operatorSnapshotExe = Join-Path $TargetDir "debug\epiphany-operator-snapshot.exe" $verseQueryExe = Join-Path $TargetDir "debug\epiphany-verse-query.exe" +$daemonSurvivalRehearsalExe = Join-Path $TargetDir "debug\epiphany-daemon-survival-rehearsal-smoke.exe" $repoSwarmMvpGateExe = Join-Path $TargetDir "debug\epiphany-repo-swarm-mvp-gate-smoke.exe" $bifrostAccountingBundleExe = Join-Path $TargetDir "debug\epiphany-repo-bifrost-accounting-bundle-smoke.exe" $swarmExe = Join-Path $TargetDir "debug\epiphany-swarm.exe" @@ -381,7 +383,7 @@ $runtimeStore = Join-Path $Workspace "state\runtime-spine.msgpack" $liveRuntimeMode = @("run", "mvp") -contains $Mode if (-not $SkipBuild) { - if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-public-proof" -and $Mode -ne "bifrost-artifact-acceptance" -and $Mode -ne "bifrost-metrics" -and $Mode -ne "bifrost-accounting-bundle" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-persona-intake" -and $Mode -ne "repo-swarm-run" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "repo-work-readiness" -and $Mode -ne "repo-work-readiness-review" -and $Mode -ne "repo-deployment-config-audit" -and $Mode -ne "repo-deployment-runbook" -and $Mode -ne "repo-deployment-aftercare-audit" -and $Mode -ne "repo-work-service-plan" -and $Mode -ne "repo-work-service-runbook" -and $Mode -ne "repo-work-service-launch" -and $Mode -ne "repo-work-service-audit" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") { + if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "daemon-survival-rehearsal" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-public-proof" -and $Mode -ne "bifrost-artifact-acceptance" -and $Mode -ne "bifrost-metrics" -and $Mode -ne "bifrost-accounting-bundle" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-persona-intake" -and $Mode -ne "repo-swarm-run" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "repo-work-readiness" -and $Mode -ne "repo-work-readiness-review" -and $Mode -ne "repo-deployment-config-audit" -and $Mode -ne "repo-deployment-runbook" -and $Mode -ne "repo-deployment-aftercare-audit" -and $Mode -ne "repo-work-service-plan" -and $Mode -ne "repo-work-service-runbook" -and $Mode -ne "repo-work-service-launch" -and $Mode -ne "repo-work-service-audit" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") { Invoke-Checked ` -Label "build Codex app-server compatibility organ" ` -FilePath $cargoExe ` @@ -401,6 +403,7 @@ if (-not $SkipBuild) { "--bin", "epiphany-operator-run", "--bin", "epiphany-operator-snapshot", "--bin", "epiphany-verse-query", + "--bin", "epiphany-daemon-survival-rehearsal-smoke", "--bin", "epiphany-repo-swarm-mvp-gate-smoke", "--bin", "epiphany-repo-bifrost-accounting-bundle-smoke", "--bin", "epiphany-swarm", @@ -440,13 +443,16 @@ if (-not $SkipBuild) { } $requiredBinaries = @($statusExe, $operatorRunExe, $operatorSnapshotExe, $verseQueryExe, $swarmExe, $repoWorkExe, $daemonSupervisorExe, $handsActionExe) +if ($Mode -eq "daemon-survival-rehearsal") { + $requiredBinaries += @($daemonSurvivalRehearsalExe) +} if ($Mode -eq "repo-swarm-mvp-gate") { $requiredBinaries += @($repoSwarmMvpGateExe) } if ($Mode -eq "bifrost-accounting-bundle") { $requiredBinaries += @($bifrostAccountingBundleExe) } -if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-public-proof" -and $Mode -ne "bifrost-artifact-acceptance" -and $Mode -ne "bifrost-metrics" -and $Mode -ne "bifrost-accounting-bundle" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-persona-intake" -and $Mode -ne "repo-swarm-run" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "repo-work-readiness" -and $Mode -ne "repo-work-readiness-review" -and $Mode -ne "repo-deployment-config-audit" -and $Mode -ne "repo-deployment-runbook" -and $Mode -ne "repo-deployment-aftercare-audit" -and $Mode -ne "repo-work-service-plan" -and $Mode -ne "repo-work-service-runbook" -and $Mode -ne "repo-work-service-launch" -and $Mode -ne "repo-work-service-audit" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") { +if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "daemon-survival-rehearsal" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-public-proof" -and $Mode -ne "bifrost-artifact-acceptance" -and $Mode -ne "bifrost-metrics" -and $Mode -ne "bifrost-accounting-bundle" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-persona-intake" -and $Mode -ne "repo-swarm-run" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "repo-work-readiness" -and $Mode -ne "repo-work-readiness-review" -and $Mode -ne "repo-deployment-config-audit" -and $Mode -ne "repo-deployment-runbook" -and $Mode -ne "repo-deployment-aftercare-audit" -and $Mode -ne "repo-work-service-plan" -and $Mode -ne "repo-work-service-runbook" -and $Mode -ne "repo-work-service-launch" -and $Mode -ne "repo-work-service-audit" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") { $requiredBinaries += @($codexAppServer, $coordinatorExe) } function Assert-SwarmBrakeAllowsLiveRun { @@ -609,7 +615,7 @@ Invoke-Checked ` -StdoutPath (Join-Path $artifactRoot "operator-run-intent.stdout.json") ` -StderrPath (Join-Path $artifactRoot "operator-run-intent.stderr.log") -$compactReadOnlyModes = @("agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "repo-swarm-mvp-gate", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "swarm-online-runbook", "service-policy-directory") +$compactReadOnlyModes = @("agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "daemon-survival-rehearsal", "repo-swarm-mvp-gate", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "swarm-online-runbook", "service-policy-directory") $isCompactReadOnlyMode = $compactReadOnlyModes -contains $Mode $shouldReadLocalVerse = $Mode -ne "smoke" -and -not $isCompactReadOnlyMode if ($shouldReadLocalVerse -and $Mode -ne "status" -and $Mode -ne "mvp") { @@ -976,6 +982,20 @@ if ($Mode -eq "bifrost-metrics") { -StderrPath (Join-Path $artifactRoot "bifrost-metrics.stderr.log") } +if ($Mode -eq "daemon-survival-rehearsal") { + $resultPath = Join-Path $artifactRoot "daemon-survival-rehearsal.stdout.json" + Invoke-Checked ` + -Label "verify Idunn daemon survival rehearsal" ` + -FilePath $daemonSurvivalRehearsalExe ` + -Arguments @( + "--root", $Root, + "--smoke-root", (Join-Path $Root ".epiphany-smoke") + ) ` + -WorkingDirectory $Root ` + -StdoutPath $resultPath ` + -StderrPath (Join-Path $artifactRoot "daemon-survival-rehearsal.stderr.log") +} + if ($Mode -eq "repo-swarm-mvp-gate") { $resultPath = Join-Path $artifactRoot "repo-swarm-mvp-gate.stdout.json" $gateArgs = @( @@ -991,6 +1011,9 @@ if ($Mode -eq "repo-swarm-mvp-gate") { if ($RepoSwarmMvpBifrostAccountingSummaryPath -ne "") { $gateArgs += @("--bifrost-accounting-summary", $RepoSwarmMvpBifrostAccountingSummaryPath) } + if ($RepoSwarmMvpDaemonSurvivalSummaryPath -ne "") { + $gateArgs += @("--daemon-survival-summary", $RepoSwarmMvpDaemonSurvivalSummaryPath) + } Invoke-Checked ` -Label "verify repo swarm MVP gate proof" ` -FilePath $repoSwarmMvpGateExe ` @@ -2616,6 +2639,8 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { $creditReadback = ($result.creditReadbackReceiptIds -join ",") } Write-Host "Bifrost metrics: status=$($result.status), item=$($result.item), receipt=$($result.receiptId), artifactAcceptance=$($result.artifactAcceptanceReceiptId), modelSpend=$modelSpend, reviewLoad=$reviewLoad, creditReadback=$creditReadback, privateStateExposed=$($result.privateStateExposed)" + } elseif ($Mode -eq "daemon-survival-rehearsal") { + Write-Host "Daemon survival rehearsal: status=$($result.status), daemon=$($result.daemonId), scheduler=$($result.schedulerId), policy=$($result.policyStatus), serve=$($result.serveStatus), iterations=$($result.serveIterations), schedulerReceipt=$($result.schedulerReceiptId), serviceManagerMutated=$($result.serviceManagerMutated), elevated=$($result.requiresElevatedAuthority), privateStateExposed=$($result.privateStateExposed), smokeDir=$($result.smokeDir)" } elseif ($Mode -eq "repo-swarm-mvp-gate") { $remaining = "none" if ($null -ne $result.knownRemainingAuthorityGates -and $result.knownRemainingAuthorityGates.Count -gt 0) {