Add repo swarm MVP gate proof

This commit is contained in:
Meta Vens 2026-06-21 14:48:34 +01:00
commit d01f45740d
5 changed files with 507 additions and 6 deletions

View file

@ -0,0 +1,462 @@
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,
fresh_repo_summary: Option<PathBuf>,
readiness_summary: Option<PathBuf>,
bifrost_accounting_summary: Option<PathBuf>,
}
impl Args {
fn parse() -> Result<Self> {
let mut root = env::current_dir().context("failed to resolve current directory")?;
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 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")?,
"--fresh-repo-summary" => {
fresh_repo_summary = Some(take_path(&mut args, "--fresh-repo-summary")?)
}
"--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")?)
}
other => return Err(anyhow!("unexpected argument {other:?}")),
}
}
Ok(Self {
root,
smoke_root,
fresh_repo_summary,
readiness_summary,
bifrost_accounting_summary,
})
}
}
fn run_smoke(args: Args) -> Result<Value> {
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-swarm-mvp-gate-{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 fresh_repo_summary = args
.fresh_repo_summary
.unwrap_or_else(|| latest_summary(&args.smoke_root, "fresh-repo-mvp-"));
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 fresh = read_json(&fresh_repo_summary)?;
let readiness = read_json(&readiness_summary)?;
let bifrost = read_json(&bifrost_accounting_summary)?;
verify_fresh_repo(&fresh)?;
verify_readiness(&readiness)?;
verify_bifrost_accounting(&bifrost)?;
let gate_rows = vec![
green(
"fresh-repo-body",
"Hands",
"epiphany-repo init + branch + commit receipt",
),
green("swarm-online", "Self", "epiphany-swarm online"),
green("persona-intake", "Persona", "persona-intake work item"),
green(
"imagination-plan",
"Imagination",
"model-authored repo-status-section plan",
),
green(
"self-scheduler-stop",
"Self",
"iteration-limit stop classification is explicit and nonmutating",
),
green(
"soul-closure",
"Soul",
"closed item with passed verdict and family assertions",
),
green(
"upstream-main-sync",
"Hands",
"publish + git push/fetch + sync reports upstream main synced",
),
green(
"public-proof",
"Bifrost",
"operator-safe public proof exported without private state",
),
green(
"readiness-review",
"Soul",
"readiness report and review receipt are present",
),
green(
"receipt-directory",
"Bifrost",
"readiness review is queryable through the receipt directory",
),
green(
"bifrost-accounting",
"Bifrost",
"readiness, artifact acceptance, and metrics accounting rows are closed",
),
warning(
"idunn-elevated-service",
"Idunn",
"service install/start/remote deployment execution remains explicit operator authority",
),
warning(
"long-running-daemon-proof",
"Idunn",
"unattended daemon survival is planned and audited but not yet a green MVP gate",
),
];
let green_gate_count = gate_rows
.iter()
.filter(|row| row["status"] == "green")
.count();
let warning_gate_count = gate_rows
.iter()
.filter(|row| row["status"] == "warning")
.count();
let blocker_gate_count = gate_rows
.iter()
.filter(|row| row["status"] == "blocker")
.count();
let gate_tui_rows = gate_rows
.iter()
.map(|row| {
format!(
"MVP-GATE | {} | status={} | owner={} | evidence={}",
row["gate"].as_str().unwrap_or("unknown"),
row["status"].as_str().unwrap_or("unknown"),
row["owner"].as_str().unwrap_or("unknown"),
row["evidence"].as_str().unwrap_or("unknown")
)
})
.collect::<Vec<_>>();
let summary = json!({
"schemaVersion": "epiphany.repo_swarm_mvp_gate_smoke.v0",
"status": "mvp-demo-ready-with-known-operator-gates",
"smokeDir": smoke_dir,
"freshRepoSummary": fresh_repo_summary,
"readinessSummary": readiness_summary,
"bifrostAccountingSummary": bifrost_accounting_summary,
"freshRepoSmokeDir": fresh["smokeDir"],
"readinessSmokeDir": readiness["smokeDir"],
"bifrostAccountingSmokeDir": bifrost["smokeDir"],
"mvpReady": false,
"demoReady": true,
"greenGateCount": green_gate_count,
"warningGateCount": warning_gate_count,
"blockerGateCount": blocker_gate_count,
"gateRows": gate_rows,
"gateTuiRows": gate_tui_rows,
"knownRemainingAuthorityGates": [
"Idunn elevated service install/start/remote deployment execution",
"unattended long-running daemon survival proof"
],
"privateStateExposed": false,
});
write_json(&smoke_dir.join("summary.json"), &summary)?;
Ok(summary)
}
fn verify_fresh_repo(value: &Value) -> Result<()> {
require_eq(
value,
&["schemaVersion"],
"epiphany.repo_swarm_fresh_repo_mvp_smoke.v0",
)?;
require_eq(value, &["status"], "ok")?;
require_eq(value, &["onlineStatus"], "attention")?;
require_eq(
value,
&["personaIntakeStatus"],
"accepted-for-imagination-consensus",
)?;
require_eq(value, &["planStatus"], "planned-for-self-adoption")?;
require_eq(value, &["swarmRunStopCategory"], "iteration-limit")?;
require_eq(value, &["swarmRunStopOwner"], "Self")?;
require_eq(
value,
&["swarmRunStopGate"],
"self.scheduler-iteration-limit",
)?;
require_eq(value, &["closeStatus"], "closed")?;
require_eq(value, &["soulVerdict"], "passed")?;
require_eq(value, &["familyAssertionsStatus"], "passed")?;
require_eq(value, &["publishStatus"], "publication-receipts-recorded")?;
require_eq(value, &["syncStatus"], "upstream-main-synced")?;
require_bool(value, &["upstreamMainSynced"], true)?;
require_eq(value, &["publicProofStatus"], "public-proof-exported")?;
require_bool(value, &["privateStateExposed"], false)
}
fn verify_readiness(value: &Value) -> Result<()> {
require_eq(
value,
&["schemaVersion"],
"epiphany.repo_work_readiness_smoke.v0",
)?;
require_eq(value, &["status"], "ok")?;
require_eq(value, &["readinessStatus"], "ready")?;
require_eq(value, &["readinessReviewStatus"], "readiness-approved")?;
require_eq(value, &["publishStatus"], "publication-receipts-recorded")?;
require_eq(value, &["syncStatus"], "upstream-main-synced")?;
require_bool(value, &["upstreamMainSynced"], true)?;
require_bool(value, &["privateStateExposed"], false)?;
require_bool(value, &["sightOnly"], true)?;
require_bool(value, &["readinessApprovalAuthorized"], false)?;
require_bool(value, &["publicationAuthorized"], false)?;
require_bool(value, &["deploymentAuthority"], false)?;
require_bool(value, &["serviceLifecycleAuthority"], false)?;
require_bool(value, &["handsActionAuthorized"], false)?;
require_row(
value,
&["bifrostReadinessReviewAccountingRow"],
"repo-work-readiness-review",
"closed",
4,
1,
)
}
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 green(gate: &str, owner: &str, evidence: &str) -> Value {
json!({
"gate": gate,
"status": "green",
"owner": owner,
"evidence": evidence,
"privateStateExposed": false,
})
}
fn warning(gate: &str, owner: &str, evidence: &str) -> Value {
json!({
"gate": gate,
"status": "warning",
"owner": owner,
"evidence": evidence,
"privateStateExposed": false,
})
}
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<Value> {
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("<missing>");
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,
) -> 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("<missing>");
let actual_status = row
.get("status")
.and_then(Value::as_str)
.unwrap_or("<missing>");
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_lane == lane
&& actual_status == status
&& actual_review_receipt_count == review_receipt_count
&& actual_public_artifact_count == public_artifact_count
&& !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}, privateStateExposed={actual_private}",
path.join(".")
))
}
}
fn take_path(
args: &mut std::iter::Peekable<impl Iterator<Item = String>>,
flag: &str,
) -> Result<PathBuf> {
args.next()
.map(PathBuf::from)
.with_context(|| format!("missing value for {flag}"))
}

