diff --git a/epiphany-core/src/bin/epiphany-repo-close-mind-adoption-guard-smoke.rs b/epiphany-core/src/bin/epiphany-repo-close-mind-adoption-guard-smoke.rs new file mode 100644 index 00000000..d75ac987 --- /dev/null +++ b/epiphany-core/src/bin/epiphany-repo-close-mind-adoption-guard-smoke.rs @@ -0,0 +1,489 @@ +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-close-mind-adoption-guard-{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 Close Mind Adoption Guard Smoke\n\nThis repository proves Soul refuses closure when the Mind adoption proof is tampered.\n", + ) + .with_context(|| format!("failed to seed {}", repo.join("README.md").display()))?; + git(["add", "README.md"], &repo)?; + git( + [ + "commit", + "-m", + "Seed repo close mind adoption guard smoke body", + ], + &repo, + )?; + git( + ["switch", "-c", "epiphany/repo-close-mind-adoption-guard"], + &repo, + )?; + + let item = "repo-close-mind-adoption-guard"; + let target_path = "notes/epiphany-work/repo-close-mind-adoption-guard.md"; + 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-close-mind-adoption-guard-smoke", + "--topic", + "repo-close-mind-adoption-guard", + ], + &root, + )?; + cargo_json( + &manifest, + "epiphany-swarm", + &[ + "online", + "--workspace", + path_str(&repo)?, + "--epiphany-root", + path_str(&root)?, + "--runtime-id", + "repo-close-mind-adoption-guard-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 Soul to reject counterfeit Mind adoption proof before closure.", + "--candidate-action-ref", + "candidate-action://repo-close-mind-adoption-guard/tampered-adoption", + "--public-discussion-ref", + "epiphany-global/persona-collaboration/repo-close-mind-adoption-guard", + ], + &root, + )?; + let plan = cargo_json( + &manifest, + "epiphany-work", + &[ + "derive-plan", + "--workspace", + path_str(&repo)?, + "--item", + item, + "--action-family", + "planning-note", + "--model-ref", + "repo-close-mind-adoption-guard-smoke-imagination-v1", + "--model-authored", + ], + &root, + )?; + let run = cargo_json( + &manifest, + "epiphany-work", + &[ + "run", + "--workspace", + path_str(&repo)?, + "--epiphany-root", + path_str(&root)?, + "--item", + item, + "--path", + target_path, + ], + &root, + )?; + let plan_path = value_at_path(&plan, &["receiptPath"]) + .and_then(Value::as_str) + .ok_or_else(|| anyhow!("plan output had no receiptPath"))?; + let run_path = value_at_path(&run, &["receiptPath"]) + .and_then(Value::as_str) + .ok_or_else(|| anyhow!("run output had no receiptPath"))?; + let adopt = cargo_json( + &manifest, + "epiphany-work", + &[ + "adopt", + "--workspace", + path_str(&repo)?, + "--epiphany-root", + path_str(&root)?, + "--item", + item, + "--run-receipt", + run_path, + "--from-plan", + plan_path, + ], + &root, + )?; + let adopt_path = value_at_path(&adopt, &["receiptPath"]) + .and_then(Value::as_str) + .ok_or_else(|| anyhow!("adopt output had no receiptPath"))?; + let execute = cargo_json( + &manifest, + "epiphany-work", + &[ + "execute", + "--workspace", + path_str(&repo)?, + "--epiphany-root", + path_str(&root)?, + "--item", + item, + "--adopt-receipt", + adopt_path, + "--from-plan", + plan_path, + ], + &root, + )?; + let execute_path = value_at_path(&execute, &["receiptPath"]) + .and_then(Value::as_str) + .ok_or_else(|| anyhow!("execute output had no receiptPath"))?; + + let mut tampered_adopt = read_json(Path::new(adopt_path))?; + tampered_adopt["mindAdoptionDecision"]["status"] = json!("tampered-after-adoption"); + tampered_adopt["mindAdoptionDecision"]["interpretation"]["classification"]["actionItemAccepted"] = + json!(false); + let tampered_adopt_path = smoke_dir.join("tampered-adopt.json"); + write_json(&tampered_adopt_path, &tampered_adopt)?; + + let mut tampered_execute = read_json(Path::new(execute_path))?; + tampered_execute["adoptReceiptPath"] = json!(path_str(&tampered_adopt_path)?); + let tampered_execute_path = smoke_dir.join("tampered-execute.json"); + write_json(&tampered_execute_path, &tampered_execute)?; + + let tampered_close = cargo_json( + &manifest, + "epiphany-work", + &[ + "close", + "--workspace", + path_str(&repo)?, + "--item", + item, + "--execute-receipt", + path_str(&tampered_execute_path)?, + "--verification-command", + "git status --short", + ], + &root, + )?; + require_eq(&tampered_close, &["status"], "verification-failed")?; + require_eq(&tampered_close, &["soul", "verdict"], "failed")?; + require_eq( + &tampered_close, + &["closureReview", "mindAdoptionReview", "status"], + "failed", + )?; + require_bool( + &tampered_close, + &["closureReview", "sourceGrounding", "mindAdoptionPassed"], + false, + )?; + require_bool( + &tampered_close, + &["closureReview", "mindAdoptionReview", "privateStateExposed"], + false, + )?; + require_assertion( + &tampered_close, + &["closureReview", "mindAdoptionReview", "assertions"], + "decision-status-adopted", + false, + )?; + require_assertion( + &tampered_close, + &["closureReview", "mindAdoptionReview", "assertions"], + "action-item-accepted", + false, + )?; + + let close = cargo_json( + &manifest, + "epiphany-work", + &[ + "close", + "--workspace", + path_str(&repo)?, + "--item", + item, + "--execute-receipt", + execute_path, + "--verification-command", + "git status --short", + ], + &root, + )?; + require_eq(&close, &["status"], "closed")?; + require_eq(&close, &["soul", "verdict"], "passed")?; + require_eq( + &close, + &["closureReview", "mindAdoptionReview", "status"], + "passed", + )?; + require_bool( + &close, + &["closureReview", "sourceGrounding", "mindAdoptionPassed"], + true, + )?; + require_bool(&close, &["privateStateExposed"], false)?; + + let summary = json!({ + "schemaVersion": "epiphany.repo_close_mind_adoption_guard_smoke.v0", + "status": "ok", + "smokeDir": smoke_dir, + "repo": repo, + "branch": git_output(["branch", "--show-current"], &repo)?, + "item": item, + "targetPath": target_path, + "tamperedCloseStatus": tampered_close["status"], + "tamperedSoulVerdict": tampered_close["soul"]["verdict"], + "tamperedMindAdoptionReviewStatus": tampered_close["closureReview"]["mindAdoptionReview"]["status"], + "closeStatus": close["status"], + "soulVerdict": close["soul"]["verdict"], + "mindAdoptionReviewStatus": close["closureReview"]["mindAdoptionReview"]["status"], + "publicationAuthorized": false, + "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() { + return 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) + )); + } + Ok(String::from_utf8_lossy(&output.stdout).trim().to_string()) +} + +fn read_json(path: &Path) -> Result { + let raw = + fs::read_to_string(path).with_context(|| format!("failed to read {}", path.display()))?; + serde_json::from_str(&raw).with_context(|| format!("failed to decode {}", 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 = value_at_path(value, path) + .and_then(Value::as_str) + .ok_or_else(|| anyhow!("missing string at {}", path.join(".")))?; + if actual == expected { + Ok(()) + } else { + Err(anyhow!( + "expected {} to be {:?}, got {:?}", + path.join("."), + expected, + actual + )) + } +} + +fn require_bool(value: &Value, path: &[&str], expected: bool) -> Result<()> { + let actual = value_at_path(value, path) + .and_then(Value::as_bool) + .ok_or_else(|| anyhow!("missing bool at {}", path.join(".")))?; + if actual == expected { + Ok(()) + } else { + Err(anyhow!( + "expected {} to be {}, got {}", + path.join("."), + expected, + actual + )) + } +} + +fn require_assertion( + value: &Value, + assertions_path: &[&str], + assertion_id: &str, + expected: bool, +) -> Result<()> { + let assertions = value_at_path(value, assertions_path) + .and_then(Value::as_array) + .ok_or_else(|| anyhow!("missing assertions at {}", assertions_path.join(".")))?; + let assertion = assertions + .iter() + .find(|entry| entry.get("assertionId").and_then(Value::as_str) == Some(assertion_id)) + .ok_or_else(|| anyhow!("missing assertion {assertion_id}"))?; + require_bool(assertion, &["passed"], expected) +} + +fn value_at_path<'a>(value: &'a Value, path: &[&str]) -> Option<&'a Value> { + let mut cursor = value; + for segment in path { + cursor = cursor.get(*segment)?; + } + Some(cursor) +} + +fn take_path(args: &mut std::iter::Peekable, name: &str) -> Result +where + I: Iterator, +{ + args.next() + .map(PathBuf::from) + .ok_or_else(|| anyhow!("missing value for {name}")) +} + +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-work.rs b/epiphany-core/src/bin/epiphany-work.rs index c20756e1..0e0d6c05 100644 --- a/epiphany-core/src/bin/epiphany-work.rs +++ b/epiphany-core/src/bin/epiphany-work.rs @@ -7383,6 +7383,187 @@ fn push_assertion(assertions: &mut Vec, id: &str, passed: bool, summary: })); } +fn closure_mind_adoption_review(execute_receipt: &Value) -> Result<(Value, bool)> { + let Some(adopt_receipt_path) = path_from_json(execute_receipt, &["adoptReceiptPath"]) else { + return Ok(( + json!({ + "schemaVersion": "epiphany.repo_work_mind_adoption_closure_review.v0", + "status": "failed", + "reason": "execute receipt has no adoptReceiptPath", + "assertions": [] + }), + false, + )); + }; + let adopt_receipt = read_json_if_exists(&adopt_receipt_path)?.unwrap_or(Value::Null); + if adopt_receipt.is_null() { + return Ok(( + json!({ + "schemaVersion": "epiphany.repo_work_mind_adoption_closure_review.v0", + "status": "failed", + "reason": "adopt receipt path is missing", + "adoptReceiptPath": adopt_receipt_path, + "assertions": [] + }), + false, + )); + } + let Some(mind_decision) = adopt_receipt.get("mindAdoptionDecision") else { + return Ok(( + json!({ + "schemaVersion": "epiphany.repo_work_mind_adoption_closure_review.v0", + "status": "failed", + "reason": "adopt receipt has no mindAdoptionDecision", + "adoptReceiptPath": adopt_receipt_path, + "assertions": [] + }), + false, + )); + }; + let plan_derived = execute_receipt.get("planReceiptPath").is_some(); + let mut assertions = Vec::new(); + push_assertion( + &mut assertions, + "decision-schema", + string_from_json(mind_decision, &["schemaVersion"]).as_deref() + == Some("epiphany.repo_work_mind_adoption_decision.v0"), + "Mind adoption decision carries the expected schema.".to_string(), + ); + push_assertion( + &mut assertions, + "decision-status-adopted", + string_from_json(mind_decision, &["status"]).as_deref() + == Some("adopted-for-branch-local-hands"), + "Mind adoption decision accepted branch-local Hands authority.".to_string(), + ); + push_assertion( + &mut assertions, + "decision-owner-mind", + string_from_json(mind_decision, &["owner"]).as_deref() == Some("Mind"), + "Mind is the recorded adoption decision owner.".to_string(), + ); + push_assertion( + &mut assertions, + "decision-interpreter-mind", + string_from_json(mind_decision, &["interpreter"]).as_deref() == Some("Mind"), + "Mind is the recorded adoption interpreter.".to_string(), + ); + push_assertion( + &mut assertions, + "action-item-accepted", + bool_from_json( + mind_decision, + &["interpretation", "classification", "actionItemAccepted"], + ) == Some(true), + "Mind classified the plan cargo as an accepted action item.".to_string(), + ); + push_assertion( + &mut assertions, + "safe-family-recognized", + bool_from_json( + mind_decision, + &["interpretation", "classification", "safeFamilyRecognized"], + ) == Some(true) + && bool_from_json(mind_decision, &["gates", "safeFamilyRequired"]) == Some(true), + "Mind recognized the safe family and recorded the safe-family gate.".to_string(), + ); + push_assertion( + &mut assertions, + "requested-paths-match-plan", + !plan_derived + || (bool_from_json( + mind_decision, + &[ + "interpretation", + "classification", + "requestedPathsMatchPlan", + ], + ) == Some(true) + && bool_from_json(mind_decision, &["gates", "branchLocalOnly"]) == Some(true)), + "Mind confirmed requested paths match the plan before branch-local Hands authority." + .to_string(), + ); + push_assertion( + &mut assertions, + "private-state-sealed", + bool_from_json(mind_decision, &["privateStateExposed"]) == Some(false), + "Mind adoption decision preserves the private-state seal.".to_string(), + ); + + let mind_decision_path = path_from_json(mind_decision, &["receiptPath"]); + let standalone_review = if let Some(path) = mind_decision_path.as_ref() { + match read_json_if_exists(path)? { + Some(standalone) => { + let matching_decision_id = string_from_json(&standalone, &["decisionId"]) + == string_from_json(mind_decision, &["decisionId"]); + let matching_status = string_from_json(&standalone, &["status"]) + == string_from_json(mind_decision, &["status"]); + let matching_schema = string_from_json(&standalone, &["schemaVersion"]) + == string_from_json(mind_decision, &["schemaVersion"]); + let matching_private_seal = bool_from_json(&standalone, &["privateStateExposed"]) + == bool_from_json(mind_decision, &["privateStateExposed"]); + push_assertion( + &mut assertions, + "standalone-decision-matches-snapshot", + matching_decision_id + && matching_status + && matching_schema + && matching_private_seal, + "Standalone Mind decision matches the adopt receipt snapshot.".to_string(), + ); + json!({ + "status": "present", + "receiptPath": path, + "decisionIdMatched": matching_decision_id, + "statusMatched": matching_status, + "schemaMatched": matching_schema, + "privateStateSealMatched": matching_private_seal + }) + } + None => { + push_assertion( + &mut assertions, + "standalone-decision-present", + false, + "Standalone Mind decision path exists in snapshot but the file is missing." + .to_string(), + ); + json!({ + "status": "missing", + "receiptPath": path + }) + } + } + } else { + push_assertion( + &mut assertions, + "standalone-decision-path-present", + false, + "Adopt receipt snapshot names the standalone Mind decision receipt path.".to_string(), + ); + json!({ + "status": "missing-path" + }) + }; + + let passed = assertions + .iter() + .all(|assertion| assertion.get("passed").and_then(Value::as_bool) == Some(true)); + Ok(( + json!({ + "schemaVersion": "epiphany.repo_work_mind_adoption_closure_review.v0", + "status": if passed { "passed" } else { "failed" }, + "adoptReceiptPath": adopt_receipt_path, + "mindDecisionPath": mind_decision_path, + "planDerived": plan_derived, + "assertions": assertions, + "standaloneDecisionReview": standalone_review, + "privateStateExposed": false + }), + passed, + )) +} + fn closure_model_review( model_authored: bool, model_ref: Option<&str>, @@ -8520,6 +8701,8 @@ fn run_close(args: CloseArgs) -> Result { let commit_stat = git_output(&workspace, &["show", "--stat", "--oneline", &commit_sha])?; let (family_assertions, family_assertions_passed) = closure_family_assertions(&workspace, &commit_sha, &execute_receipt, &item)?; + let (mind_adoption_review, mind_adoption_passed) = + closure_mind_adoption_review(&execute_receipt)?; let closure_model_authored = args.model_authored || args.closure_model_ref.is_some(); let (model_closure_review, model_closure_passed) = closure_model_review( closure_model_authored, @@ -8559,9 +8742,11 @@ fn run_close(args: CloseArgs) -> Result { "pathScopeMatched": path_scope_matched, "commitStat": compact_multiline(&commit_stat), "commitReceiptMatchedExecuteReceipt": true, + "mindAdoptionPassed": mind_adoption_passed, "familyAssertionsPassed": family_assertions_passed, "modelClosurePassed": model_closure_passed }, + "mindAdoptionReview": mind_adoption_review, "familyAssertions": family_assertions, "modelingReview": { "modelAuthored": closure_model_authored, @@ -8580,11 +8765,12 @@ fn run_close(args: CloseArgs) -> Result { "privateStateExposed": false }, "privateStateExposed": false, - "nextSafeMove": "Soul may pass closure only when verification succeeds, actual git changed paths match the Hands-declared path scope, safe-family assertions pass for known Imagination families, and any supplied or required model-authored closure verdict passes." + "nextSafeMove": "Soul may pass closure only when verification succeeds, actual git changed paths match the Hands-declared path scope, the accepted Mind adoption proof is present, safe-family assertions pass for known Imagination families, and any supplied or required model-authored closure verdict passes." }); write_json(&closure_review_path, &closure_review)?; let verification_passed = verification.status.success() && path_scope_matched + && mind_adoption_passed && family_assertions_passed && model_closure_passed; let soul_verdict_id = format!("repo-work-close-{item_slug}-soul-verdict"); @@ -8595,6 +8781,10 @@ fn run_close(args: CloseArgs) -> Result { format!( "Soul verification failed for branch-local commit {commit_sha}: actual changed paths did not match declared Hands path scope." ) + } else if !mind_adoption_passed { + format!( + "Soul verification failed for branch-local commit {commit_sha}: Mind adoption proof did not pass." + ) } else if !family_assertions_passed { format!( "Soul verification failed for branch-local commit {commit_sha}: safe-family assertions did not pass." @@ -8635,6 +8825,11 @@ fn run_close(args: CloseArgs) -> Result { "Closure refused because actual git changed paths differ from Hands-declared scope." .to_string(), ] + } else if !mind_adoption_passed { + vec![ + "Closure refused because the Mind adoption decision was missing, tampered, or non-affirmative." + .to_string(), + ] } else if !family_assertions_passed { vec![ "Closure refused because the committed content did not satisfy known safe-family assertions." @@ -11375,6 +11570,14 @@ fn string_from_json(value: &Value, path: &[&str]) -> Option { cursor.as_str().map(ToString::to_string) } +fn bool_from_json(value: &Value, path: &[&str]) -> Option { + let mut cursor = value; + for segment in path { + cursor = cursor.get(*segment)?; + } + cursor.as_bool() +} + fn string_array_from_json(value: &Value, path: &[&str]) -> Vec { let mut cursor = value; for segment in path { diff --git a/notes/epiphany-repo-swarm-mvp-contract.md b/notes/epiphany-repo-swarm-mvp-contract.md index 6e3084af..67441538 100644 --- a/notes/epiphany-repo-swarm-mvp-contract.md +++ b/notes/epiphany-repo-swarm-mvp-contract.md @@ -1063,11 +1063,14 @@ sealed under `.epiphany/work/`. Closure also writes a structured command/exit code, declared Hands paths, actual git commit paths, commit stat, optional model-review provenance from `--closure-model-ref` / `--model-authored`, optional hard model closure verdicts from `--closure-model-verdict`, safe-family -assertions for known Imagination families, and authority seals. Soul passes only +assertions for known Imagination families, the cited +`epiphany.repo_work_mind_adoption_decision.v0` snapshot plus standalone receipt +match, and authority seals. Soul passes only when the verification command succeeds, actual git changed paths match the -Hands-declared path scope, the committed target content satisfies the -deterministic safe-family assertions when the plan family is known, and any -supplied or required model-authored closure verdict passes. +Hands-declared path scope, the accepted Mind adoption proof is present and +affirmative, the committed target content satisfies the deterministic +safe-family assertions when the plan family is known, and any supplied or +required model-authored closure verdict passes. `--require-closure-model-verdict` turns missing model verdicts into a closure refusal; without that flag, older provenance-only model refs remain compatibility evidence instead of a hard gate. Soul @@ -1133,6 +1136,17 @@ one with `--closure-model-verdict needs-work`. The pass item returned `familyAssertions.status=passed` and `pathScopeMatched=true`; private state remained sealed. +A Mind-adoption closure guard smoke proved Soul now verifies that the Hands +commit being closed still descends from an accepted Mind adoption decision: +`.epiphany-smoke\repo-close-mind-adoption-guard-20260620-201153` ran a +disposable repo through plan -> run -> adopt -> execute, then pointed a copied +execute receipt at a counterfeit adopt receipt whose embedded +`mindAdoptionDecision.status` and `actionItemAccepted` were tampered. The +tampered close returned `verification-failed`, Soul `failed`, +`mindAdoptionReview.status=failed`, and `mindAdoptionPassed=false`; the original +execute/adopt chain then closed with Soul `passed`, +`mindAdoptionReview.status=passed`, and `privateStateExposed=false`. + `epiphany-work overview` is the first compact repo work sight/proof surface: ```powershell @@ -1481,7 +1495,7 @@ temptation wearing clean robes. | Imagination planning | `derive-plan` now writes a typed `epiphany.repo_work_imagination_action_items_receipt.v0` before the executable plan receipt. The action-item receipt can carry model provenance, allowed safe family, requested paths, verification asks, stop conditions, escalation reasons, planning facets (assumptions, constraints, non-goals, open questions, decision points, and evidence needs), and private-state seals; command text remains deterministic safe-family lowering for `append-worklog`, `planning-note`, `checklist-note`, `section-note` / `repo.markdown_managed_section`, `repo-status-section` / `repo.status_section`, `task-card` / `repo.task_card`, `repo-manifest` / `repo.body_manifest`, `repo-tool-capabilities` / `repo.tool_capabilities`, `repo-tool-request` / `repo.tool_request`, `repo-eve-surface` / `repo.eve_surface`, `repo-collaboration-policy` / `repo.collaboration_policy`, `repo-collaboration-topic` / `repo.collaboration_topic`, `repo-consensus-brief` / `repo.consensus_brief`, `repo-objective-draft` / `repo.objective_draft`, `repo-adoption-request` / `repo.adoption_request`, `repo-scheduling-request` / `repo.scheduling_request`, `repo-work-order` / `repo.work_order`, `repo-verification-request` / `repo.verification_request`, `repo-publication-request` / `repo.publication_request`, `repo-sync-request` / `repo.sync_request`, `repo-maintainer-review-request` / `repo.maintainer_review_request`, `repo-pr-request` / `repo.pr_request`, `repo-credit-request` / `repo.credit_request`, `repo-artifact-acceptance-request` / `repo.artifact_acceptance_request`, `repo-metrics-request` / `repo.metrics_request`, `repo-doctrine-update-request` / `repo.doctrine_update_request`, `repo-secret-policy-request` / `repo.secret_policy_request`, and `repo-deployment-request` / `repo.deployment_request`. `adopt` now writes `epiphany.repo_work_mind_adoption_decision.v0` before the main adoption receipt cites the decision and grants branch-local Hands authority. `plan` remains manual quarantine scaffolding. | Deepen further interpreter behavior and useful repo-owned configuration/action classes without turning model text into arbitrary shell authority. | | Self scheduling | `tick` and `serve` prove one-step branch-local advancement, brake refusal, active-turn refusal, cooldown, and stale-turn recovery; `tick` now routes executed branch-local work through the existing Soul/Modeling/Mind `close` gate; `queue-run` selects tick-actionable rows from the typed repo-work queue and delegates to `tick`; `epiphany-swarm run` is the bounded operator mouth over that queue/tick physiology; `repo-work-service-plan` and `repo-work-service-runbook` write Idunn lifecycle receipts/artifacts for the same queue-run command without launching it. | Keep any future queue-run service launch/install behind Idunn and explicit operator authority. | | Branch-local Hands work | `adopt` and `execute` create approved Hands gates, run planned commands, stage declared paths, commit on `epiphany/*`, and write receipts. | Keep mutation branch-contained and receipt-backed; broaden only through typed plan families, not ad hoc shell freedom. | -| Soul/Modeling/Mind closure | `close` verifies the Hands commit, writes `epiphany.repo_work_closure_review.v0`, refuses path-scope mismatches, and writes Soul, Modeling, and Mind receipts. | Deepen model-authored closure review beyond the first structured closure-review packet while preserving deterministic local closure for simple mechanical work. | +| Soul/Modeling/Mind closure | `close` verifies the Hands commit, writes `epiphany.repo_work_closure_review.v0`, refuses path-scope mismatches, refuses missing/tampered/non-affirmative Mind adoption proof, runs known safe-family content assertions, optionally gates on model-authored closure verdicts, and writes Soul, Modeling, and Mind receipts. | Keep extending closure toward source-grounded semantic review and durable map admission, while preserving deterministic local closure for simple mechanical work. | | Repo work sight | `overview` emits compact proof rows and mirrors typed `epiphany.cultmesh.repo_work_overview.v0` event documents plus a latest key; Gjallar enumerates the history as queue rows and non-mutating action rows; Persona's Eve surface and Eve connection readbacks expose peer-readable gate/blocker/next-action rows; `queue-run` consumes the same queue for branch-local scheduler pulses. | Deepen the Persona-to-plan loop without moving action authority out of Hands/Self/Bifrost. | | Publication | `publish` routes Bifrost/GitHub receipts from closure or explicit Soul/Mind refs. | Keep publication Bifrost-owned; do not let scheduler publish. | | Upstream main sync | `sync` proves the published commit is contained by upstream main after explicit merge/sync authority. | Treat upstream-main sync as a required final proof for published work. | @@ -1936,11 +1950,13 @@ Required organs before MVP: model-review provenance when supplied, refuses actual-vs-declared path-scope mismatch before Soul passes, runs committed-content assertions for known safe families, refuses assertion failures even when the path scope matches, can - require a model-authored closure verdict before Soul passes, and exposes the - closure-review artifact through overview/export proof rows. The verdict packet + require a model-authored closure verdict before Soul passes, and now verifies + the accepted Mind adoption proof by checking the embedded decision snapshot + plus standalone decision receipt before closure passes. The verdict packet records reviewed inputs, finding text, enforced/skipped gate state, and - private-state seals; focused smoke proves a model `needs-work` verdict blocks - closure even when path scope and safe-family assertions pass. + private-state seals; focused smokes prove a model `needs-work` verdict blocks + closure even when path scope and safe-family assertions pass, and a tampered + Mind adoption decision blocks closure before publication gates can proceed. - Repo work projection/run surface: local `epiphany-work overview` proof bundles, typed `epiphany.cultmesh.repo_work_overview.v0` event history plus latest-key projection, and Gjallar multi-item `repo-work-overview` action/readback rows @@ -1978,10 +1994,11 @@ Required organs before MVP: redacted proof row through `gamecult.bifrost.public_proof_publication_receipt.v0` with public Verse target, public room, ledger, review, credit, proof ref, and SHA-256 readback. - Remaining work is richer closure depth, not basic safe-family planning cargo, - local public-proof export, local CultMesh readback, Bifrost/GitHub/sync row - visibility, public-proof publication closure, or the standard wrapper mouth - for that closure. + Remaining work is deeper semantic review and durable repo-map admission, not + basic safe-family planning cargo, local public-proof export, local CultMesh + readback, Bifrost/GitHub/sync row visibility, public-proof publication + closure, Mind-adoption closure proof, or the standard wrapper mouth for those + closures. Scheduler authority is intentionally narrow. It may advance `accept -> plan -> run -> adopt -> execute` only when each upstream receipt diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 0ed6a13b..58d99bbc 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -105,6 +105,7 @@ remembers doctrine; the branch remembers the blade. - `notes/epiphany-swarm-readiness-plan.md` is the current live-fire direction gate. The local runner proves startup/status/coordinator wiring; it does not authorize unattended swarm operation. Carry VoidBot's lessons forward: one CTB-style initiative scheduler, typed pause/brake, active-turn freeze, cooldown after completion, stale active-turn recovery receipts, parent-side speech eligibility, memory lifecycle phases, and typed operation proposals instead of prompt-owned governance. `epiphany-verse-query swarm-brake --brake-status engaged|released` can now write the local Verse brake document, and `tools/epiphany_local_run.ps1` refuses live `plan`/`run`/`mvp` modes when that brake is engaged while keeping `status` readable. `epiphany-mvp-coordinator` also checks `--local-verse-store` before app-server startup, and `epiphany-heartbeat-store` guards tick/pump/heat/queue-mention/routine when passed `--local-verse-store`. Daemon tool invocation, daemon lifecycle poke, and `epiphany-daemon-supervisor` restart/tick/serve/service-plan/service-launch/service-runbook/windows-service-install/windows-service-status/windows-service-reconcile/windows-service-execution-readiness/start/stop attempts now fail closed under a matching engaged brake; supervisor restart now has durable per-daemon policy with cooldown/backoff, explicit scheduled tick pulses, latest scheduler receipts, typed service lifecycle plan/launch/runbook/install/status/reconcile/readiness/start/stop receipts, and local operator wrapper modes that write runbook/install/status/reconcile/readiness/control-plan/execution artifacts plus operator run receipts. The installed-service read path, read-only service-policy reconciliation path, execution-readiness path, non-mutating start/stop control-plan path, and non-elevated execution refusal path have been proved against real Windows `EventLog` service-manager state or safe missing-service targets through local Verse receipts, including explicit wrapper install/start/stop execution modes. The next cut is actual elevated install/start/stop execution proof under operator authority. - `notes/epiphany-repo-swarm-mvp-contract.md` is the repo-swarm MVP authority map and migration plan. It states the live seventeen-front-door chain from `epiphany-repo init` through `epiphany-swarm run`, `epiphany-work persona-intake`, `derive-plan`, `close`, `overview`, `export-proof`, `tick`, `queue-run`, `publish`, and `sync`, documents the operator-safe proof receipts already proved with `privateStateExposed=false`, and names the remaining MVP organs as deeper interpreter/adoption semantics, more useful repo-owned configuration/action families, and Idunn-owned queue-run service lifecycle under explicit operator authority. Autonomous branch-local work inside the owned repo Body is in scope and desired; Bifrost gates publication/merge/escalation, Idunn owns daemon lifecycle, and `epiphany-work tick` may only advance one safe receipt-backed branch-local step per pulse before stopping at publication gates. `epiphany-work derive-plan` now consumes accepted Persona/Bifrost pressure, writes typed Imagination action-item receipts, then lowers allowlisted safe families into Imagination/Self action plans: `append-worklog` appends to `EPIPHANY_WORKLOG.md`, `planning-note` creates a contained markdown note under `notes/epiphany-work/.md`, `checklist-note` creates a contained checklist, `section-note` / `repo.markdown_managed_section` creates or replaces one marker-bounded markdown section, `repo-status-section` / `repo.status_section` updates a marker-bounded operator-safe status section in `README.md` by default, and `task-card` / `repo.task_card` writes a structured TOML task card under `notes/epiphany-work/-task-card.toml`; the receipts carry `operatorAuthoredShellDetails=false`, authority seals, and no private-state exposure. Disposable smokes proved append-worklog, planning-note, checklist-note, section-note, task-card, and repo-status-section routes through branch-local Hands commits; `.epiphany-smoke\repo-status-section-20260620-140245` reached close with `repo.status_section`, `modelAuthored=true`, a committed `README.md` status section bounded by Epiphany status markers, Soul `passed`, `pathScopeMatched=true`, and `privateStateExposed=false`. Native repeatable smoke `epiphany-repo-swarm-mvp-smoke` now proves a fresh repo from disposable origin through init, online, Persona intake, model-authored repo-status plan, overview queue projection, `epiphany-swarm run`, Soul close, Bifrost publication receipts, disposable maintainer merge to `origin/main`, upstream-main sync, overview, and public-proof export; `.epiphany-smoke\fresh-repo-mvp-20260620-133452` reported branch `epiphany/fresh-repo-smoke/mvp-proof`, Hands commit `76f8d5ebb023951a513864bdf8555a524d89c5dc`, Soul `passed`, `familyAssertions.status=passed`, `publishStatus=publication-receipts-recorded`, `syncStatus=upstream-main-synced`, `upstreamMainSynced=true`, `publicProofStatus=public-proof-exported`, and `privateStateExposed=false`. `epiphany-work overview` now reads the repo work receipt chain and writes an Eyes/Gjallar-owned sight/proof bundle with current gate, blocker, next safe action, branch, changed paths, commit SHA, Soul verdict, compact rows, and private-state seal; it also mirrors a typed `epiphany.cultmesh.repo_work_overview.v0` document into the repo-local Verse when a local Verse store is known. `epiphany-work export-proof` mirrors redacted public proofs into local Verse, and `epiphany-verse-query bifrost-public-proof` plus wrapper `tools/epiphany_local_run.ps1 -Mode bifrost-public-proof` now publish an existing redacted proof row as `gamecult.bifrost.public_proof_publication_receipt.v0` with public Verse target, public room, ledger, review, credit, proof ref/SHA, and `privateStateExposed=false`; smoke `.epiphany-smoke\checklist-note-20260620-031347` plus wrapper artifact `local-20260620-132418-144-62ba9369` proved latest `bifrost-public-proof-publication-wrapper-checklist` in `bifrost-ledger` and `receipt-directory`. The tick pulse reads the repo-local CultMesh swarm brake and writes `refused-by-swarm-brake` without creating run/adopt/execute receipts when the brake is engaged. It also writes active-turn and last-completed scheduler receipts, refuses live duplicate pulses as `refused-active-turn`, refuses explicit completion-anchored cooldown as `refused-by-cooldown`, clears stale active markers after `--active-timeout-seconds`, and records `physiology.recoveredActiveTurn.recovered=true` when recovery proceeds. `epiphany-work queue-run` reads the repo-local typed overview queue, selects tick-actionable rows for the current repo Body through `awaiting-closure`, delegates to `tick`, refreshes overview after real advancement, and is wrapped by `tools/epiphany_local_run.ps1 -Mode repo-work-queue-run`; `epiphany-swarm run` is the bounded operator mouth over that same queue/tick artery. `epiphany-work serve` wraps the item-scoped tick artery in Self-owned cadence: bounded `--max-iterations` proof mode writes `work-scheduler-serve-.json`, unbounded service mode relies on per-pulse tick receipts, and unbounded zero-second polling is refused. `epiphany-work close` consumes branch-local execute receipts, verifies the Hands commit, writes `epiphany.repo_work_closure_review.v0` with verification command/exit code, declared-vs-actual git changed paths, commit stat, optional model-review provenance, optional/required model-authored closure verdicts, committed-content assertions for known safe families, and authority seals; Soul refuses path-scope mismatches, safe-family assertion failures, and supplied or required model verdicts that do not pass before Modeling/Mind closure, even when the changed path list and family assertions match. Focused smoke `.epiphany-smoke\closure-model-gate-20260620-135103` proved a passing required model verdict closes and a `needs-work` model verdict blocks closure with `familyAssertions.status=passed`, `pathScopeMatched=true`, and `privateStateExposed=false`. The close receipt still grants no publication, merge, service lifecycle, cross-repo mutation, or private-state exposure; tick now calls deterministic close after execution unless a caller explicitly supplies the model verdict gate. `epiphany-work publish --closure-receipt` can consume the closure's Soul/Mind ids, while tick no-ops once closure exists before Bifrost publication authority. - 2026-06-20: The same repo-swarm note now carries the explicit migration thesis, MVP status board, Epiphany Online cut order, authority matrix, local CultMesh tool availability doctrine, and upstream-main sync doctrine. `tools/epiphany_local_run.ps1 -Mode repo-work-service-plan` and `-Mode repo-work-service-runbook` now write Idunn-owned non-mutating lifecycle receipts/artifacts for the real `epiphany-work queue-run` command; proofs `local-20260620-021415-094-58439baf` and `local-20260620-021415-147-067c36b0` planned/wrote the queue-run command vector with `privateStateExposed=false` and no service launch/install. Use that note when answering "are we headed toward a functional swarm?" The answer is yes, and the remaining cuts must preserve typed organ ownership: deeper model-authored closure review, further non-planning action classes, and Idunn-owned queue-run service lifecycle under explicit operator authority. Persona is the mouth, Imagination plans, Self schedules, Hands acts, Soul verifies, Modeling maps, Mind admits, Gjallar sees, Odin discovers, Idunn keeps daemon physiology alive, Bifrost publishes and credits, and Eve/CultUI renders without becoming truth. +- 2026-06-20: Soul closure now proves the accepted Mind adoption decision before a branch-local Hands commit can close. `epiphany-work close` embeds `epiphany.repo_work_mind_adoption_closure_review.v0`, checks the adopt receipt's embedded `epiphany.repo_work_mind_adoption_decision.v0` snapshot plus standalone decision receipt, and refuses missing/tampered/non-affirmative Mind adoption even when verification, path scope, and safe-family content assertions pass. Proof `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-201153` forged a tampered adopt receipt and got `verification-failed` / Soul `failed` / `mindAdoptionReview.status=failed`, then closed the original chain with Soul `passed`, `mindAdoptionReview.status=passed`, and `privateStateExposed=false`. Remaining closure work is deeper semantic review and durable repo-map admission, not proving the basic adoption chain again. - 2026-06-20: Native repo-work queue-run service lifecycle proof is now landed. Smoke `.epiphany-smoke\repo-work-service-lifecycle-20260620-185853` proves Idunn can write non-mutating `service-plan` and `service-runbook` receipts for exact service id `epiphany-repo-work-queue-runner`, with service args including `queue-run --dry-run`, runbook SHA-256 `f2ec67c4f8243a3ebc2f9e915b6b9f5ae2ac2d99d2cdb86905b54667adc456f8`, receipt-directory `service-lifecycle` readback present, `lifecycleOwner=Idunn`, `hostedBody=repo-work`, `mutatesServiceManager=false`, `launchesService=false`, `requiresElevatedAuthority=false`, and `privateStateExposed=false`. The remaining scar is elevated install/start execution and complete aftercare audit under explicit operator authority, not basic plan/runbook proof. - 2026-06-20: The first repo Persona intake mouth is live. `epiphany-work persona-intake` requires a repo-swarm online receipt, records a Persona bubble/speech-audit witness into repo-local CultMesh, creates public discussion and candidate action refs, delegates to `accept`, and seals `work-persona-intake-.json` without Hands, durable-state, publication, service lifecycle, cross-repo, elevation, or private-state authority. Wrapper mode `tools/epiphany_local_run.ps1 -Mode repo-persona-intake -RepoWorkItem -PersonaInput ''` exposes the operator surface. Disposable proof `.epiphany-smoke\persona-intake-20260620-022500` wrote direct item `persona-request` with speech audit `persona-speech-audit-cdcd20a7`, feedback `repo-work-feedback-persona-request`, consensus `repo-work-consensus-persona-request`, and `privateStateExposed=false`; wrapper artifact `local-20260620-022551-566-5576908e` wrote item `persona-wrapper`, speech audit `persona-speech-audit-55f74218`, feedback `repo-work-feedback-persona-wrapper`, consensus `repo-work-consensus-persona-wrapper`, and candidate action `candidate-action://repo-swarm-local/persona-wrapper/persona-speech-audit-55f74218`. The next cut is deeper model-authored closure review, further non-planning action classes, or Idunn-owned queue-run service execution; not another intake/display surface. - 2026-06-20: Typed Imagination action-item receipts are live in `epiphany-work derive-plan`. The command now writes `work-action-items-.json` with schema `epiphany.repo_work_imagination_action_items_receipt.v0` before writing `work-plan-.json`; the receipt carries model provenance, safe action family, requested paths, verification asks, stop conditions, escalation reasons, rollback hints, public/candidate refs, `operatorAuthoredShellDetails=false`, and no Hands/durable-state/publication/service/cross-repo authority. The plan derivation cites the action-item receipt, while command text remains deterministic safe-family lowering. Disposable proof `.epiphany-smoke\action-items-20260620-023240` wrote action receipt `repo-work-action-items-action-items-request` with `modelAuthored=true`, `safeActionFamily=repo.markdown_planning_note`, requested path `notes/epiphany-work/action-items-request.md`, plan citation present, and `privateStateExposed=false`. The next cut is deeper model-authored closure review, further non-planning action classes, or Idunn-owned queue-run service execution; not another basic action-item schema. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 8f6e8b48..6d3a06dc 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index bf9a2516..e8274ccc 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -634,5 +634,5 @@ current_status: - `tools/epiphany_local_run.ps1 -Mode swarm-online-runbook` now emits an explicit Idunn preflight summary before the operator elevation boundary. Its JSON and one-line summary report `preflightStatus`, child artifact present/hash-verified/mismatch/missing counts, aggregate service execution failed/missing check counts, child preflight rows with expected/actual SHA-256s, and private-state exposure. Live proof `local-20260619-025627-410-9724e2f6` generated the non-mutating parent artifact with `preflightStatus=ready-for-elevated-operator`, two child runbooks present, two hashes verified, zero mismatches, zero missing artifacts, eleven failed sealed service checks, zero missing checks, explicit aftercare audits, and `privateStateExposed=false`. The remaining scar is still explicit elevated operator execution followed by complete Idunn audits, not missing parent/child artifact readiness. - Service lifecycle receipt history is now event-only: `load_epiphany_cultmesh_daemon_service_lifecycle_receipts` filters out the `epiphany-local/daemon-service-lifecycle-receipt/latest` mirror, while `load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt` remains the latest-state reader. Focused unit test `service_lifecycle_receipt_history_excludes_latest_mirror` proves two per-receipt writes return exactly two history records and latest points at the second. Fresh smoke `verse-query-lifecycle-history-filter-smoke` and live overview/triage `local-20260618-145632-497-efac6f0d` / `local-20260618-145632-321-867947af` prove compact swarm sights still expose service lifecycle attention plus the present elevated runbook artifact without daemon pokes or service mutation. Do not use a broad unscoped cargo test filter for this check on Windows; it fans out across bin harnesses and hit a broken pipe during this pass. - `epiphany-verse-query seed-compact` is the compact seed receipt for wrappers and read-only rites. The older `seed` command still prints the full local Verse context for explicit debugging, but compact wrapper modes now avoid full `seed`/final `query` readback after the combined overview proof exposed Windows debug stack overflow from full-context serialization pressure. - last_completed_repo_swarm_cut: `repo-deployment-request` now writes branch-local Idunn-facing deployment request cargo for reviewed git-push-observed-by-Idunn deployment without granting deploy, SSH, git-push, service lifecycle, Hands, publication, merge, cross-body, or private-state authority; proof `.epiphany-smoke\repo-deployment-request-family-20260620-195605` closed through Soul with family assertions/path scope passed, Idunn review pending, deployment script/host/secret/rollback/aftercare requirements present, and private-state seal intact. - next_action: Continue repo-swarm MVP work from the documented Epiphany Online cut order in `notes/epiphany-repo-swarm-mvp-contract.md`. Typed Gjallar repo-work history/queue sight, peer-readable Persona Eve lowering, Self-owned `epiphany-work queue-run`, bounded `epiphany-swarm run`, execute-to-close scheduler handoff through `close-from-execute`, deterministic `derive-plan` families `append-worklog`, `planning-note`, `checklist-note`, `section-note` / `repo.markdown_managed_section`, `task-card` / `repo.task_card`, `repo-status-section` / `repo.status_section`, `repo-manifest` / `repo.body_manifest`, `repo-tool-capabilities` / `repo.tool_capabilities`, `repo-tool-request` / `repo.tool_request`, `repo-eve-surface` / `repo.eve_surface`, `repo-collaboration-policy` / `repo.collaboration_policy`, `repo-collaboration-topic` / `repo.collaboration_topic`, `repo-consensus-brief` / `repo.consensus_brief`, `repo-objective-draft` / `repo.objective_draft`, `repo-adoption-request` / `repo.adoption_request`, `repo-scheduling-request` / `repo.scheduling_request`, `repo-work-order` / `repo.work_order`, `repo-verification-request` / `repo.verification_request`, `repo-publication-request` / `repo.publication_request`, `repo-sync-request` / `repo.sync_request`, `repo-maintainer-review-request` / `repo.maintainer_review_request`, `repo-pr-request` / `repo.pr_request`, `repo-credit-request` / `repo.credit_request`, `repo-artifact-acceptance-request` / `repo.artifact_acceptance_request`, `repo-metrics-request` / `repo.metrics_request`, `repo-doctrine-update-request` / `repo.doctrine_update_request`, `repo-secret-policy-request` / `repo.secret_policy_request`, and `repo-deployment-request` / `repo.deployment_request`, typed Imagination action-item receipts over allowlisted safe families, `epiphany.repo_work_mind_interpretation.v0` plus `epiphany.repo_work_mind_adoption_decision.v0` Mind interpreter receipts, explicit safe-family allowlist refusal, and explicit requested-path/plan-changed-path mismatch refusal before branch-local Hands authority, hash-backed local proof bundles with Bifrost/GitHub/credit/PR/upstream-main publication rows, redacted `epiphany-work export-proof` public bundles plus local Verse `epiphany.cultmesh.repo_work_public_proof.v0` Gjallar readback, Bifrost-owned `gamecult.bifrost.public_proof_publication_receipt.v0` closure plus wrapper `bifrost-public-proof` for redacted public proofs, Idunn-hosted non-mutating queue-run lifecycle plan/runbook receipts including native proof `.epiphany-smoke\repo-work-service-lifecycle-20260620-185853`, and the speech-audited `epiphany-work persona-intake` mouth plus wrapper `repo-persona-intake` are live with `privateStateExposed=false`; proofs `.epiphany-smoke\fresh-repo-mvp-20260620-180024`, `.epiphany-smoke\swarm-stop-classification-20260620-184717`, `.epiphany-smoke\repo-mind-safe-family-guard-20260620-194425`, `.epiphany-smoke\repo-mind-path-guard-20260620-194239`, `.epiphany-smoke\repo-doctrine-update-request-family-20260620-192140`, `.epiphany-smoke\repo-secret-policy-request-family-20260620-193046`, and `.epiphany-smoke\repo-deployment-request-family-20260620-195605` show fresh-repo iteration-limit stop classification, empty-queue Gjallar classification, dry-run planning-preview Self classification, Bifrost publication-gate classification, Bifrost/GitHub upstream-sync gate classification, Mind refusal for unsupported safe-family cargo and mismatched requested paths, reviewed doctrine/security/deployment request cargo, closure, publication receipts, upstream-main sync, public-proof export, and private-state sealing. The contract note now explicitly answers that Epiphany is headed toward a functional repo swarm but is not fully online until the typed artery runs as a living repo organism. The next cut is deeper interpreter semantics beyond adoption refusal, more useful reviewed repo-owned config/action request families, explicit Idunn deployment execution/audit under operator authority, or richer closure depth. Preserve Idunn service lifecycle ownership and existing CultMesh/Odin/Eve tool directories; service install/start/deployment execution still requires explicit elevated operator authority. + last_completed_repo_swarm_cut: Soul closure now verifies accepted Mind adoption proof before closing branch-local repo work. `epiphany-work close` embeds `epiphany.repo_work_mind_adoption_closure_review.v0`, checks the cited adoption receipt's embedded `epiphany.repo_work_mind_adoption_decision.v0` snapshot plus standalone decision receipt, and refuses missing/tampered/non-affirmative Mind decisions even when verification, path scope, and safe-family assertions pass. Proof `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-201153` showed counterfeit adoption produced `verification-failed` / Soul `failed` / `mindAdoptionReview.status=failed`, while the original chain closed with Soul `passed`, `mindAdoptionReview.status=passed`, and `privateStateExposed=false`. + next_action: Continue repo-swarm MVP work from the documented Epiphany Online cut order in `notes/epiphany-repo-swarm-mvp-contract.md`. Typed Gjallar repo-work history/queue sight, peer-readable Persona Eve lowering, Self-owned `epiphany-work queue-run`, bounded `epiphany-swarm run`, execute-to-close scheduler handoff through `close-from-execute`, deterministic `derive-plan` families `append-worklog`, `planning-note`, `checklist-note`, `section-note` / `repo.markdown_managed_section`, `task-card` / `repo.task_card`, `repo-status-section` / `repo.status_section`, `repo-manifest` / `repo.body_manifest`, `repo-tool-capabilities` / `repo.tool_capabilities`, `repo-tool-request` / `repo.tool_request`, `repo-eve-surface` / `repo.eve_surface`, `repo-collaboration-policy` / `repo.collaboration_policy`, `repo-collaboration-topic` / `repo.collaboration_topic`, `repo-consensus-brief` / `repo.consensus_brief`, `repo-objective-draft` / `repo.objective_draft`, `repo-adoption-request` / `repo.adoption_request`, `repo-scheduling-request` / `repo.scheduling_request`, `repo-work-order` / `repo.work_order`, `repo-verification-request` / `repo.verification_request`, `repo-publication-request` / `repo.publication_request`, `repo-sync-request` / `repo.sync_request`, `repo-maintainer-review-request` / `repo.maintainer_review_request`, `repo-pr-request` / `repo.pr_request`, `repo-credit-request` / `repo.credit_request`, `repo-artifact-acceptance-request` / `repo.artifact_acceptance_request`, `repo-metrics-request` / `repo.metrics_request`, `repo-doctrine-update-request` / `repo.doctrine_update_request`, `repo-secret-policy-request` / `repo.secret_policy_request`, and `repo-deployment-request` / `repo.deployment_request`, typed Imagination action-item receipts over allowlisted safe families, `epiphany.repo_work_mind_interpretation.v0` plus `epiphany.repo_work_mind_adoption_decision.v0` Mind interpreter receipts, explicit safe-family allowlist refusal, explicit requested-path/plan-changed-path mismatch refusal, and Soul closure's Mind-adoption proof guard before branch-local Hands consequences reach publication gates, hash-backed local proof bundles with Bifrost/GitHub/credit/PR/upstream-main publication rows, redacted `epiphany-work export-proof` public bundles plus local Verse `epiphany.cultmesh.repo_work_public_proof.v0` Gjallar readback, Bifrost-owned `gamecult.bifrost.public_proof_publication_receipt.v0` closure plus wrapper `bifrost-public-proof` for redacted public proofs, Idunn-hosted non-mutating queue-run lifecycle plan/runbook receipts including native proof `.epiphany-smoke\repo-work-service-lifecycle-20260620-185853`, and the speech-audited `epiphany-work persona-intake` mouth plus wrapper `repo-persona-intake` are live with `privateStateExposed=false`; proofs `.epiphany-smoke\fresh-repo-mvp-20260620-180024`, `.epiphany-smoke\swarm-stop-classification-20260620-184717`, `.epiphany-smoke\repo-mind-safe-family-guard-20260620-194425`, `.epiphany-smoke\repo-mind-path-guard-20260620-194239`, `.epiphany-smoke\repo-doctrine-update-request-family-20260620-192140`, `.epiphany-smoke\repo-secret-policy-request-family-20260620-193046`, `.epiphany-smoke\repo-deployment-request-family-20260620-195605`, and `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-201153` show fresh-repo iteration-limit stop classification, empty-queue Gjallar classification, dry-run planning-preview Self classification, Bifrost publication-gate classification, Bifrost/GitHub upstream-sync gate classification, Mind refusal for unsupported safe-family cargo and mismatched requested paths, reviewed doctrine/security/deployment request cargo, closure refusal for counterfeit Mind adoption, closure, publication receipts, upstream-main sync, public-proof export, and private-state sealing. The contract note now explicitly answers that Epiphany is headed toward a functional repo swarm but is not fully online until the typed artery runs as a living repo organism. The next cut is deeper semantic review and durable repo-map admission, further useful repo-owned config/action request families, or explicit Idunn deployment execution/audit under operator authority. Preserve Idunn service lifecycle ownership and existing CultMesh/Odin/Eve tool directories; service install/start/deployment execution still requires explicit elevated operator authority.