diff --git a/epiphany-core/src/bin/epiphany-repo-artifact-acceptance-request-family-smoke.rs b/epiphany-core/src/bin/epiphany-repo-artifact-acceptance-request-family-smoke.rs deleted file mode 100644 index 5b939695..00000000 --- a/epiphany-core/src/bin/epiphany-repo-artifact-acceptance-request-family-smoke.rs +++ /dev/null @@ -1,629 +0,0 @@ -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!("repo-artifact-acceptance-request-family-{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 repo = smoke_dir.join("repo-body"); - fs::create_dir_all(&repo).with_context(|| format!("failed to create {}", repo.display()))?; - git(["init"], &repo)?; - git( - ["config", "user.email", "epiphany-smoke@example.invalid"], - &repo, - )?; - git(["config", "user.name", "Epiphany Smoke"], &repo)?; - fs::write( - repo.join("README.md"), - "# Repo Artifact Acceptance Request Family Smoke\n\nThis repository proves branch-local artifact acceptance request cargo without acceptance authority.\n", - ) - .with_context(|| format!("failed to seed {}", repo.join("README.md").display()))?; - git(["add", "README.md"], &repo)?; - git( - [ - "commit", - "-m", - "Seed repo artifact acceptance request smoke body", - ], - &repo, - )?; - git( - [ - "switch", - "-c", - "epiphany/repo-artifact-acceptance-request-family", - ], - &repo, - )?; - - let item = "repo-artifact-acceptance-request-family"; - let target_path = - ".epiphany/artifact-acceptance-requests/repo-artifact-acceptance-request-family.toml"; - let local_verse = repo.join(".epiphany").join("local-verse.ccmp"); - cargo_json( - &manifest, - "epiphany-repo", - &[ - "init", - "--workspace", - path_str(&repo)?, - "--epiphany-root", - path_str(&root)?, - "--swarm-id", - "repo-artifact-acceptance-request-family-smoke", - "--topic", - "repo-artifact-acceptance-request-family", - ], - &root, - )?; - cargo_json( - &manifest, - "epiphany-swarm", - &[ - "online", - "--workspace", - path_str(&repo)?, - "--epiphany-root", - path_str(&root)?, - "--runtime-id", - "repo-artifact-acceptance-request-family-smoke", - "--local-verse-store", - path_str(&local_verse)?, - ], - &root, - )?; - cargo_json( - &manifest, - "epiphany-work", - &[ - "accept", - "--workspace", - path_str(&repo)?, - "--from", - "persona", - "--item", - item, - "--summary", - "Ask a maintainer and Bifrost to record artifact acceptance for reviewed branch work without granting acceptance authority.", - "--candidate-action-ref", - "candidate-action://repo-artifact-acceptance-request-family/artifact-packet", - "--candidate-action-ref", - "candidate-action://repo-artifact-acceptance-request-family/acceptance-review", - "--public-discussion-ref", - "epiphany-global/persona-collaboration/repo-artifact-acceptance-request-family", - ], - &root, - )?; - let plan = cargo_json( - &manifest, - "epiphany-work", - &[ - "derive-plan", - "--workspace", - path_str(&repo)?, - "--item", - item, - "--action-family", - "repo-artifact-acceptance-request", - "--model-ref", - "repo-artifact-acceptance-request-family-smoke-imagination-v1", - "--model-authored", - ], - &root, - )?; - for _ in 0..4 { - cargo_json( - &manifest, - "epiphany-work", - &[ - "tick", - "--workspace", - path_str(&repo)?, - "--epiphany-root", - path_str(&root)?, - "--item", - item, - "--cooldown-seconds", - "0", - ], - &root, - )?; - } - let close_path = repo - .join(".epiphany") - .join("work") - .join(format!("work-close-{item}.json")); - let close = read_json(&close_path)?; - let request_text = fs::read_to_string(repo.join(target_path)) - .with_context(|| format!("failed to read {}", repo.join(target_path).display()))?; - let open_bifrost_ledger = cargo_json( - &manifest, - "epiphany-verse-query", - &[ - "bifrost-ledger", - "--store", - path_str(&local_verse)?, - "--runtime-id", - "repo-artifact-acceptance-request-family-smoke", - ], - &root, - )?; - let artifact_acceptance_receipt = cargo_json( - &manifest, - "epiphany-verse-query", - &[ - "bifrost-artifact-acceptance", - "--store", - path_str(&local_verse)?, - "--runtime-id", - "repo-artifact-acceptance-request-family-smoke", - "--artifact-ref", - "artifact://repo-artifact-acceptance-request-family/final", - "--ledger-entry-id", - "bifrost-ledger:repo-artifact-acceptance-request-family", - "--review-receipt", - "maintainer-review:repo-artifact-acceptance-request-family", - "--public-proof-ref", - "public-proof:repo-artifact-acceptance-request-family", - ], - &root, - )?; - let closed_bifrost_ledger = cargo_json( - &manifest, - "epiphany-verse-query", - &[ - "bifrost-ledger", - "--store", - path_str(&local_verse)?, - "--runtime-id", - "repo-artifact-acceptance-request-family-smoke", - ], - &root, - )?; - - require_eq( - &plan, - &["derivation", "safeActionFamily"], - "repo.artifact_acceptance_request", - )?; - require_eq(&close, &["status"], "closed")?; - require_eq(&close, &["soul", "verdict"], "passed")?; - require_eq( - &close, - &["closureReview", "familyAssertions", "status"], - "passed", - )?; - require_bool( - &close, - &["closureReview", "sourceGrounding", "pathScopeMatched"], - true, - )?; - require_bool(&close, &["privateStateExposed"], false)?; - require_text( - &request_text, - "schema_version = \"epiphany.repo_artifact_acceptance_request.v0\"", - )?; - require_text( - &request_text, - "safe_action_family = \"repo.artifact_acceptance_request\"", - )?; - require_text(&request_text, "[request]")?; - require_text( - &request_text, - "status = \"awaiting-artifact-acceptance-review\"", - )?; - require_text(&request_text, "requested_owner = \"Maintainer/Bifrost\"")?; - require_text( - &request_text, - "requested_effect = \"record-accepted-artifact-for-reviewed-branch-work\"", - )?; - require_text(&request_text, "verification_request_ref = ")?; - require_text(&request_text, "maintainer_review_request_ref = ")?; - require_text(&request_text, "publication_request_ref = ")?; - require_text( - &request_text, - "acceptance_scope = \"changed paths, Hands commit, Soul closure, maintainer review, public proof, and accepted artifact readback\"", - )?; - require_text(&request_text, "[antecedents]")?; - require_text(&request_text, "closure_review_required = true")?; - require_text(&request_text, "soul_verdict_required = true")?; - require_text(&request_text, "mind_commit_required = true")?; - require_text(&request_text, "public_proof_required = true")?; - require_text(&request_text, "maintainer_review_required = true")?; - require_text(&request_text, "hands_commit_required = true")?; - require_text(&request_text, "[required_receipts]")?; - require_text( - &request_text, - "closure_review = \"epiphany.repo_work_closure_review.v0\"", - )?; - require_text( - &request_text, - "soul_verdict = \"epiphany.soul.verification_verdict\"", - )?; - require_text( - &request_text, - "mind_commit = \"epiphany.mind.state_commit_receipt\"", - )?; - require_text( - &request_text, - "public_proof = \"epiphany.repo_work_public_proof_bundle.v0\"", - )?; - require_text( - &request_text, - "maintainer_review = \"gamecult.maintainer.review_receipt.v0\"", - )?; - require_text( - &request_text, - "hands_commit = \"epiphany.hands.commit_receipt\"", - )?; - require_text( - &request_text, - "accepted_artifact = \"gamecult.artifact.acceptance_receipt.v0\"", - )?; - require_text(&request_text, "[artifact_packet]")?; - require_text(&request_text, "requires_artifact_ref = true")?; - require_text(&request_text, "requires_commit_sha = true")?; - require_text(&request_text, "requires_changed_path_list = true")?; - require_text(&request_text, "requires_review_verdict = true")?; - require_text(&request_text, "requires_public_proof_ref = true")?; - require_text(&request_text, "requires_acceptance_rationale = true")?; - require_text( - &request_text, - "requires_private_state_redaction_check = true", - )?; - require_text(&request_text, "artifact_acceptance_authorized = false")?; - require_text(&request_text, "credit_ledger_authorized = false")?; - require_text(&request_text, "github_pr_authorized = false")?; - require_text(&request_text, "merge_authorized = false")?; - require_text(&request_text, "publication_authorized = false")?; - require_text(&request_text, "upstream_sync_authorized = false")?; - require_text(&request_text, "hands_action_authorized = false")?; - require_text(&request_text, "cross_body_mutation_authorized = false")?; - require_text( - &request_text, - "maintainer_or_bifrost_acceptance_authority_required = true", - )?; - require_text(&request_text, "private_state_exposed = false")?; - require_bifrost_accounting_row( - &open_bifrost_ledger, - "artifact-acceptance-request", - "open", - 3, - 1, - )?; - require_tui_row_contains( - &open_bifrost_ledger, - &["accountingTuiRows"], - "BIFROST-ACCOUNTING | artifact-acceptance-request", - )?; - require_tui_row_contains(&open_bifrost_ledger, &["accountingTuiRows"], "status=open")?; - require_tui_row_contains( - &open_bifrost_ledger, - &["accountingTuiRows"], - "request=present", - )?; - require_bool(&open_bifrost_ledger, &["privateStateExposed"], false)?; - require_eq( - &artifact_acceptance_receipt, - &["receiptId"], - "bifrost-artifact-acceptance-repo-artifact-acceptance-request-family", - )?; - require_eq(&artifact_acceptance_receipt, &["status"], "ok")?; - require_bool( - &artifact_acceptance_receipt, - &["privateStateExposed"], - false, - )?; - require_bifrost_accounting_row( - &closed_bifrost_ledger, - "artifact-acceptance-request", - "closed", - 1, - 1, - )?; - require_tui_row_contains( - &closed_bifrost_ledger, - &["accountingTuiRows"], - "acceptance=present", - )?; - require_tui_row_contains( - &closed_bifrost_ledger, - &["accountingTuiRows"], - "receipt=bifrost-artifact-acceptance-repo-artifact-acceptance-request-family", - )?; - require_bool(&closed_bifrost_ledger, &["privateStateExposed"], false)?; - - let summary = json!({ - "schemaVersion": "epiphany.repo_artifact_acceptance_request_family_smoke.v0", - "status": "ok", - "smokeDir": smoke_dir, - "repo": repo, - "branch": git_output(["branch", "--show-current"], &repo)?, - "item": item, - "safeActionFamily": plan["derivation"]["safeActionFamily"], - "targetPath": target_path, - "closeStatus": close["status"], - "soulVerdict": close["soul"]["verdict"], - "familyAssertionsStatus": close["closureReview"]["familyAssertions"]["status"], - "pathScopeMatched": close["closureReview"]["sourceGrounding"]["pathScopeMatched"], - "awaitingArtifactAcceptanceReview": true, - "artifactAcceptanceAuthorized": false, - "creditLedgerAuthorized": false, - "githubPrAuthorized": false, - "mergeAuthorized": false, - "publicationAuthorized": false, - "upstreamSyncAuthorized": false, - "handsActionAuthorized": false, - "bifrostLedgerAccountingRowCount": closed_bifrost_ledger["accountingRowCount"], - "bifrostArtifactAcceptanceReceiptId": artifact_acceptance_receipt["receiptId"], - "bifrostArtifactAcceptanceOpenAccountingRow": bifrost_accounting_row_value(&open_bifrost_ledger, "artifact-acceptance-request")?, - "bifrostArtifactAcceptanceClosedAccountingRow": bifrost_accounting_row_value(&closed_bifrost_ledger, "artifact-acceptance-request")?, - "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 git(args: [&str; N], cwd: &Path) -> Result<()> { - let output = Command::new("git") - .args(args) - .current_dir(cwd) - .output() - .with_context(|| format!("failed to run git in {}", cwd.display()))?; - if output.status.success() { - Ok(()) - } else { - Err(anyhow!( - "git failed in {} with status {:?}\nstdout:\n{}\nstderr:\n{}", - cwd.display(), - output.status.code(), - String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr) - )) - } -} - -fn git_output(args: [&str; N], cwd: &Path) -> Result { - let output = Command::new("git") - .args(args) - .current_dir(cwd) - .output() - .with_context(|| format!("failed to run git in {}", cwd.display()))?; - if output.status.success() { - Ok(String::from_utf8_lossy(&output.stdout).trim().to_string()) - } else { - Err(anyhow!( - "git failed in {} with status {:?}\nstdout:\n{}\nstderr:\n{}", - cwd.display(), - output.status.code(), - String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr) - )) - } -} - -fn read_json(path: &Path) -> Result { - let bytes = fs::read(path).with_context(|| format!("failed to read {}", path.display()))?; - serde_json::from_slice(&bytes).with_context(|| format!("failed to parse {}", path.display())) -} - -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_text(haystack: &str, needle: &str) -> Result<()> { - if haystack.contains(needle) { - Ok(()) - } else { - Err(anyhow!( - "expected artifact acceptance request text to contain {needle:?}" - )) - } -} - -fn require_tui_row_contains(value: &Value, path: &[&str], needle: &str) -> Result<()> { - let rows = path - .iter() - .try_fold(value, |current, key| current.get(*key)) - .and_then(Value::as_array) - .ok_or_else(|| anyhow!("missing TUI row array {}", path.join(".")))?; - if rows - .iter() - .filter_map(Value::as_str) - .any(|row| row.contains(needle)) - { - Ok(()) - } else { - Err(anyhow!( - "expected {} to contain row fragment {needle:?}", - path.join(".") - )) - } -} - -fn bifrost_accounting_row_value<'a>(value: &'a Value, lane: &str) -> Result<&'a Value> { - value - .get("accountingRows") - .and_then(Value::as_array) - .and_then(|rows| { - rows.iter() - .find(|row| row.get("lane").and_then(Value::as_str) == Some(lane)) - }) - .ok_or_else(|| anyhow!("missing Bifrost accounting row {lane:?}")) -} - -fn require_bifrost_accounting_row( - value: &Value, - lane: &str, - status: &str, - review_receipt_count: u64, - public_artifact_count: u64, -) -> Result<()> { - let row = bifrost_accounting_row_value(value, lane)?; - let actual_status = row - .get("status") - .and_then(Value::as_str) - .unwrap_or(""); - let actual_review_receipt_count = row - .get("reviewReceiptCount") - .and_then(Value::as_u64) - .unwrap_or(0); - let actual_public_artifact_count = row - .get("publicArtifactCount") - .and_then(Value::as_u64) - .unwrap_or(0); - let actual_private = row - .get("privateStateExposed") - .and_then(Value::as_bool) - .unwrap_or(true); - if actual_status == status - && actual_review_receipt_count == review_receipt_count - && actual_public_artifact_count == public_artifact_count - && !actual_private - { - Ok(()) - } else { - Err(anyhow!( - "Bifrost accounting row {lane:?} mismatch: status={actual_status:?}, reviewReceiptCount={actual_review_receipt_count}, publicArtifactCount={actual_public_artifact_count}, privateStateExposed={actual_private}" - )) - } -} - -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-bifrost-accounting-bundle-smoke.rs b/epiphany-core/src/bin/epiphany-repo-bifrost-accounting-bundle-smoke.rs deleted file mode 100644 index 901af849..00000000 --- a/epiphany-core/src/bin/epiphany-repo-bifrost-accounting-bundle-smoke.rs +++ /dev/null @@ -1,336 +0,0 @@ -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; - -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, - artifact_summary: Option, - metrics_summary: Option, -} - -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 artifact_summary = None; - let mut metrics_summary = None; - 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")?, - "--artifact-summary" => { - artifact_summary = Some(take_path(&mut args, "--artifact-summary")?) - } - "--metrics-summary" => { - metrics_summary = Some(take_path(&mut args, "--metrics-summary")?) - } - other => return Err(anyhow!("unexpected argument {other:?}")), - } - } - Ok(Self { - root, - smoke_root, - artifact_summary, - metrics_summary, - }) - } -} - -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!("repo-bifrost-accounting-bundle-{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 artifact_summary = args.artifact_summary.unwrap_or_else(|| { - latest_summary(&args.smoke_root, "repo-artifact-acceptance-request-family-") - }); - let metrics_summary = args - .metrics_summary - .unwrap_or_else(|| latest_summary(&args.smoke_root, "repo-metrics-request-family-")); - let artifact = read_json(&artifact_summary)?; - let metrics = read_json(&metrics_summary)?; - - require_eq( - &artifact, - &["schemaVersion"], - "epiphany.repo_artifact_acceptance_request_family_smoke.v0", - )?; - require_eq(&artifact, &["status"], "ok")?; - require_eq( - &artifact, - &["safeActionFamily"], - "repo.artifact_acceptance_request", - )?; - require_eq(&artifact, &["closeStatus"], "closed")?; - require_eq(&artifact, &["soulVerdict"], "passed")?; - require_eq(&artifact, &["familyAssertionsStatus"], "passed")?; - require_bool(&artifact, &["privateStateExposed"], false)?; - require_bool(&artifact, &["artifactAcceptanceAuthorized"], false)?; - require_bool(&artifact, &["handsActionAuthorized"], false)?; - require_bool(&artifact, &["upstreamSyncAuthorized"], false)?; - require_eq( - &artifact, - &["bifrostArtifactAcceptanceReceiptId"], - "bifrost-artifact-acceptance-repo-artifact-acceptance-request-family", - )?; - require_row( - &artifact, - &["bifrostArtifactAcceptanceOpenAccountingRow"], - "artifact-acceptance-request", - "open", - 3, - 1, - None, - )?; - require_row( - &artifact, - &["bifrostArtifactAcceptanceClosedAccountingRow"], - "artifact-acceptance-request", - "closed", - 1, - 1, - None, - )?; - - require_eq( - &metrics, - &["schemaVersion"], - "epiphany.repo_metrics_request_family_smoke.v0", - )?; - require_eq(&metrics, &["status"], "ok")?; - require_eq(&metrics, &["safeActionFamily"], "repo.metrics_request")?; - require_eq(&metrics, &["closeStatus"], "closed")?; - require_eq(&metrics, &["soulVerdict"], "passed")?; - require_eq(&metrics, &["familyAssertionsStatus"], "passed")?; - require_bool(&metrics, &["privateStateExposed"], false)?; - require_bool(&metrics, &["metricsLedgerAuthorized"], false)?; - require_bool(&metrics, &["handsActionAuthorized"], false)?; - require_bool(&metrics, &["upstreamSyncAuthorized"], false)?; - require_eq( - &metrics, - &["bifrostMetricsReceiptId"], - "bifrost-metrics-repo-metrics-request-family", - )?; - require_row( - &metrics, - &["bifrostMetricsOpenAccountingRow"], - "metrics-request", - "open", - 3, - 1, - Some(0), - )?; - require_row( - &metrics, - &["bifrostMetricsClosedAccountingRow"], - "metrics-request", - "closed", - 2, - 1, - Some(1), - )?; - - let summary = json!({ - "schemaVersion": "epiphany.repo_bifrost_accounting_bundle_smoke.v0", - "status": "ok", - "smokeDir": smoke_dir, - "artifactAcceptanceSummary": artifact_summary, - "metricsSummary": metrics_summary, - "artifactAcceptanceSmokeDir": artifact["smokeDir"], - "metricsSmokeDir": metrics["smokeDir"], - "artifactAcceptanceFamily": artifact["safeActionFamily"], - "metricsFamily": metrics["safeActionFamily"], - "artifactAcceptanceCloseStatus": artifact["closeStatus"], - "metricsCloseStatus": metrics["closeStatus"], - "artifactAcceptanceReceiptId": artifact["bifrostArtifactAcceptanceReceiptId"], - "metricsReceiptId": metrics["bifrostMetricsReceiptId"], - "artifactAcceptanceClosedAccountingRow": artifact["bifrostArtifactAcceptanceClosedAccountingRow"], - "metricsClosedAccountingRow": metrics["bifrostMetricsClosedAccountingRow"], - "operatorSafeProofBundle": true, - "planningAuthorityOnly": true, - "privateStateExposed": false, - }); - write_json(&smoke_dir.join("summary.json"), &summary)?; - Ok(summary) -} - -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 read_json(path: &Path) -> Result { - let bytes = fs::read(path).with_context(|| format!("failed to read {}", path.display()))?; - serde_json::from_slice(&bytes).with_context(|| format!("failed to parse {}", path.display())) -} - -fn latest_summary(smoke_root: &Path, parent_prefix: &str) -> PathBuf { - let mut candidates = Vec::new(); - collect_summaries(smoke_root, parent_prefix, &mut candidates); - candidates - .into_iter() - .max_by_key(|(modified, _)| *modified) - .map(|(_, path)| path) - .unwrap_or_else(|| smoke_root.join(parent_prefix).join("summary.json")) -} - -fn collect_summaries(root: &Path, parent_prefix: &str, summaries: &mut Vec<(u128, PathBuf)>) { - let Ok(entries) = fs::read_dir(root) else { - return; - }; - for entry in entries.flatten() { - let path = entry.path(); - if path.is_dir() { - collect_summaries(&path, parent_prefix, summaries); - } else if path.file_name().and_then(|name| name.to_str()) == Some("summary.json") - && path - .parent() - .and_then(Path::file_name) - .and_then(|name| name.to_str()) - .is_some_and(|name| name.starts_with(parent_prefix)) - { - let modified = entry - .metadata() - .and_then(|metadata| metadata.modified()) - .ok() - .and_then(|time| time.duration_since(std::time::UNIX_EPOCH).ok()) - .map(|duration| duration.as_millis()) - .unwrap_or(0); - summaries.push((modified, path)); - } - } -} - -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_row( - value: &Value, - path: &[&str], - lane: &str, - status: &str, - review_receipt_count: u64, - public_artifact_count: u64, - credit_receipt_count: Option, -) -> Result<()> { - let row = path - .iter() - .try_fold(value, |current, key| current.get(*key)) - .ok_or_else(|| anyhow!("missing accounting row {}", path.join(".")))?; - let actual_lane = row - .get("lane") - .and_then(Value::as_str) - .unwrap_or(""); - let actual_status = row - .get("status") - .and_then(Value::as_str) - .unwrap_or(""); - let actual_review_receipt_count = row - .get("reviewReceiptCount") - .and_then(Value::as_u64) - .unwrap_or(0); - let actual_public_artifact_count = row - .get("publicArtifactCount") - .and_then(Value::as_u64) - .unwrap_or(0); - let actual_credit_receipt_count = row.get("creditReceiptCount").and_then(Value::as_u64); - let actual_private = row - .get("privateStateExposed") - .and_then(Value::as_bool) - .unwrap_or(true); - let credit_matches = credit_receipt_count - .is_none_or(|expected| actual_credit_receipt_count.unwrap_or(0) == expected); - if actual_lane == lane - && actual_status == status - && actual_review_receipt_count == review_receipt_count - && actual_public_artifact_count == public_artifact_count - && credit_matches - && !actual_private - { - Ok(()) - } else { - Err(anyhow!( - "accounting row {} mismatch: lane={actual_lane:?}, status={actual_status:?}, reviewReceiptCount={actual_review_receipt_count}, publicArtifactCount={actual_public_artifact_count}, creditReceiptCount={actual_credit_receipt_count:?}, privateStateExposed={actual_private}", - path.join(".") - )) - } -} - -fn take_path( - args: &mut std::iter::Peekable>, - flag: &str, -) -> Result { - args.next() - .map(PathBuf::from) - .with_context(|| format!("missing value for {flag}")) -} diff --git a/epiphany-core/src/bin/epiphany-repo-metrics-request-family-smoke.rs b/epiphany-core/src/bin/epiphany-repo-metrics-request-family-smoke.rs deleted file mode 100644 index a004c2cc..00000000 --- a/epiphany-core/src/bin/epiphany-repo-metrics-request-family-smoke.rs +++ /dev/null @@ -1,614 +0,0 @@ -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!("repo-metrics-request-family-{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 repo = smoke_dir.join("repo-body"); - fs::create_dir_all(&repo).with_context(|| format!("failed to create {}", repo.display()))?; - git(["init"], &repo)?; - git( - ["config", "user.email", "epiphany-smoke@example.invalid"], - &repo, - )?; - git(["config", "user.name", "Epiphany Smoke"], &repo)?; - fs::write( - repo.join("README.md"), - "# Repo Metrics Request Family Smoke\n\nThis repository proves branch-local metrics request cargo without accounting authority.\n", - ) - .with_context(|| format!("failed to seed {}", repo.join("README.md").display()))?; - git(["add", "README.md"], &repo)?; - git( - ["commit", "-m", "Seed repo metrics request smoke body"], - &repo, - )?; - git( - ["switch", "-c", "epiphany/repo-metrics-request-family"], - &repo, - )?; - - let item = "repo-metrics-request-family"; - let target_path = ".epiphany/metrics-requests/repo-metrics-request-family.toml"; - let local_verse = repo.join(".epiphany").join("local-verse.ccmp"); - cargo_json( - &manifest, - "epiphany-repo", - &[ - "init", - "--workspace", - path_str(&repo)?, - "--epiphany-root", - path_str(&root)?, - "--swarm-id", - "repo-metrics-request-family-smoke", - "--topic", - "repo-metrics-request-family", - ], - &root, - )?; - cargo_json( - &manifest, - "epiphany-swarm", - &[ - "online", - "--workspace", - path_str(&repo)?, - "--epiphany-root", - path_str(&root)?, - "--runtime-id", - "repo-metrics-request-family-smoke", - "--local-verse-store", - path_str(&local_verse)?, - ], - &root, - )?; - cargo_json( - &manifest, - "epiphany-work", - &[ - "accept", - "--workspace", - path_str(&repo)?, - "--from", - "persona", - "--item", - item, - "--summary", - "Ask Bifrost and the maintainer to record compute, review, and artifact metrics without granting accounting authority.", - "--candidate-action-ref", - "candidate-action://repo-metrics-request-family/metrics-packet", - "--candidate-action-ref", - "candidate-action://repo-metrics-request-family/accounting-review", - "--public-discussion-ref", - "epiphany-global/persona-collaboration/repo-metrics-request-family", - ], - &root, - )?; - let plan = cargo_json( - &manifest, - "epiphany-work", - &[ - "derive-plan", - "--workspace", - path_str(&repo)?, - "--item", - item, - "--action-family", - "repo-metrics-request", - "--model-ref", - "repo-metrics-request-family-smoke-imagination-v1", - "--model-authored", - ], - &root, - )?; - for _ in 0..4 { - cargo_json( - &manifest, - "epiphany-work", - &[ - "tick", - "--workspace", - path_str(&repo)?, - "--epiphany-root", - path_str(&root)?, - "--item", - item, - "--cooldown-seconds", - "0", - ], - &root, - )?; - } - let close_path = repo - .join(".epiphany") - .join("work") - .join(format!("work-close-{item}.json")); - let close = read_json(&close_path)?; - let request_text = fs::read_to_string(repo.join(target_path)) - .with_context(|| format!("failed to read {}", repo.join(target_path).display()))?; - let open_bifrost_ledger = cargo_json( - &manifest, - "epiphany-verse-query", - &[ - "bifrost-ledger", - "--store", - path_str(&local_verse)?, - "--runtime-id", - "repo-metrics-request-family-smoke", - ], - &root, - )?; - let metrics_receipt = cargo_json( - &manifest, - "epiphany-verse-query", - &[ - "bifrost-metrics", - "--store", - path_str(&local_verse)?, - "--runtime-id", - "repo-metrics-request-family-smoke", - "--accepted-artifact-receipt-id", - "bifrost-artifact-acceptance:repo-metrics-request-family", - "--model-spend-receipt", - "model-spend:repo-metrics-request-family", - "--review-load-receipt", - "review-load:repo-metrics-request-family", - "--credit-receipt", - "credit-readback:repo-metrics-request-family", - "--public-proof-ref", - "public-proof:repo-metrics-request-family", - "--metrics-summary", - "model spend, review load, accepted artifact, and credit readback recorded for metrics smoke", - ], - &root, - )?; - let closed_bifrost_ledger = cargo_json( - &manifest, - "epiphany-verse-query", - &[ - "bifrost-ledger", - "--store", - path_str(&local_verse)?, - "--runtime-id", - "repo-metrics-request-family-smoke", - ], - &root, - )?; - - require_eq( - &plan, - &["derivation", "safeActionFamily"], - "repo.metrics_request", - )?; - require_eq(&close, &["status"], "closed")?; - require_eq(&close, &["soul", "verdict"], "passed")?; - require_eq( - &close, - &["closureReview", "familyAssertions", "status"], - "passed", - )?; - require_bool( - &close, - &["closureReview", "sourceGrounding", "pathScopeMatched"], - true, - )?; - require_bool(&close, &["privateStateExposed"], false)?; - require_text( - &request_text, - "schema_version = \"epiphany.repo_metrics_request.v0\"", - )?; - require_text( - &request_text, - "safe_action_family = \"repo.metrics_request\"", - )?; - require_text(&request_text, "[request]")?; - require_text(&request_text, "status = \"awaiting-metrics-review\"")?; - require_text(&request_text, "requested_owner = \"Bifrost/Maintainer\"")?; - require_text( - &request_text, - "requested_effect = \"record-compute-review-and-artifact-accounting\"", - )?; - require_text(&request_text, "publication_request_ref = ")?; - require_text(&request_text, "credit_request_ref = ")?; - require_text(&request_text, "artifact_acceptance_request_ref = ")?; - require_text( - &request_text, - "metrics_scope = \"model spend, review load, accepted artifact, public proof, and credit readback\"", - )?; - require_text(&request_text, "[antecedents]")?; - require_text(&request_text, "closure_review_required = true")?; - require_text(&request_text, "soul_verdict_required = true")?; - require_text(&request_text, "mind_commit_required = true")?; - require_text(&request_text, "public_proof_required = true")?; - require_text(&request_text, "accepted_artifact_required = true")?; - require_text(&request_text, "credit_request_required = true")?; - require_text(&request_text, "[required_receipts]")?; - require_text( - &request_text, - "closure_review = \"epiphany.repo_work_closure_review.v0\"", - )?; - require_text( - &request_text, - "soul_verdict = \"epiphany.soul.verification_verdict\"", - )?; - require_text( - &request_text, - "mind_commit = \"epiphany.mind.state_commit_receipt\"", - )?; - require_text( - &request_text, - "public_proof = \"epiphany.repo_work_public_proof_bundle.v0\"", - )?; - require_text( - &request_text, - "accepted_artifact = \"gamecult.artifact.acceptance_receipt.v0\"", - )?; - require_text( - &request_text, - "model_spend = \"gamecult.metrics.model_spend_receipt.v0\"", - )?; - require_text( - &request_text, - "review_load = \"gamecult.metrics.review_load_receipt.v0\"", - )?; - require_text( - &request_text, - "credit_readback = \"gamecult.bifrost.credit_readback_receipt.v0\"", - )?; - require_text(&request_text, "[metrics_packet]")?; - require_text(&request_text, "requires_model_call_count = true")?; - require_text(&request_text, "requires_token_or_cost_summary = true")?; - require_text(&request_text, "requires_review_minutes_or_count = true")?; - require_text(&request_text, "requires_accepted_artifact_ref = true")?; - require_text(&request_text, "requires_public_proof_ref = true")?; - require_text(&request_text, "requires_credit_readback_ref = true")?; - require_text( - &request_text, - "requires_private_state_redaction_check = true", - )?; - require_text(&request_text, "metrics_ledger_authorized = false")?; - require_text(&request_text, "spend_authorized = false")?; - require_text(&request_text, "review_load_authorized = false")?; - require_text(&request_text, "credit_ledger_authorized = false")?; - require_text(&request_text, "github_pr_authorized = false")?; - require_text(&request_text, "merge_authorized = false")?; - require_text(&request_text, "publication_authorized = false")?; - require_text(&request_text, "upstream_sync_authorized = false")?; - require_text(&request_text, "hands_action_authorized = false")?; - require_text(&request_text, "cross_body_mutation_authorized = false")?; - require_text( - &request_text, - "bifrost_or_maintainer_metrics_authority_required = true", - )?; - require_text(&request_text, "private_state_exposed = false")?; - require_bifrost_accounting_row(&open_bifrost_ledger, "metrics-request", "open", 3, 1)?; - require_tui_row_contains( - &open_bifrost_ledger, - &["accountingTuiRows"], - "BIFROST-ACCOUNTING | metrics-request", - )?; - require_tui_row_contains(&open_bifrost_ledger, &["accountingTuiRows"], "status=open")?; - require_tui_row_contains( - &open_bifrost_ledger, - &["accountingTuiRows"], - "request=present", - )?; - require_bool(&open_bifrost_ledger, &["privateStateExposed"], false)?; - require_eq( - &metrics_receipt, - &["receiptId"], - "bifrost-metrics-repo-metrics-request-family", - )?; - require_eq(&metrics_receipt, &["status"], "ok")?; - require_bool(&metrics_receipt, &["privateStateExposed"], false)?; - require_bifrost_accounting_row(&closed_bifrost_ledger, "metrics-request", "closed", 2, 1)?; - require_tui_row_contains( - &closed_bifrost_ledger, - &["accountingTuiRows"], - "metrics=present", - )?; - require_tui_row_contains(&closed_bifrost_ledger, &["accountingTuiRows"], "credit=1")?; - require_tui_row_contains( - &closed_bifrost_ledger, - &["accountingTuiRows"], - "receipt=bifrost-metrics-repo-metrics-request-family", - )?; - require_bool(&closed_bifrost_ledger, &["privateStateExposed"], false)?; - - let summary = json!({ - "schemaVersion": "epiphany.repo_metrics_request_family_smoke.v0", - "status": "ok", - "smokeDir": smoke_dir, - "repo": repo, - "branch": git_output(["branch", "--show-current"], &repo)?, - "item": item, - "safeActionFamily": plan["derivation"]["safeActionFamily"], - "targetPath": target_path, - "closeStatus": close["status"], - "soulVerdict": close["soul"]["verdict"], - "familyAssertionsStatus": close["closureReview"]["familyAssertions"]["status"], - "pathScopeMatched": close["closureReview"]["sourceGrounding"]["pathScopeMatched"], - "awaitingMetricsReview": true, - "metricsLedgerAuthorized": false, - "spendAuthorized": false, - "reviewLoadAuthorized": false, - "creditLedgerAuthorized": false, - "githubPrAuthorized": false, - "mergeAuthorized": false, - "publicationAuthorized": false, - "upstreamSyncAuthorized": false, - "handsActionAuthorized": false, - "bifrostLedgerAccountingRowCount": closed_bifrost_ledger["accountingRowCount"], - "bifrostMetricsReceiptId": metrics_receipt["receiptId"], - "bifrostMetricsOpenAccountingRow": bifrost_accounting_row_value(&open_bifrost_ledger, "metrics-request")?, - "bifrostMetricsClosedAccountingRow": bifrost_accounting_row_value(&closed_bifrost_ledger, "metrics-request")?, - "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 git(args: [&str; N], cwd: &Path) -> Result<()> { - let output = Command::new("git") - .args(args) - .current_dir(cwd) - .output() - .with_context(|| format!("failed to run git in {}", cwd.display()))?; - if output.status.success() { - Ok(()) - } else { - Err(anyhow!( - "git failed in {} with status {:?}\nstdout:\n{}\nstderr:\n{}", - cwd.display(), - output.status.code(), - String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr) - )) - } -} - -fn git_output(args: [&str; N], cwd: &Path) -> Result { - let output = Command::new("git") - .args(args) - .current_dir(cwd) - .output() - .with_context(|| format!("failed to run git in {}", cwd.display()))?; - if output.status.success() { - Ok(String::from_utf8_lossy(&output.stdout).trim().to_string()) - } else { - Err(anyhow!( - "git failed in {} with status {:?}\nstdout:\n{}\nstderr:\n{}", - cwd.display(), - output.status.code(), - String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr) - )) - } -} - -fn read_json(path: &Path) -> Result { - let bytes = fs::read(path).with_context(|| format!("failed to read {}", path.display()))?; - serde_json::from_slice(&bytes).with_context(|| format!("failed to parse {}", path.display())) -} - -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_text(haystack: &str, needle: &str) -> Result<()> { - if haystack.contains(needle) { - Ok(()) - } else { - Err(anyhow!( - "expected metrics request text to contain {needle:?}" - )) - } -} - -fn require_tui_row_contains(value: &Value, path: &[&str], needle: &str) -> Result<()> { - let rows = path - .iter() - .try_fold(value, |current, key| current.get(*key)) - .and_then(Value::as_array) - .ok_or_else(|| anyhow!("missing TUI row array {}", path.join(".")))?; - if rows - .iter() - .filter_map(Value::as_str) - .any(|row| row.contains(needle)) - { - Ok(()) - } else { - Err(anyhow!( - "expected {} to contain row fragment {needle:?}", - path.join(".") - )) - } -} - -fn bifrost_accounting_row_value<'a>(value: &'a Value, lane: &str) -> Result<&'a Value> { - value - .get("accountingRows") - .and_then(Value::as_array) - .and_then(|rows| { - rows.iter() - .find(|row| row.get("lane").and_then(Value::as_str) == Some(lane)) - }) - .ok_or_else(|| anyhow!("missing Bifrost accounting row {lane:?}")) -} - -fn require_bifrost_accounting_row( - value: &Value, - lane: &str, - status: &str, - review_receipt_count: u64, - public_artifact_count: u64, -) -> Result<()> { - let row = bifrost_accounting_row_value(value, lane)?; - let actual_status = row - .get("status") - .and_then(Value::as_str) - .unwrap_or(""); - let actual_review_receipt_count = row - .get("reviewReceiptCount") - .and_then(Value::as_u64) - .unwrap_or(0); - let actual_public_artifact_count = row - .get("publicArtifactCount") - .and_then(Value::as_u64) - .unwrap_or(0); - let actual_private = row - .get("privateStateExposed") - .and_then(Value::as_bool) - .unwrap_or(true); - if actual_status == status - && actual_review_receipt_count == review_receipt_count - && actual_public_artifact_count == public_artifact_count - && !actual_private - { - Ok(()) - } else { - Err(anyhow!( - "Bifrost accounting row {lane:?} mismatch: status={actual_status:?}, reviewReceiptCount={actual_review_receipt_count}, publicArtifactCount={actual_public_artifact_count}, privateStateExposed={actual_private}" - )) - } -} - -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 884b39b8..1eb048dc 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 @@ -52,7 +52,6 @@ struct Args { smoke_root: PathBuf, fresh_repo_summary: Option, readiness_summary: Option, - bifrost_accounting_summary: Option, daemon_survival_summary: Option, } @@ -62,7 +61,6 @@ impl Args { let mut smoke_root = root.join(".epiphany-smoke"); 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() { @@ -75,10 +73,6 @@ impl Args { "--readiness-summary" => { readiness_summary = Some(take_path(&mut args, "--readiness-summary")?) } - "--bifrost-accounting-summary" => { - 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")?) @@ -91,7 +85,6 @@ impl Args { smoke_root, fresh_repo_summary, readiness_summary, - bifrost_accounting_summary, daemon_survival_summary, }) } @@ -126,21 +119,16 @@ fn run_smoke(args: Args) -> Result { let readiness_summary = args .readiness_summary .unwrap_or_else(|| latest_summary(&args.smoke_root, "repo-work-readiness-")); - 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 weksa_interlingua = verify_weksa_interlingua()?; let persona_memory_recall = verify_persona_memory_recall()?; @@ -198,11 +186,6 @@ fn run_smoke(args: Args) -> Result { "Bifrost", "readiness review is queryable through the receipt directory", ), - green( - "bifrost-accounting", - "Bifrost", - "readiness, artifact acceptance, and metrics accounting rows are closed", - ), green( "long-running-daemon-proof", "Idunn", @@ -245,11 +228,9 @@ fn run_smoke(args: Args) -> Result { "smokeDir": smoke_dir, "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"], "weksaInterlingua": weksa_interlingua, "personaMemoryRecall": persona_memory_recall, @@ -333,36 +314,6 @@ fn verify_readiness(value: &Value) -> Result<()> { ) } -fn verify_bifrost_accounting(value: &Value) -> Result<()> { - require_eq( - value, - &["schemaVersion"], - "epiphany.repo_bifrost_accounting_bundle_smoke.v0", - )?; - require_eq(value, &["status"], "ok")?; - require_eq(value, &["artifactAcceptanceCloseStatus"], "closed")?; - require_eq(value, &["metricsCloseStatus"], "closed")?; - require_bool(value, &["operatorSafeProofBundle"], true)?; - require_bool(value, &["planningAuthorityOnly"], true)?; - require_bool(value, &["privateStateExposed"], false)?; - require_row( - value, - &["artifactAcceptanceClosedAccountingRow"], - "artifact-acceptance-request", - "closed", - 1, - 1, - )?; - require_row( - value, - &["metricsClosedAccountingRow"], - "metrics-request", - "closed", - 2, - 1, - ) -} - fn verify_daemon_survival(value: &Value) -> Result<()> { require_eq( value, diff --git a/notes/conceptual-substitution-audit-2026-07-12.md b/notes/conceptual-substitution-audit-2026-07-12.md index a63578ac..5613d19d 100644 --- a/notes/conceptual-substitution-audit-2026-07-12.md +++ b/notes/conceptual-substitution-audit-2026-07-12.md @@ -279,3 +279,16 @@ MVP gate no longer accepts its summary or publishes a green deployment row. Deployment config audit and operator runbook commands remain requester/operator surfaces; typed Idunn schemas/readers remain ingest contracts. Only an actual Idunn body may make deployment or aftercare complete. + +## Stale Bifrost accounting closure + +The artifact-acceptance and metrics request-family smokes still invoked generic +query commands as though they returned Bifrost response receipts, then asserted +their accounting rows changed from open to closed. That behavior predates the +requester/provider split. A bundle smoke aggregated those stale summaries, and +the MVP gate counted the result as green Bifrost accounting. + +Both response-closing family smokes, their bundle verifier, its PowerShell mode, +and the aggregate green gate are deleted. Request cargo and open ledger rows +remain valid. Typed Bifrost/Maintainer response schemas remain ingest contracts, +but accounting cannot close until their actual bodies author the receipts. diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 200cc781..b4254446 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -50,6 +50,7 @@ - Eve connection requests remain pending until a real target provider daemon or authenticated ingest boundary supplies the typed response. The former generic `epiphany-eve-provider` CLI is deleted because caller-supplied provider identity and status did not constitute provider participation; local response construction/writing is test-only. - Daemon-tool invocation requests likewise remain pending until the advertised host daemon or authenticated ingest boundary supplies the typed response. Local response construction/writing/validation is test-only; aggregate smoke and receipt-directory projection prove intent-present/receipt-missing instead of manufacturing host acceptance. - Idunn deployment and aftercare outcomes have no local production writer. The synthetic deployment-config family smoke and its green aggregate MVP-gate handoff are deleted; config audit/runbook remain pre-deployment surfaces, while typed Idunn readers await genuine daemon-authored ingest. +- Bifrost artifact-acceptance and metrics requests remain open until actual Bifrost/Maintainer receipts are ingested. The stale response-closing request-family smokes, accounting bundle, wrapper mode, and aggregate green gate are deleted. - Persona owner: `collaboration-feedback` writes public, bounded feedback only after that provider receipt exists. - Imagination owner: consensus participant selection, packet reference, receipt status/id, and adoption gate. - Persona output: `pending-imagination` with null consensus fields and `responseOwner=Imagination`. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 444fcdd8..9c62b088 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -64,6 +64,9 @@ The confirmed conceptual substitutions have been cut: they fabricated Idunn `deployed`/`complete` receipts. Epiphany exposes config audit/runbook requests and typed Idunn readers, but no local deployment or aftercare response writer. +- the artifact-acceptance/metrics response-closing smokes, Bifrost accounting + bundle, wrapper mode, and aggregate green gate are deleted. Their request + cargo remains open until genuine Bifrost/Maintainer response ingest. 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/notes/receipt-writer-provenance-audit-2026-07-12.md b/notes/receipt-writer-provenance-audit-2026-07-12.md index c4f9cfe5..039f95eb 100644 --- a/notes/receipt-writer-provenance-audit-2026-07-12.md +++ b/notes/receipt-writer-provenance-audit-2026-07-12.md @@ -19,6 +19,10 @@ Inventory every production call to `write_*receipt`, then ask whether the execut deployment-config family smoke was their only caller and fabricated a closed deployment chain; the smoke, writers, and validators are deleted. Typed schemas/readers remain for genuine Idunn-authored ingest. +- Bifrost artifact-acceptance and metrics closure smokes: deleted. Their request + family binaries still expected generic query commands to manufacture final + provider receipts, and the bundle/MVP gate promoted those stale summaries to + green accounting. Request documents remain; provider closure remains absent. - `epiphany-operator-run`: owner-aligned for operator-run receipts and coordinator receipts derived from the run it executes. - smoke binaries and the `epiphany-verse-query smoke` arm: fixtures, not runtime evidence. They remain a quarantine risk if permitted to target canonical stores. - `epiphany-work` Weksa lowering: a lowering projection receipt, explicitly non-publication authority; no substitution confirmed in this pass. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index ca994db8..494ca886 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 7ee7032c..8465e7b3 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -636,7 +636,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-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, daemon survival, Weksa interlingua, and Persona semantic memory recall proofs as one operator-safe MVP gate report; direct proof `.epiphany-smoke\repo-swarm-mvp-gate-20260621-174742` reports `demoReady=true`, `mvpReady=false`, fourteen green gates, one Idunn elevated-service warning gate, zero blockers, `personaMemoryRecall.cacheStatus=qdrant-unavailable`, `personaMemoryRecall.status=fallback`, `personaMemoryRecall.dynamicCacheStatus=qdrant-unavailable`, `personaMemoryRecall.dynamicRecallWired=true`, `personaMemoryRecall.heartbeatRecallWired=true`, Projector/Persona/output-triggered Interpreter prompt coverage, and `privateStateExposed=false`. Repo Persona intake now records both pre-turn semantic recall and `interpreterDynamicRecall` from candidate SAY meaning; this matches VoidBot's two-pass Projector/Face/Interpreter memory membrane while preserving the scaffold seal that repo-intake is not yet a full autonomous model Persona turn. + - `epiphany-verse-query bifrost-ledger` is read-only Bifrost sight over typed requester and provider documents. Artifact-acceptance and metrics request rows remain open until genuine Bifrost/Maintainer receipts are ingested. The stale response-closing family smokes, accounting bundle wrapper, and aggregate green gate are deleted; no local query command may close provider accounting. - `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. diff --git a/tools/epiphany_local_run.ps1 b/tools/epiphany_local_run.ps1 index aa565ff6..f391d2fc 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", "persona-discord", "persona-reddit", "persona-other", "persona-bridge", "daemon-survival-rehearsal", "repo-swarm-mvp-gate", "repo-livefire-closure", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "repo-persona-intake", "repo-swarm-run", "repo-work-queue-run", "repo-work-public-proof", "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", "persona-discord", "persona-reddit", "persona-other", "persona-bridge", "daemon-survival-rehearsal", "repo-swarm-mvp-gate", "repo-livefire-closure", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "repo-persona-intake", "repo-swarm-run", "repo-work-queue-run", "repo-work-public-proof", "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 = "", @@ -51,8 +51,6 @@ param( [string]$BifrostReviewLoadReceipt = "review-load-local-proof", [string]$BifrostCreditReadbackReceipt = "credit-readback-local-proof", [string]$BifrostMetricsSummary = "model spend, review load, accepted artifact, and credit readback recorded", - [string]$BifrostArtifactSummaryPath = "", - [string]$BifrostMetricsSummaryPath = "", [string]$RepoSwarmMvpFreshRepoSummaryPath = "", [string]$RepoSwarmMvpReadinessSummaryPath = "", [string]$RepoSwarmMvpBifrostAccountingSummaryPath = "", @@ -350,7 +348,6 @@ $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" $repoLivefireClosureSmokeExe = Join-Path $TargetDir "debug\epiphany-repo-livefire-closure-smoke.exe" -$bifrostAccountingBundleExe = Join-Path $TargetDir "debug\epiphany-repo-bifrost-accounting-bundle-smoke.exe" $swarmExe = Join-Path $TargetDir "debug\epiphany-swarm.exe" $repoWorkExe = Join-Path $TargetDir "debug\epiphany-work.exe" $daemonSupervisorExe = Join-Path $TargetDir "debug\epiphany-daemon-supervisor.exe" @@ -398,7 +395,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 "persona-discord" -and $Mode -ne "persona-reddit" -and $Mode -ne "persona-other" -and $Mode -ne "persona-bridge" -and $Mode -ne "daemon-survival-rehearsal" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "repo-livefire-closure" -and $Mode -ne "repo-work-public-proof" -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 "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 "persona-discord" -and $Mode -ne "persona-reddit" -and $Mode -ne "persona-other" -and $Mode -ne "persona-bridge" -and $Mode -ne "daemon-survival-rehearsal" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "repo-livefire-closure" -and $Mode -ne "repo-work-public-proof" -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-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -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 ` @@ -421,7 +418,6 @@ if (-not $SkipBuild) { "--bin", "epiphany-daemon-survival-rehearsal-smoke", "--bin", "epiphany-repo-swarm-mvp-gate-smoke", "--bin", "epiphany-repo-livefire-closure-smoke", - "--bin", "epiphany-repo-bifrost-accounting-bundle-smoke", "--bin", "epiphany-swarm", "--bin", "epiphany-work", "--bin", "epiphany-daemon-supervisor", @@ -472,13 +468,10 @@ if ($Mode -eq "repo-swarm-mvp-gate") { if ($Mode -eq "repo-livefire-closure") { $requiredBinaries += @($repoLivefireClosureSmokeExe) } -if ($Mode -eq "bifrost-accounting-bundle") { - $requiredBinaries += @($bifrostAccountingBundleExe) -} if ($Mode -eq "persona-bridge") { $requiredBinaries += @($PersonaBridgeSmokeExe) } -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 "persona-discord" -and $Mode -ne "persona-reddit" -and $Mode -ne "persona-other" -and $Mode -ne "persona-bridge" -and $Mode -ne "daemon-survival-rehearsal" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "repo-livefire-closure" -and $Mode -ne "repo-work-public-proof" -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 "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 "persona-discord" -and $Mode -ne "persona-reddit" -and $Mode -ne "persona-other" -and $Mode -ne "persona-bridge" -and $Mode -ne "daemon-survival-rehearsal" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "repo-livefire-closure" -and $Mode -ne "repo-work-public-proof" -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-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -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 { @@ -650,7 +643,7 @@ Invoke-Checked ` -StdoutPath (Join-Path $artifactRoot "operator-run-intent.stdout.json") ` -StderrPath (Join-Path $artifactRoot "operator-run-intent.stderr.log") -$compactOperatorContextModes = @("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", "repo-livefire-closure", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "swarm-online-runbook", "service-policy-directory") +$compactOperatorContextModes = @("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", "repo-livefire-closure", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "swarm-online-runbook", "service-policy-directory") $usesCompactOperatorContext = $compactOperatorContextModes -contains $Mode $shouldReadLocalVerse = $Mode -ne "smoke" -and -not $usesCompactOperatorContext if ($shouldReadLocalVerse -and $Mode -ne "status" -and $Mode -ne "mvp") { @@ -1125,27 +1118,6 @@ if ($Mode -eq "repo-livefire-closure") { -StderrPath (Join-Path $artifactRoot "repo-livefire-closure.stderr.log") } -if ($Mode -eq "bifrost-accounting-bundle") { - $resultPath = Join-Path $artifactRoot "bifrost-accounting-bundle.stdout.json" - $bundleArgs = @( - "--root", $Root, - "--smoke-root", (Join-Path $Root ".epiphany-smoke") - ) - if ($BifrostArtifactSummaryPath -ne "") { - $bundleArgs += @("--artifact-summary", $BifrostArtifactSummaryPath) - } - if ($BifrostMetricsSummaryPath -ne "") { - $bundleArgs += @("--metrics-summary", $BifrostMetricsSummaryPath) - } - Invoke-Checked ` - -Label "verify Bifrost accounting bundle proof" ` - -FilePath $bifrostAccountingBundleExe ` - -Arguments $bundleArgs ` - -WorkingDirectory $Root ` - -StdoutPath $resultPath ` - -StderrPath (Join-Path $artifactRoot "bifrost-accounting-bundle.stderr.log") -} - if ($Mode -eq "bifrost-ledger") { $resultPath = Join-Path $artifactRoot "bifrost-ledger.stdout.json" Invoke-Checked ` @@ -2815,8 +2787,6 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { $changedPaths = ($result.changedPaths -join ",") } Write-Host "Repo live-fire closure: status=$($result.status), item=$($result.item), branch=$($result.branch), commit=$($result.commitSha), family=$($result.safeActionFamily), paths=$changedPaths, gate=$($result.currentGate), blocker=$($result.blocker), publicationGate=$($result.publicationGate), soul=$($result.soulVerdict), mindCommit=$($result.mindStateCommitReceiptId), privateStateExposed=$($result.privateStateExposed)" - } elseif ($Mode -eq "bifrost-accounting-bundle") { - Write-Host "Bifrost accounting bundle: status=$($result.status), artifactFamily=$($result.artifactAcceptanceFamily), metricsFamily=$($result.metricsFamily), artifactReceipt=$($result.artifactAcceptanceReceiptId), metricsReceipt=$($result.metricsReceiptId), planningAuthorityOnly=$($result.planningAuthorityOnly), operatorSafeProofBundle=$($result.operatorSafeProofBundle), privateStateExposed=$($result.privateStateExposed), smokeDir=$($result.smokeDir)" } elseif ($Mode -eq "bifrost-ledger") { $ledgerRows = "none" if ($null -ne $result.tuiRows -and $result.tuiRows.Count -gt 0) {