View file

@ -193,6 +193,7 @@ remembers doctrine; the branch remembers the blade.
- `collaboration-feedback` is the compact public-feedback actuator; use it after or instead of manual `eve-connect` when Persona/human discussion should be routed to Imagination consensus discovery as typed local Verse receipts. Its JSON now points the next agent at Eve and Bifrost follow-on rites.
- `bifrost-publication` is the compact non-mutating Bifrost publication proof; use it to prove body-change routing, credit, and GitHub publication receipt state without performing GitHub mutation. Its JSON now points back to compact swarm overview and tool-directory readback.
- `bifrost-artifact-acceptance` and `bifrost-metrics` are compact Bifrost/Maintainer closure rites for the safe-family planning/accounting lanes. They write typed accepted-artifact and metrics receipts from explicit artifact/public-proof/review/model-spend/review-load/credit refs, verify latest receipt readback, and let `bifrost-ledger` close `artifact-acceptance-request` and `metrics-request` rows from Bifrost-owned receipts instead of request cargo. The request-family smokes now prove both states: `.epiphany-smoke\repo-artifact-acceptance-request-family-20260621-130520` and `.epiphany-smoke\repo-metrics-request-family-20260621-130635` first assert open request rows, then write final receipts and assert closed rows; wrapper proof `local-20260621-140740-750-2815f6f7` read the closed metrics row with `privateStateExposed=False`. `epiphany-repo-bifrost-accounting-bundle-smoke` consumes the closed family summaries and emits one operator-safe aggregate receipt; wrapper mode `tools/epiphany_local_run.ps1 -Mode bifrost-accounting-bundle` now builds/runs that verifier, accepts optional exact summary paths, writes normal operator run receipts, and proved bundle `.epiphany-smoke\repo-bifrost-accounting-bundle-20260621-132815` via wrapper artifact `local-20260621-142716-268-d6bc58b4` with final Bifrost receipt ids, `planningAuthorityOnly=true`, and `privateStateExposed=false`.
- `repo-swarm-mvp-gate` is the compact aggregate MVP proof rite. `epiphany-repo-swarm-mvp-gate-smoke` consumes the latest fresh-repo MVP, repo-work readiness, and Bifrost accounting-bundle summaries, verifies the green proof rows, and leaves Idunn elevated service execution plus unattended daemon survival as explicit warning gates instead of laundering them into completion. Wrapper mode `tools/epiphany_local_run.ps1 -Mode repo-swarm-mvp-gate` proved `.epiphany-smoke\repo-swarm-mvp-gate-20260621-134522` via wrapper artifact `local-20260621-144521-724-cdadf70f`: `demoReady=True`, `mvpReady=False`, `green=11`, `warnings=2`, `blockers=0`, and `privateStateExposed=False`.
- `bifrost-ledger` is the compact Bifrost/Imagination readback rite; use it after collaboration, publication, accepted-artifact, or metrics writes to see the latest body-change, public-proof, accepted-artifact, metrics, GitHub, feedback, consensus, credit/review-count, and accounting closure rows without opening the full local Verse.
- `tool-directory` is the non-mutating daemon tool sight rite; it shows which globally available daemon-hosted tools any agent can invoke through typed intents and receipts, while still exposing host readiness.
- `tool-invoke` now embeds compact readbacks for common daemon-hosted tools. Status calls return `daemonStatusReadback`, Eve calls return `eveConnectionReadback`, Self `service-health` returns Idunn-owned `serviceHealthReadback`, Self `service-policy-directory` returns Idunn-owned `servicePolicyDirectoryReadback`, Self `swarm-online-runbook` returns Idunn-owned `swarmOnlineRunbookReadback`, and Hands/Soul authority tools return `authorityToolReadback` with gate, input contract, receipt contract, intent/receipt routes, host cluster, and private-state seal. This proves global tool ergonomics without moving action, verification, or daemon lifecycle ownership into the wrapper; live proofs routed Persona to Hands `repo-action` (`local-20260619-021628-143-7bf7f2e0`), Soul `verify` (`local-20260619-021701-458-852cfa6f`), Self `swarm-online-runbook` (`local-20260619-032244-273-acb3c6a4`), and Self `service-policy-directory` (`local-20260619-035238-138-633f3ff0`) with `privateStateExposed=false`.

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -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", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "repo-persona-intake", "repo-swarm-run", "repo-work-queue-run", "repo-work-readiness", "repo-work-readiness-review", "repo-deployment-config-audit", "repo-deployment-runbook", "repo-deployment-aftercare-audit", "repo-work-service-plan", "repo-work-service-runbook", "repo-work-service-launch", "repo-work-service-audit", "swarm-online-runbook", "service-policy-directory", "service-plan", "service-launch", "service-runbook", "cluster-service-runbook", "cluster-service-install-plan", "cluster-service-install-execute", "cluster-service-audit", "cluster-service-start-plan", "cluster-service-stop-plan", "cluster-service-start-execute", "cluster-service-stop-execute", "cluster-service-execution-readiness", "cluster-service-execution-runbook", "cluster-service-execution-audit", "service-execution-runbook", "service-install-plan", "service-install-execute", "service-tick", "service-status", "service-reconcile", "service-execution-readiness", "service-execution-audit", "service-start-plan", "service-stop-plan", "service-start-execute", "service-stop-execute")]
[ValidateSet("status", "plan", "smoke", "run", "mvp", "agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "repo-swarm-mvp-gate", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "repo-persona-intake", "repo-swarm-run", "repo-work-queue-run", "repo-work-readiness", "repo-work-readiness-review", "repo-deployment-config-audit", "repo-deployment-runbook", "repo-deployment-aftercare-audit", "repo-work-service-plan", "repo-work-service-runbook", "repo-work-service-launch", "repo-work-service-audit", "swarm-online-runbook", "service-policy-directory", "service-plan", "service-launch", "service-runbook", "cluster-service-runbook", "cluster-service-install-plan", "cluster-service-install-execute", "cluster-service-audit", "cluster-service-start-plan", "cluster-service-stop-plan", "cluster-service-start-execute", "cluster-service-stop-execute", "cluster-service-execution-readiness", "cluster-service-execution-runbook", "cluster-service-execution-audit", "service-execution-runbook", "service-install-plan", "service-install-execute", "service-tick", "service-status", "service-reconcile", "service-execution-readiness", "service-execution-audit", "service-start-plan", "service-stop-plan", "service-start-execute", "service-stop-execute")]
[string]$Mode = "smoke",
[string]$Root = (Resolve-Path ".").Path,
[string]$Workspace = "",
@ -55,6 +55,9 @@ param(
[string]$BifrostMetricsSummary = "model spend, review load, accepted artifact, and credit readback recorded",
[string]$BifrostArtifactSummaryPath = "",
[string]$BifrostMetricsSummaryPath = "",
[string]$RepoSwarmMvpFreshRepoSummaryPath = "",
[string]$RepoSwarmMvpReadinessSummaryPath = "",
[string]$RepoSwarmMvpBifrostAccountingSummaryPath = "",
[string]$ToolCapabilityId = "epiphany.cluster.hands.tool.repo-action",
[string]$ToolRequestingAgentId = "epiphany.Persona",
[string]$ToolRequestingClusterId = "epiphany.cluster.persona",
@ -332,6 +335,7 @@ $statusExe = Join-Path $TargetDir "debug\epiphany-mvp-status.exe"
$operatorRunExe = Join-Path $TargetDir "debug\epiphany-operator-run.exe"
$operatorSnapshotExe = Join-Path $TargetDir "debug\epiphany-operator-snapshot.exe"
$verseQueryExe = Join-Path $TargetDir "debug\epiphany-verse-query.exe"
$repoSwarmMvpGateExe = Join-Path $TargetDir "debug\epiphany-repo-swarm-mvp-gate-smoke.exe"
$bifrostAccountingBundleExe = Join-Path $TargetDir "debug\epiphany-repo-bifrost-accounting-bundle-smoke.exe"
$swarmExe = Join-Path $TargetDir "debug\epiphany-swarm.exe"
$repoWorkExe = Join-Path $TargetDir "debug\epiphany-work.exe"
@ -377,7 +381,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 "bifrost-publication" -and $Mode -ne "bifrost-public-proof" -and $Mode -ne "bifrost-artifact-acceptance" -and $Mode -ne "bifrost-metrics" -and $Mode -ne "bifrost-accounting-bundle" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-persona-intake" -and $Mode -ne "repo-swarm-run" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "repo-work-readiness" -and $Mode -ne "repo-work-readiness-review" -and $Mode -ne "repo-deployment-config-audit" -and $Mode -ne "repo-deployment-runbook" -and $Mode -ne "repo-deployment-aftercare-audit" -and $Mode -ne "repo-work-service-plan" -and $Mode -ne "repo-work-service-runbook" -and $Mode -ne "repo-work-service-launch" -and $Mode -ne "repo-work-service-audit" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") {
if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-public-proof" -and $Mode -ne "bifrost-artifact-acceptance" -and $Mode -ne "bifrost-metrics" -and $Mode -ne "bifrost-accounting-bundle" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-persona-intake" -and $Mode -ne "repo-swarm-run" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "repo-work-readiness" -and $Mode -ne "repo-work-readiness-review" -and $Mode -ne "repo-deployment-config-audit" -and $Mode -ne "repo-deployment-runbook" -and $Mode -ne "repo-deployment-aftercare-audit" -and $Mode -ne "repo-work-service-plan" -and $Mode -ne "repo-work-service-runbook" -and $Mode -ne "repo-work-service-launch" -and $Mode -ne "repo-work-service-audit" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") {
Invoke-Checked `
-Label "build Codex app-server compatibility organ" `
-FilePath $cargoExe `
@ -397,6 +401,7 @@ if (-not $SkipBuild) {
"--bin", "epiphany-operator-run",
"--bin", "epiphany-operator-snapshot",
"--bin", "epiphany-verse-query",
"--bin", "epiphany-repo-swarm-mvp-gate-smoke",
"--bin", "epiphany-repo-bifrost-accounting-bundle-smoke",
"--bin", "epiphany-swarm",
"--bin", "epiphany-work",
@ -435,10 +440,13 @@ if (-not $SkipBuild) {
}
$requiredBinaries = @($statusExe, $operatorRunExe, $operatorSnapshotExe, $verseQueryExe, $swarmExe, $repoWorkExe, $daemonSupervisorExe, $handsActionExe)
if ($Mode -eq "repo-swarm-mvp-gate") {
$requiredBinaries += @($repoSwarmMvpGateExe)
}
if ($Mode -eq "bifrost-accounting-bundle") {
$requiredBinaries += @($bifrostAccountingBundleExe)
}
if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-public-proof" -and $Mode -ne "bifrost-artifact-acceptance" -and $Mode -ne "bifrost-metrics" -and $Mode -ne "bifrost-accounting-bundle" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-persona-intake" -and $Mode -ne "repo-swarm-run" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "repo-work-readiness" -and $Mode -ne "repo-work-readiness-review" -and $Mode -ne "repo-deployment-config-audit" -and $Mode -ne "repo-deployment-runbook" -and $Mode -ne "repo-deployment-aftercare-audit" -and $Mode -ne "repo-work-service-plan" -and $Mode -ne "repo-work-service-runbook" -and $Mode -ne "repo-work-service-launch" -and $Mode -ne "repo-work-service-audit" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") {
if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "repo-swarm-mvp-gate" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-public-proof" -and $Mode -ne "bifrost-artifact-acceptance" -and $Mode -ne "bifrost-metrics" -and $Mode -ne "bifrost-accounting-bundle" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-persona-intake" -and $Mode -ne "repo-swarm-run" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "repo-work-readiness" -and $Mode -ne "repo-work-readiness-review" -and $Mode -ne "repo-deployment-config-audit" -and $Mode -ne "repo-deployment-runbook" -and $Mode -ne "repo-deployment-aftercare-audit" -and $Mode -ne "repo-work-service-plan" -and $Mode -ne "repo-work-service-runbook" -and $Mode -ne "repo-work-service-launch" -and $Mode -ne "repo-work-service-audit" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") {
$requiredBinaries += @($codexAppServer, $coordinatorExe)
}
function Assert-SwarmBrakeAllowsLiveRun {
@ -601,7 +609,7 @@ Invoke-Checked `
-StdoutPath (Join-Path $artifactRoot "operator-run-intent.stdout.json") `
-StderrPath (Join-Path $artifactRoot "operator-run-intent.stderr.log")
$compactReadOnlyModes = @("agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "swarm-online-runbook", "service-policy-directory")
$compactReadOnlyModes = @("agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "repo-swarm-mvp-gate", "bifrost-publication", "bifrost-public-proof", "bifrost-artifact-acceptance", "bifrost-metrics", "bifrost-accounting-bundle", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "swarm-online-runbook", "service-policy-directory")
$isCompactReadOnlyMode = $compactReadOnlyModes -contains $Mode
$shouldReadLocalVerse = $Mode -ne "smoke" -and -not $isCompactReadOnlyMode
if ($shouldReadLocalVerse -and $Mode -ne "status" -and $Mode -ne "mvp") {
@ -968,6 +976,30 @@ if ($Mode -eq "bifrost-metrics") {
-StderrPath (Join-Path $artifactRoot "bifrost-metrics.stderr.log")
}
if ($Mode -eq "repo-swarm-mvp-gate") {
$resultPath = Join-Path $artifactRoot "repo-swarm-mvp-gate.stdout.json"
$gateArgs = @(
"--root", $Root,
"--smoke-root", (Join-Path $Root ".epiphany-smoke")
)
if ($RepoSwarmMvpFreshRepoSummaryPath -ne "") {
$gateArgs += @("--fresh-repo-summary", $RepoSwarmMvpFreshRepoSummaryPath)
}
if ($RepoSwarmMvpReadinessSummaryPath -ne "") {
$gateArgs += @("--readiness-summary", $RepoSwarmMvpReadinessSummaryPath)
}
if ($RepoSwarmMvpBifrostAccountingSummaryPath -ne "") {
$gateArgs += @("--bifrost-accounting-summary", $RepoSwarmMvpBifrostAccountingSummaryPath)
}
Invoke-Checked `
-Label "verify repo swarm MVP gate proof" `
-FilePath $repoSwarmMvpGateExe `
-Arguments $gateArgs `
-WorkingDirectory $Root `
-StdoutPath $resultPath `
-StderrPath (Join-Path $artifactRoot "repo-swarm-mvp-gate.stderr.log")
}
if ($Mode -eq "bifrost-accounting-bundle") {
$resultPath = Join-Path $artifactRoot "bifrost-accounting-bundle.stdout.json"
$bundleArgs = @(
@ -2584,6 +2616,12 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) {
$creditReadback = ($result.creditReadbackReceiptIds -join ",")
}
Write-Host "Bifrost metrics: status=$($result.status), item=$($result.item), receipt=$($result.receiptId), artifactAcceptance=$($result.artifactAcceptanceReceiptId), modelSpend=$modelSpend, reviewLoad=$reviewLoad, creditReadback=$creditReadback, privateStateExposed=$($result.privateStateExposed)"
} elseif ($Mode -eq "repo-swarm-mvp-gate") {
$remaining = "none"
if ($null -ne $result.knownRemainingAuthorityGates -and $result.knownRemainingAuthorityGates.Count -gt 0) {
$remaining = ($result.knownRemainingAuthorityGates -join "; ")
}
Write-Host "Repo swarm MVP gate: status=$($result.status), demoReady=$($result.demoReady), mvpReady=$($result.mvpReady), green=$($result.greenGateCount), warnings=$($result.warningGateCount), blockers=$($result.blockerGateCount), remaining='$remaining', privateStateExposed=$($result.privateStateExposed), smokeDir=$($result.smokeDir)"
} 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") {