diff --git a/epiphany-core/src/bin/epiphany-work.rs b/epiphany-core/src/bin/epiphany-work.rs index 398b78ca..f2d239fd 100644 --- a/epiphany-core/src/bin/epiphany-work.rs +++ b/epiphany-core/src/bin/epiphany-work.rs @@ -9,8 +9,13 @@ use epiphany_core::HANDS_COMMIT_RECEIPT_TYPE; use epiphany_core::HANDS_PATCH_RECEIPT_TYPE; use epiphany_core::HANDS_PR_RECEIPT_TYPE; use epiphany_core::HandsActionIntent; +use epiphany_core::MIND_GATEWAY_REVIEW_SCHEMA_VERSION; +use epiphany_core::MindGatewayDecision; +use epiphany_core::MindGatewayReview; use epiphany_core::RuntimeSpineInitOptions; +use epiphany_core::SOUL_VERDICT_RECEIPT_SCHEMA_VERSION; use epiphany_core::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION; +use epiphany_core::SoulVerdictReceipt; use epiphany_core::SubstrateGateRepoAccessGrantReceipt; use epiphany_core::hands_action_review_for_intent; use epiphany_core::hands_command_receipt_for_review; @@ -19,12 +24,16 @@ use epiphany_core::hands_patch_receipt_for_review; use epiphany_core::hands_pr_receipt_for_review; use epiphany_core::initialize_runtime_spine; use epiphany_core::load_epiphany_cultmesh_swarm_brake; +use epiphany_core::mind_state_commit_receipt; use epiphany_core::put_hands_action_intent; use epiphany_core::put_hands_action_review; use epiphany_core::put_hands_command_receipt; use epiphany_core::put_hands_commit_receipt; use epiphany_core::put_hands_patch_receipt; use epiphany_core::put_hands_pr_receipt; +use epiphany_core::put_mind_gateway_review; +use epiphany_core::put_mind_state_commit_receipt; +use epiphany_core::put_soul_verdict_receipt; use epiphany_core::put_substrate_gate_repo_access_grant_receipt; use epiphany_core::runtime_hands_action_intent; use epiphany_core::runtime_hands_action_review; @@ -50,6 +59,7 @@ fn main() -> Result<()> { "run" => run_work(parse_run_args(args)?), "adopt" | "promote" => run_adopt(parse_adopt_args(args)?), "execute" | "exec" => run_execute(parse_execute_args(args)?), + "close" | "closure" | "verify-close" => run_close(parse_close_args(args)?), "publish" => run_publish(parse_publish_args(args)?), "sync" | "sync-main" => run_sync(parse_sync_args(args)?), "tick" | "pulse" | "schedule" => run_tick(parse_tick_args(args)?), @@ -133,12 +143,26 @@ struct ExecuteArgs { summary: Option, } +#[derive(Clone, Debug)] +struct CloseArgs { + workspace: PathBuf, + item: Option, + execute_receipt: Option, + runtime_store: Option, + artifact_dir: Option, + verification_command: Option, + verification_summary: Option, + modeling_summary: Option, + state_revision: u64, +} + #[derive(Clone, Debug)] struct PublishArgs { workspace: PathBuf, epiphany_root: PathBuf, item: Option, adopt_receipt: Option, + closure_receipt: Option, runtime_store: Option, local_verse_store: Option, artifact_dir: Option, @@ -484,11 +508,59 @@ fn parse_execute_args(args: impl Iterator) -> Result }) } +fn parse_close_args(args: impl Iterator) -> Result { + let mut workspace = None; + let mut item = None; + let mut execute_receipt = None; + let mut runtime_store = None; + let mut artifact_dir = None; + let mut verification_command = None; + let mut verification_summary = None; + let mut modeling_summary = None; + let mut state_revision = 0_u64; + + let mut args = args.peekable(); + while let Some(arg) = args.next() { + match arg.as_str() { + "--workspace" => workspace = Some(take_path(&mut args, "--workspace")?), + "--item" => item = Some(take_string(&mut args, "--item")?), + "--execute-receipt" | "--from-execute" => { + execute_receipt = Some(take_path(&mut args, "--execute-receipt")?); + } + "--runtime-store" => runtime_store = Some(take_path(&mut args, "--runtime-store")?), + "--artifact-dir" => artifact_dir = Some(take_path(&mut args, "--artifact-dir")?), + "--verification-command" => { + verification_command = Some(take_string(&mut args, "--verification-command")?); + } + "--verification-summary" => { + verification_summary = Some(take_string(&mut args, "--verification-summary")?); + } + "--modeling-summary" => { + modeling_summary = Some(take_string(&mut args, "--modeling-summary")?); + } + "--state-revision" => state_revision = take_u64(&mut args, "--state-revision")?, + other => return Err(anyhow!("unexpected close argument {other:?}")), + } + } + Ok(CloseArgs { + workspace: workspace.context("missing --workspace")?, + item, + execute_receipt, + runtime_store, + artifact_dir, + verification_command, + verification_summary, + modeling_summary, + state_revision, + }) +} + fn parse_publish_args(args: impl Iterator) -> Result { let mut workspace = None; let mut epiphany_root = None; let mut item = None; let mut adopt_receipt = None; + let mut closure_receipt = None; let mut runtime_store = None; let mut local_verse_store = None; let mut artifact_dir = None; @@ -515,6 +587,9 @@ fn parse_publish_args(args: impl Iterator) -> Result "--epiphany-root" => epiphany_root = Some(take_path(&mut args, "--epiphany-root")?), "--item" => item = Some(take_string(&mut args, "--item")?), "--adopt-receipt" => adopt_receipt = Some(take_path(&mut args, "--adopt-receipt")?), + "--closure-receipt" | "--close-receipt" => { + closure_receipt = Some(take_path(&mut args, "--closure-receipt")?); + } "--runtime-store" => runtime_store = Some(take_path(&mut args, "--runtime-store")?), "--local-verse-store" | "--store" => { local_verse_store = Some(take_path(&mut args, "--local-verse-store")?); @@ -560,6 +635,22 @@ fn parse_publish_args(args: impl Iterator) -> Result other => return Err(anyhow!("unexpected publish argument {other:?}")), } } + if let Some(path) = closure_receipt.as_ref() { + let closure = read_json(path)?; + if closure.get("status").and_then(Value::as_str) != Some("closed") { + return Err(anyhow!("closure receipt {} is not closed", path.display())); + } + if verification_receipts.is_empty() { + if let Some(id) = string_from_json(&closure, &["soul", "verdictReceiptId"]) { + verification_receipts.push(id); + } + } + if review_receipts.is_empty() { + if let Some(id) = string_from_json(&closure, &["mind", "stateCommitReceiptId"]) { + review_receipts.push(id); + } + } + } if verification_receipts.is_empty() { return Err(anyhow!( "publish requires at least one --verification-receipt from Soul" @@ -576,6 +667,7 @@ fn parse_publish_args(args: impl Iterator) -> Result .unwrap_or(env::current_dir().context("failed to resolve current directory")?), item, adopt_receipt, + closure_receipt, runtime_store, local_verse_store, artifact_dir, @@ -1568,6 +1660,262 @@ fn run_execute(args: ExecuteArgs) -> Result { })) } +fn run_close(args: CloseArgs) -> Result { + let workspace = args + .workspace + .canonicalize() + .with_context(|| format!("failed to resolve {}", args.workspace.display()))?; + ensure_git_repo(&workspace)?; + let execute_receipt_path = + resolve_execute_receipt(&workspace, args.item.as_deref(), args.execute_receipt)?; + let execute_receipt = read_json(&execute_receipt_path)?; + if execute_receipt.get("status").and_then(Value::as_str) != Some("branch-local-commit-recorded") + { + return Err(anyhow!( + "close requires a branch-local-commit-recorded execute receipt" + )); + } + let runtime_store = args.runtime_store.unwrap_or_else(|| { + path_from_json(&execute_receipt, &["runtimeStore"]).unwrap_or_else(|| { + workspace + .join(".epiphany") + .join("state") + .join("runtime-spine.msgpack") + }) + }); + let artifact_dir = args + .artifact_dir + .unwrap_or_else(|| workspace.join(".epiphany").join("work")); + fs::create_dir_all(&artifact_dir) + .with_context(|| format!("failed to create {}", artifact_dir.display()))?; + let item = execute_receipt + .get("item") + .and_then(Value::as_str) + .unwrap_or("work-item") + .to_string(); + let item_slug = sanitize(&item); + let commit_sha = string_from_json(&execute_receipt, &["handsReceipts", "commitSha"]) + .ok_or_else(|| anyhow!("execute receipt has no handsReceipts.commitSha"))?; + let patch_receipt_id = string_from_json(&execute_receipt, &["handsReceipts", "patchReceiptId"]) + .ok_or_else(|| anyhow!("execute receipt has no handsReceipts.patchReceiptId"))?; + let command_receipt_id = + string_from_json(&execute_receipt, &["handsReceipts", "commandReceiptId"]) + .ok_or_else(|| anyhow!("execute receipt has no handsReceipts.commandReceiptId"))?; + let commit_receipt_id = + string_from_json(&execute_receipt, &["handsReceipts", "commitReceiptId"]) + .ok_or_else(|| anyhow!("execute receipt has no handsReceipts.commitReceiptId"))?; + let commit_receipt = runtime_hands_commit_receipt(&runtime_store, &commit_receipt_id)? + .ok_or_else(|| anyhow!("runtime-spine has no Hands commit receipt {commit_receipt_id}"))?; + if commit_receipt.commit_sha != commit_sha { + return Err(anyhow!( + "execute receipt commit sha does not match runtime Hands commit receipt" + )); + } + let verification_command = args + .verification_command + .unwrap_or_else(|| format!("git show --stat --oneline {commit_sha}")); + let stdout_artifact = artifact_dir.join(format!("work-close-{item_slug}.stdout.log")); + let stderr_artifact = artifact_dir.join(format!("work-close-{item_slug}.stderr.log")); + let verification = Command::new("powershell") + .arg("-NoProfile") + .arg("-Command") + .arg(&verification_command) + .current_dir(&workspace) + .output() + .with_context(|| { + format!( + "failed to run closure verification in {}", + workspace.display() + ) + })?; + fs::write(&stdout_artifact, &verification.stdout) + .with_context(|| format!("failed to write {}", stdout_artifact.display()))?; + fs::write(&stderr_artifact, &verification.stderr) + .with_context(|| format!("failed to write {}", stderr_artifact.display()))?; + let now = Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true); + let verification_passed = verification.status.success(); + let soul_verdict_id = format!("repo-work-close-{item_slug}-soul-verdict"); + let soul_summary = args.verification_summary.unwrap_or_else(|| { + if verification_passed { + format!("Soul verified branch-local commit {commit_sha} for repo work item {item}.") + } else { + format!("Soul verification failed for branch-local commit {commit_sha}.") + } + }); + let mut evidence_ids = vec![ + patch_receipt_id.clone(), + command_receipt_id.clone(), + commit_receipt_id.clone(), + normalize_path_for_receipt(&stdout_artifact), + normalize_path_for_receipt(&stderr_artifact), + ]; + evidence_ids.extend(string_array_from_json(&execute_receipt, &["changedPaths"])); + let soul_verdict = SoulVerdictReceipt { + schema_version: SOUL_VERDICT_RECEIPT_SCHEMA_VERSION.to_string(), + receipt_id: soul_verdict_id.clone(), + source_result_id: format!("repo-work-execute-{item_slug}"), + source_job_id: format!("repo-work-close-{item_slug}"), + verdict: if verification_passed { + "passed".to_string() + } else { + "failed".to_string() + }, + summary: soul_summary.clone(), + evidence_ids: evidence_ids.clone(), + risks: if verification_passed { + Vec::new() + } else { + vec!["Closure verification command failed; publication remains blocked.".to_string()] + }, + emitted_at: now.clone(), + contract: "Soul verdict for repo-work closure; verifies the Hands patch/command/commit consequence before Modeling/Mind closure and Bifrost publication.".to_string(), + }; + put_soul_verdict_receipt(&runtime_store, &soul_verdict)?; + + let closure_receipt_path = artifact_dir.join(format!("work-close-{item_slug}.json")); + if !verification_passed { + let failed_receipt = json!({ + "schemaVersion": "epiphany.repo_work_closure_receipt.v0", + "createdAt": now, + "workspace": workspace, + "runtimeStore": runtime_store, + "executeReceiptPath": execute_receipt_path, + "item": item, + "status": "verification-failed", + "soul": { + "verdictReceiptId": soul_verdict.receipt_id, + "verdict": soul_verdict.verdict, + "summary": soul_verdict.summary, + "stdoutArtifact": normalize_path_for_receipt(&stdout_artifact), + "stderrArtifact": normalize_path_for_receipt(&stderr_artifact) + }, + "authority": { + "branchLocalOnly": true, + "publicationGateSatisfied": false, + "durableStateAdmitted": false, + "privateStateExposed": false + }, + "privateStateExposed": false, + "nextSafeMove": "Repair or re-run branch-local work, then close again before publication." + }); + write_json(&closure_receipt_path, &failed_receipt)?; + return Ok(json!({ + "schemaVersion": "epiphany.repo_work_closure.v0", + "status": failed_receipt["status"], + "workspace": failed_receipt["workspace"], + "receiptPath": closure_receipt_path, + "item": failed_receipt["item"], + "soul": failed_receipt["soul"], + "authority": failed_receipt["authority"], + "privateStateExposed": false, + "nextSafeMove": failed_receipt["nextSafeMove"], + })); + } + + let modeling_summary = args.modeling_summary.unwrap_or_else(|| { + format!( + "Modeling records repo work item {item} changed [{}] at commit {commit_sha}; scheduler should stop implementation until publication review.", + string_array_from_json(&execute_receipt, &["changedPaths"]).join(", ") + ) + }); + let gateway_id = format!("repo-work-close-{item_slug}-mind-review"); + let mind_review = MindGatewayReview { + schema_version: MIND_GATEWAY_REVIEW_SCHEMA_VERSION.to_string(), + gateway_id: gateway_id.clone(), + source_kind: "repo_work_closure".to_string(), + source_role_id: "modeling".to_string(), + decision: MindGatewayDecision::Accept, + allowed_effects: vec![ + "repoWorkClosure".to_string(), + "modelingSummary".to_string(), + "publicationGate".to_string(), + ], + refused_effects: Vec::new(), + reasons: vec![ + "Soul passed the branch-local Hands consequence.".to_string(), + "Modeling summary is source-grounded in execute receipt and commit proof.".to_string(), + "Mind admits closure metadata only; Bifrost still gates publication and merge.".to_string(), + ], + contract: "Mind review for repo-work closure; admits the verified Modeling summary and publication gate without granting merge or service authority.".to_string(), + }; + put_mind_gateway_review(&runtime_store, &mind_review)?; + let mind_commit_id = format!("repo-work-close-{item_slug}-mind-commit"); + let mind_commit = mind_state_commit_receipt( + mind_commit_id.clone(), + &mind_review, + args.state_revision, + vec![ + "repoWork.closure".to_string(), + "repoWork.modelingSummary".to_string(), + ], + Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true), + ); + put_mind_state_commit_receipt(&runtime_store, &mind_commit)?; + + let closure_receipt = json!({ + "schemaVersion": "epiphany.repo_work_closure_receipt.v0", + "createdAt": now, + "workspace": workspace, + "runtimeStore": runtime_store, + "executeReceiptPath": execute_receipt_path, + "item": item, + "status": "closed", + "handsReceipts": { + "patchReceiptId": patch_receipt_id, + "commandReceiptId": command_receipt_id, + "commitReceiptId": commit_receipt_id, + "commitSha": commit_sha + }, + "soul": { + "verdictReceiptId": soul_verdict.receipt_id, + "verdict": soul_verdict.verdict, + "summary": soul_verdict.summary, + "stdoutArtifact": normalize_path_for_receipt(&stdout_artifact), + "stderrArtifact": normalize_path_for_receipt(&stderr_artifact) + }, + "modeling": { + "summary": modeling_summary, + "changedPaths": execute_receipt["changedPaths"], + "commitSha": execute_receipt["handsReceipts"]["commitSha"], + "source": "epiphany.repo_work_execute_receipt.v0" + }, + "mind": { + "gatewayReviewId": mind_review.gateway_id, + "stateCommitReceiptId": mind_commit.receipt_id, + "stateRevision": mind_commit.state_revision, + "changedFields": mind_commit.changed_fields + }, + "authority": { + "branchLocalOnly": true, + "publicationGateSatisfied": true, + "publicationAuthorized": false, + "mergeAuthorized": false, + "serviceLifecycleAuthorized": false, + "crossRepoMutationAuthorized": false, + "durableStateAdmitted": true, + "privateStateExposed": false + }, + "privateStateExposed": false, + "nextSafeMove": "Use epiphany-work publish --closure-receipt with Bifrost/GitHub refs; merge remains gated by maintainers and sync receipts." + }); + write_json(&closure_receipt_path, &closure_receipt)?; + Ok(json!({ + "schemaVersion": "epiphany.repo_work_closure.v0", + "status": closure_receipt["status"], + "workspace": closure_receipt["workspace"], + "runtimeStore": closure_receipt["runtimeStore"], + "receiptPath": closure_receipt_path, + "item": closure_receipt["item"], + "handsReceipts": closure_receipt["handsReceipts"], + "soul": closure_receipt["soul"], + "modeling": closure_receipt["modeling"], + "mind": closure_receipt["mind"], + "authority": closure_receipt["authority"], + "privateStateExposed": false, + "nextSafeMove": closure_receipt["nextSafeMove"], + })) +} + fn run_publish(args: PublishArgs) -> Result { let workspace = args .workspace @@ -1810,6 +2158,7 @@ fn run_publish(args: PublishArgs) -> Result { "adoptReceiptPath": adopt_receipt_path, "runReceiptPath": run_receipt_path, "onlineReceiptPath": online_receipt_path, + "closureReceiptPath": args.closure_receipt, "item": item, "status": "publication-receipts-recorded", "targetRepository": target_repository, @@ -2158,6 +2507,7 @@ fn run_tick(args: TickArgs) -> Result { let run_receipt_path = work_receipt_path(&workspace, "run", &item); let adopt_receipt_path = work_receipt_path(&workspace, "adopt", &item); let execute_receipt_path = work_receipt_path(&workspace, "execute", &item); + let close_receipt_path = work_receipt_path(&workspace, "close", &item); let publish_receipt_path = work_receipt_path(&workspace, "publish", &item); let sync_receipt_path = work_receipt_path(&workspace, "sync", &item); @@ -2167,6 +2517,7 @@ fn run_tick(args: TickArgs) -> Result { &run_receipt_path, &adopt_receipt_path, &execute_receipt_path, + &close_receipt_path, &publish_receipt_path, &sync_receipt_path, ); @@ -2182,6 +2533,7 @@ fn run_tick(args: TickArgs) -> Result { &run_receipt_path, &adopt_receipt_path, &execute_receipt_path, + &close_receipt_path, &publish_receipt_path, &sync_receipt_path, ); @@ -2269,6 +2621,7 @@ fn run_tick(args: TickArgs) -> Result { &run_receipt_path, &adopt_receipt_path, &execute_receipt_path, + &close_receipt_path, &publish_receipt_path, &sync_receipt_path, ); @@ -2353,6 +2706,7 @@ fn run_tick(args: TickArgs) -> Result { &run_receipt_path, &adopt_receipt_path, &execute_receipt_path, + &close_receipt_path, &publish_receipt_path, &sync_receipt_path, ); @@ -2460,6 +2814,13 @@ fn run_tick(args: TickArgs) -> Result { "publication receipt exists; scheduler stops before merge/sync authority".to_string(); next_safe_move = "Wait for maintainer/Bifrost merge receipt, then run epiphany-work sync.".to_string(); + } else if close_receipt_path.exists() { + action = "none".to_string(); + status = "noop".to_string(); + reason = "Soul/Modeling/Mind closure is recorded; scheduler stops before Bifrost publication authority".to_string(); + next_safe_move = + "Route Bifrost/GitHub publication through epiphany-work publish --closure-receipt." + .to_string(); } else if execute_receipt_path.exists() { action = "none".to_string(); status = "noop".to_string(); @@ -2582,6 +2943,7 @@ fn run_tick(args: TickArgs) -> Result { &run_receipt_path, &adopt_receipt_path, &execute_receipt_path, + &close_receipt_path, &publish_receipt_path, &sync_receipt_path, ); @@ -2737,6 +3099,25 @@ fn resolve_publish_receipt( }) } +fn resolve_execute_receipt( + workspace: &Path, + item: Option<&str>, + explicit: Option, +) -> Result { + if let Some(path) = explicit { + return Ok(path); + } + let work_dir = workspace.join(".epiphany").join("work"); + if let Some(item) = item { + return Ok(work_dir.join(format!("work-execute-{}.json", sanitize(item)))); + } + latest_receipt_in(&work_dir, "work-execute-").ok_or_else(|| { + anyhow!( + "no work execute receipt found; run epiphany-work execute first or pass --execute-receipt" + ) + }) +} + fn work_receipt_path(workspace: &Path, kind: &str, item: &str) -> PathBuf { workspace .join(".epiphany") @@ -2750,6 +3131,7 @@ fn repo_work_receipt_state( run: &Path, adopt: &Path, execute: &Path, + close: &Path, publish: &Path, sync: &Path, ) -> Value { @@ -2759,6 +3141,7 @@ fn repo_work_receipt_state( "run": receipt_path_state(run), "adopt": receipt_path_state(adopt), "execute": receipt_path_state(execute), + "close": receipt_path_state(close), "publish": receipt_path_state(publish), "sync": receipt_path_state(sync), }) diff --git a/notes/epiphany-repo-swarm-mvp-contract.md b/notes/epiphany-repo-swarm-mvp-contract.md index 7bf1d96b..57ad384e 100644 --- a/notes/epiphany-repo-swarm-mvp-contract.md +++ b/notes/epiphany-repo-swarm-mvp-contract.md @@ -134,9 +134,10 @@ epiphany-work plan --workspace --item --objective --plan-summ epiphany-work run --workspace epiphany-work adopt --workspace --item --from-plan epiphany-work execute --workspace --item --from-plan +epiphany-work close --workspace --item epiphany-work tick --workspace --item epiphany-work serve --workspace --item --max-iterations -epiphany-work publish --workspace +epiphany-work publish --workspace --closure-receipt epiphany-work sync --workspace --item --upstream-ref origin/main --merge-receipt ``` @@ -495,8 +496,8 @@ spawn Windows services, restart daemons, or take Idunn's daemon survival authority. The pulse stops once branch-local execution has been recorded. It does not -publish, merge, synthesize Soul/Mind receipts, install services, or impersonate -Idunn. Those gates remain owned by their organs. +publish, merge, install services, or impersonate Idunn. Soul/Mind closure is a +separate gate and remains explicit. The first smoke proved: @@ -540,6 +541,41 @@ wrote `epiphany.repo_work_scheduler_serve_receipt.v0`; iteration one advanced serve receipt reported `privateStateExposed=false`. A separate negative check proved unbounded `serve --loop-interval-seconds 0` refuses with exit code 1. +`epiphany-work close` is the first Soul/Modeling/Mind closure gate for a +branch-local Hands commit: + +```powershell +cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-work -- close --workspace --item +``` + +It reads `work-execute-.json`, requires +`status=branch-local-commit-recorded`, verifies the Hands commit receipt still +matches the recorded git SHA, then runs a verification command in the repo Body +(`git show --stat --oneline ` by default, or +`--verification-command ` when supplied). The command stdout/stderr are +sealed under `.epiphany/work/`, Soul writes +`epiphany.soul.verdict_receipt`, Modeling records the execution/commit summary, +and Mind writes gateway review plus state-commit receipts into runtime-spine. +The final `.epiphany/work/work-close-.json` receipt is +`epiphany.repo_work_closure_receipt.v0` with +`durableStateAdmitted=true`, `publicationGateSatisfied=true`, and +`privateStateExposed=false`. It still does not grant publication, merge, +service lifecycle, cross-repo mutation, or private-state exposure authority. + +`epiphany-work publish --closure-receipt ` can consume the +Soul verdict and Mind state-commit ids from that closure receipt when explicit +verification/review refs are not supplied. `epiphany-work tick` also recognizes +an existing close receipt and no-ops before Bifrost publication authority, so +Self cannot smuggle a local commit into public consequence. + +A fifth smoke proved the closure chain on a disposable fresh repo Body: +`execute` recorded `branch-local-commit-recorded`, `close` returned +`closed:passed`, Mind wrote +`repo-work-close-close-request-mind-commit`, +`publish --closure-receipt` consumed the Soul verdict and Mind commit ids, +the next tick returned `noop:none`, and every receipt summary reported +`privateStateExposed=false`. + ## Migration Implication The next migration plan must treat autonomous branch-local work as a required @@ -552,17 +588,18 @@ That is the machine we are building. ## Full Migration Plan To Repo Swarm MVP -This plan starts from the current state: ten native front doors exist, but the -work loop is not yet a full physiology. `init`, `online`, `accept`, `plan`, -`run`, `adopt`, `execute`, `tick`, `publish`, and `sync` prove the typed path +This plan starts from the current state: eleven native front doors exist, but +the work loop is not yet a full physiology. `init`, `online`, `accept`, `plan`, +`run`, `adopt`, `execute`, `close`, `tick`, `publish`, and `sync` prove the typed path from repo birth to branch-local scheduler pulse, Bifrost/GitHub publication receipts, and upstream-main sync proof. `tick` now also proves brake refusal, active-turn refusal, completion-anchored cooldown refusal, and stale active-turn recovery through typed scheduler receipts; `serve` now proves bounded cadence -around that same tick artery. The chain does not yet prove Soul/Modeling/Mind -closure after execution, or a repo Persona that can turn -conversation into autonomous action without the operator feeding plan details by -hand. +around that same tick artery; `close` now proves first deterministic +Soul/Modeling/Mind closure over Hands commit receipts. The chain does not yet +prove a repo Persona that can turn conversation into autonomous action without +the operator feeding plan details by hand, and deeper model-authored +Soul/Modeling closure remains future work. The MVP target is narrower than the full Perfect Machine and wider than a demo: a fresh repository can host an Epiphany swarm that initializes its Body, @@ -584,6 +621,7 @@ repo birth -> Substrate Gate + Hands queued run packet -> plan-backed branch-local Hands adoption -> plan-backed branch-local execution and commit + -> deterministic Soul/Modeling/Mind closure -> Bifrost/GitHub publication receipts -> upstream-main ancestry proof after explicit merge receipt ``` @@ -606,9 +644,12 @@ The chain is typed and sealed enough to be useful: - `epiphany-work execute --from-plan` consumes that authority on an `epiphany/*` branch, runs the planned command, stages only planned paths, commits, and records Hands patch/command/commit receipts. +- `epiphany-work close` consumes the execute receipt, verifies the Hands commit, + writes Soul verdict, Modeling summary, and Mind gateway/state-commit receipts, + then seals the closure receipt without granting publication or merge. - `epiphany-work publish` requires Hands commit proof plus Soul and Mind/review - refs before routing Bifrost/GitHub publication receipts; it does not claim - merge or upstream sync. + refs, or consumes those refs from a closure receipt, before routing + Bifrost/GitHub publication receipts; it does not claim merge or upstream sync. - `epiphany-work sync` requires an explicit maintainer/Bifrost merge receipt and writes `upstreamMainSynced=true` only after git proves the published commit is contained by upstream main. @@ -638,14 +679,15 @@ Required organs before MVP: - Scheduler physiology: the first `epiphany-work tick` pulse now has brake, active-turn, cooldown, and stale-turn recovery receipts, and `epiphany-work serve` adds bounded/unbounded cadence around that pulse. - Remaining work is handoff from branch-local execution to Soul/Modeling/Mind - closure and any later Idunn service lifecycle integration under explicit + Remaining work is optional handoff from branch-local execution into the close + gate and any later Idunn service lifecycle integration under explicit operator authority. - Persona-to-plan automation: repo Persona input becomes candidate action pressure, Mind/Interpreter extracts work-shaped intent, and Imagination writes the plan packet without the operator hand-authoring shell details. -- Soul/Modeling/Mind closure: a Hands commit is verified, modeled, and admitted - before Self schedules another implementation turn. +- Closure depth: deterministic Soul/Modeling/Mind closure exists for Hands + commits; richer model-authored Soul/Modeling review remains to replace the + current local verification rite where appropriate. - Repo work overview: the current item, branch, receipts, blocker, next safe action, and publication/sync state are visible through compact CultMesh/Eve surfaces without opening private thought. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 12dd7801..37262d1a 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -102,7 +102,7 @@ remembers doctrine; the branch remembers the blade. - Edge JSON is allowed for schema description, hostile ingress before immediate typed parsing, sealed forensic artifacts, or named quarantine experiments. When both subsystems are ours, runtime data must remain typed CultCache documents and move over CultNet typed contracts. Generic `serde_json::Value` in worker launch/result/selfPatch/runtime flow is contamination until classified and replaced. - Hands now has a first executable action receipt spine. `epiphany-core::hands_gateway` owns `HandsActionIntent`, `HandsActionReview`, `HandsPatchReceipt`, `HandsCommandReceipt`, and `HandsCommitReceipt`; runtime-spine can persist/reread them; `runtime_spine_persists_mind_gateway_review_receipts` includes the Hands chain beside Mind/Eyes/Substrate/Soul/Continuity proofs and proves the post-timestamp Hands receipt-chain detector; `epiphany-hands-action-smoke` emits intent/review/patch/command/commit receipt ids from `.epiphany-smoke\runtime-spine\hands-action-smoke.msgpack`; and the repo-action launch proof profile now requires action intent, action review, and patch receipt together. `epiphany-mvp-coordinator` now turns `continueImplementation` into a persisted Substrate Gate grant plus Hands intent/review gate and includes the receipt ids in the operator step. `epiphany-hands-action` is the native consequence recorder for that gate: `record-patch`, `record-command`, `record-commit`, and turn-level `record-pass` load the stored intent/review or `finalAction.handsActionGate` from `coordinator-summary.json`, require an approved matching review, enforce allowed operations, and keep patch/commit changed paths inside the requested scope. `epiphany-mvp-coordinator-smoke` includes the deterministic Hands pass proof. The coordinator now treats a complete Hands receipt chain after an accepted Soul result as new implementation evidence, launches Soul again, and routes a passing accepted Soul result to Modeling/modeling before another Hands turn. Work-loop telemetry is now typed internal CultMesh state: Verification role launches write `epiphany.cultmesh.work_loop_telemetry.v0` beside runtime-spine, render that packet for Soul with resolved receipt bodies, commit diff preview, source proof notes, verification assertions, and stdout/stderr previews, and Modeling launches read/enrich the latest packet with Soul acceptance receipt ids before Modeling updates the map. Local Verse prompt context now exposes only a sealed `latest_work_loop_summary` digest with telemetry id, Hands receipt ids, path/source/assertion counts, and Soul receipt ids; receipt payload previews, artifact previews, and commit diff previews remain internal telemetry and are leak-guarded by tests plus `epiphany-verse-query -- smoke`. - `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 ten-front-door chain from `epiphany-repo init` through `epiphany-work tick`, `publish`, and `sync`, documents the operator-safe proof receipts already proved with `privateStateExposed=false`, and names the remaining MVP organs: Persona-to-plan automation, Soul/Modeling/Mind closure, repo work overview, and proof bundles. 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 Soul/Mind/Bifrost gates. The tick pulse now 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 serve` now wraps that 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. Disposable fresh-repo smokes proved active refusal, `advanced:run-from-plan`, cooldown refusal without adoption, stale recovery into `advanced:adopt-from-plan`, active marker cleanup, last-completed anchor creation, serve cadence iteration one `advanced:run-from-plan`, iteration two `refused-by-cooldown:none`, no adoption during cooldown, unbounded zero-interval refusal, and `privateStateExposed=false`. +- `notes/epiphany-repo-swarm-mvp-contract.md` is the repo-swarm MVP authority map and migration plan. It states the live eleven-front-door chain from `epiphany-repo init` through `epiphany-work close`, `tick`, `publish`, and `sync`, documents the operator-safe proof receipts already proved with `privateStateExposed=false`, and names the remaining MVP organs: Persona-to-plan automation, repo work overview, proof bundles, optional execute-to-close handoff, and richer model-authored closure. 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 closure or publication gates. The tick pulse now 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 serve` now wraps that 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` now consumes branch-local execute receipts, verifies the Hands commit, writes Soul verdict plus Modeling summary plus Mind gateway/state-commit receipts, and seals `work-close-.json` without granting publication, merge, service lifecycle, cross-repo mutation, or private-state exposure. `epiphany-work publish --closure-receipt` can consume the closure's Soul/Mind ids, while tick no-ops once closure exists before Bifrost publication authority. Disposable fresh-repo smokes proved active refusal, `advanced:run-from-plan`, cooldown refusal without adoption, stale recovery into `advanced:adopt-from-plan`, active marker cleanup, last-completed anchor creation, serve cadence iteration one `advanced:run-from-plan`, iteration two `refused-by-cooldown:none`, no adoption during cooldown, unbounded zero-interval refusal, close `closed:passed`, publish consumption of the close receipt's Soul/Mind refs, post-publication tick `noop:none`, and `privateStateExposed=false`. - `service-execution-runbook` makes that next cut repeatable: it generates the exact elevated wrapper command sequence without mutating the service manager, continues after per-step failure to preserve more receipts, runs `service-execution-audit` in `finally`, exits nonzero if any step failed, and seals a typed runbook lifecycle receipt. Run the generated artifact only with explicit operator authority. - `service-execution-audit` is the non-mutating acceptance proof after the elevated rite: it reports `complete` only when typed lifecycle receipts prove the runbook witness plus expected elevated chain, and otherwise reports the missing/failed sealed checks. - `service-tick` is the non-elevated scheduler pulse proof: it writes the latest daemon scheduler receipt through durable policy ownership and local wrapper receipts. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 653ad8c8..1f0f6fc6 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 2baa168a..9584c648 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -88,7 +88,7 @@ active_subgoals: - Keep the landed Phase 6 coordinator, limited safe-boundary CRRC automation, and pre-compaction checkpoint intervention ready for the next bridge-equipped dogfood run. - Preserve the Ghostlight-derived heartbeat initiative seam: every lane, including coordinator/Self and Persona, has a organ-state record and competes for heartbeat slots through readiness/reaction timing; initiative heat can raise or cool global, group, arena, role, and agent tempo through typed heartbeat policy; active thinking freezes initiative until completion, so heat never queues a lane already mid-turn; idle winners ruminate instead of inventing project work, and sleep windows distill the accumulated thought pressure into reviewed self-memory or doctrine. - Use `notes/epiphany-swarm-readiness-plan.md` as the live-fire direction gate. The local run path is a compass, not launch clearance: before unattended swarm operation, Epiphany needs typed pause/brake enforcement, one initiative scheduler, completion-gated cooldown, stale active-turn recovery receipts, parent-side Persona speech eligibility, memory lifecycle operations, and CultNet-first operator snapshots/intents/receipts. The local Verse brake document exists, `epiphany-verse-query swarm-brake` can engage/release it, `tools/epiphany_local_run.ps1` refuses live `plan`/`run`/`mvp` modes when the brake is engaged while leaving `status` readable, `epiphany-mvp-coordinator` checks the local Verse brake before app-server startup, and `epiphany-heartbeat-store` guards tick/pump/heat/queue-mention/routine when given `--local-verse-store`. Daemon liveness is now a typed local Verse authority: `epiphany-verse-query daemon-status` writes one daemon status without repainting the table, local Verse seeding preserves existing daemon statuses and swarm brakes, `invoke-tool` refuses when the host daemon is not ready or lacks `submitTypedToolIntent`, and both daemon tool invocation and lifecycle poke fail closed under an engaged matching brake. `epiphany-daemon-supervisor policy` writes durable per-daemon restart policy with command/args/cwd/cooldown/backoff/attempt state plus reconcile cadence and stale-heartbeat threshold; `epiphany-daemon-supervisor reconcile` loads that policy when no override command is supplied, refuses under a matching lifecycle brake, refuses during cooldown/backoff, writes daemon poke intent/receipt, updates daemon status, and updates policy attempt state; `epiphany-daemon-supervisor tick` is an explicit scheduler pulse that scans durable policies, records ready/noop pulses, skips before the configured reconcile interval, marks stale heartbeat status degraded, routes restarts through the same brake/cooldown/poke receipt path, and writes a latest `epiphany.cultmesh.daemon_scheduler_receipt.v0`; `epiphany-daemon-supervisor serve` runs that same pulse on a configurable cadence with bounded `--max-iterations` proof mode or unbounded service mode. `epiphany-daemon-supervisor service-plan`/`install-service` now writes a planned `epiphany.cultmesh.daemon_service_lifecycle_receipt.v0` for the `serve` command, while `service-launch`/`start-service` spawns that `serve` loop through the current executable or `--service-command`, can `--wait-child` for bounded proof, and records command/args/cwd, scheduler id, daemon selector, pid/exit/status, artifact ref, and private-state guard. `service-runbook`, `windows-service-install`/`service-install-plan`, `windows-service-status`, `windows-service-reconcile`, `windows-service-execution-readiness`, and `windows-service-start`/`stop` now record service lifecycle receipts through the same local Verse; the read-only status path has been proved against the real Windows `EventLog` service with receipt `daemon-service-lifecycle-receipt-windows-eventlog-proof-windows-service-status`, status `running`, exit code `0`, and `privateStateExposed=false`; the read-only service-policy reconciliation path has been proved for missing service, real-service drift against `EventLog`, lifecycle-brake refusal, and wrapper/local-Verse receipt `daemon-service-lifecycle-receipt-windows-eventlog-reconcile-proof-windows-service-reconcile`; execution readiness has been proved as a non-mutating `not-elevated` receipt through direct and wrapper paths; start/stop now produce non-mutating `start-planned`/`stop-planned` receipts unless `--execute-control`/`--execute-service-control` is passed, and wrapper `service-start-plan`/`service-stop-plan` proves those receipts against `EventLog`; explicit install/control execution now refuses as `execution-refused-not-elevated` with `executed=false` when the shell lacks Windows administrator authority, and wrapper `service-install-execute`, `service-start-execute`, and `service-stop-execute` prove those refusal receipts without mutation. Service lifecycle actions check the local Verse swarm brake before process launch, artifact writes, service-manager queries, service-policy reconciliation, execution-readiness checks, control planning, elevation-gated execution, or start/stop execution. The local wrapper builds/checks this binary. - - Use `notes/epiphany-repo-swarm-mvp-contract.md` as the authority correction and migration plan for repo-swarm autonomy. Autonomous branch-local work inside an Epiphany-owned repo Body is in scope and desired; the safety boundary is typed authority, branch containment, interruptibility, receipts, private-state sealing, and Bifrost-gated publication/merge/escalation, not asking a human before every local edit. Ten native repo-swarm front doors are live and documented there: `epiphany-repo init`, `epiphany-swarm online`, `epiphany-work accept`, `epiphany-work plan`, `epiphany-work run`, `epiphany-work adopt --from-plan`, `epiphany-work execute --from-plan`, `epiphany-work tick`, `epiphany-work publish`, and `epiphany-work sync`. Fresh-repo smokes proved the chain with `privateStateExposed=false`, including plan-backed branch-local commit creation, a Self-owned tick pulse that advances `run-from-plan -> adopt-from-plan -> execute-from-plan` then no-ops before Soul/Mind/Bifrost gates, local CultMesh swarm-brake refusal that writes `refused-by-swarm-brake` without creating a run/adopt/execute receipt, active-turn refusal through `work-tick-active-.json`, explicit completion-anchored cooldown refusal through `work-tick-last-.json`, stale active-turn recovery that records `physiology.recoveredActiveTurn.recovered=true`, Self-owned `epiphany-work serve` cadence that writes `work-scheduler-serve-.json`, bounded serve proof `advanced:run-from-plan -> refused-by-cooldown:none` without adoption, unbounded zero-interval refusal, and upstream-main ancestry proof after explicit merge receipt. Remaining MVP organs are Persona-to-plan automation, Soul/Modeling/Mind closure after Hands commits, compact repo work overview, and operator-safe proof bundles; the scheduler may advance only one safe receipt-backed branch-local step per pulse and must not publish, merge, mutate services, cross repo boundaries, expose private state, or impersonate Idunn. + - Use `notes/epiphany-repo-swarm-mvp-contract.md` as the authority correction and migration plan for repo-swarm autonomy. Autonomous branch-local work inside an Epiphany-owned repo Body is in scope and desired; the safety boundary is typed authority, branch containment, interruptibility, receipts, private-state sealing, and Bifrost-gated publication/merge/escalation, not asking a human before every local edit. Eleven native repo-swarm front doors are live and documented there: `epiphany-repo init`, `epiphany-swarm online`, `epiphany-work accept`, `epiphany-work plan`, `epiphany-work run`, `epiphany-work adopt --from-plan`, `epiphany-work execute --from-plan`, `epiphany-work close`, `epiphany-work tick`, `epiphany-work publish`, and `epiphany-work sync`. Fresh-repo smokes proved the chain with `privateStateExposed=false`, including plan-backed branch-local commit creation, a Self-owned tick pulse that advances `run-from-plan -> adopt-from-plan -> execute-from-plan` then no-ops before closure/publication gates, local CultMesh swarm-brake refusal that writes `refused-by-swarm-brake` without creating a run/adopt/execute receipt, active-turn refusal through `work-tick-active-.json`, explicit completion-anchored cooldown refusal through `work-tick-last-.json`, stale active-turn recovery that records `physiology.recoveredActiveTurn.recovered=true`, Self-owned `epiphany-work serve` cadence that writes `work-scheduler-serve-.json`, bounded serve proof `advanced:run-from-plan -> refused-by-cooldown:none` without adoption, unbounded zero-interval refusal, deterministic `epiphany-work close` proof that consumes execute receipts, verifies the Hands commit, writes Soul verdict plus Modeling summary plus Mind gateway/state-commit receipts, `publish --closure-receipt` consumption of the close receipt's Soul/Mind refs, post-publication tick `noop:none`, and upstream-main ancestry proof after explicit merge receipt. Remaining MVP organs are Persona-to-plan automation, compact repo work overview, operator-safe proof bundles, optional execute-to-close scheduler handoff, and richer model-authored closure; the scheduler may advance only one safe receipt-backed branch-local step per pulse and must not publish, merge, mutate services, cross repo boundaries, expose private state, or impersonate Idunn. - Agent memory lifecycle now has a first typed v0 operation surface in `epiphany-core::agent_memory`: `AgentMemoryLifecycleOperation` can revise, retire, crystallize, prune, and merge bounded memory records after role/agent review, and `epiphany-agent-memory-store review-lifecycle|apply-lifecycle` exposes the path at the operator edge. This closes the first explicit lifecycle-operation slice from the swarm-readiness gate; it does not yet make sleep silently mutate identity or project truth. - Persona public speech now has a parent-side eligibility receipt at the Discord/Aquarium mouth edge. `epiphany.persona_speech_audit.v0` records action kind, content fingerprint, opening/topic keys, recent-window counts, repeated opening/topic counts, channel saturation, and allow/block reasons. `epiphany-persona-discord post` blocks repeated public openings before token/webhook work; draft and bubble still emit audit receipts for operator inspection. The compatibility JSON artifact remains for display, but the durable witness is now `epiphany.cultmesh.persona_speech_audit.v0` in CultMesh with latest-key projection through local Verse context. Local MVP Persona bubbles now write that durable witness to `.epiphany-run/cultmesh/local-verse.ccmp`, not a separate mouth-side store. This is posting-edge policy, not a Persona prompt wish. - Grow the VoidBot repo-Persona pattern into Epiphany's product direction: each Epiphany owns one or more repos, has one or more Personas, and exposes project-native conversation through Aquarium, Discord, voice/WebRTC, stream surfaces, CLI, and CultNet clients so humans can talk to projects instead of pre-authoring complete implementation briefs. Persona is special because Imagination acts as Projector, turning typed state into narrative context before the Persona thinks, and Mind acts as Interpreter, turning natural Persona output into reviewed state/side-effect intents after the Persona thinks. @@ -633,4 +633,4 @@ 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. - next_action: Continue repo-swarm MVP work from the documented ten-front-door chain. Next connect branch-local `epiphany-work execute` receipts to Soul/Modeling/Mind closure, then build Persona-to-plan automation so plan packets are model/Imagination-authored rather than operator-authored. Preserve Idunn service lifecycle surfaces and existing CultMesh/Odin/Eve tool directories; service install/start execution still requires explicit elevated operator authority. + next_action: Continue repo-swarm MVP work from the documented eleven-front-door chain. Next build Persona-to-plan automation so Persona/Bifrost candidate action pressure becomes model/Imagination-authored plan packets rather than operator-authored shell details. Preserve Idunn service lifecycle surfaces and existing CultMesh/Odin/Eve tool directories; service install/start execution still requires explicit elevated operator authority.