From 011d1bdf530d9d2ea1e92c6621a37a17c5d53732 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 21 Jun 2026 01:49:47 +0100 Subject: [PATCH] Add repo work service audit closure --- .../src/bin/epiphany-daemon-supervisor.rs | 205 +++++++++++++++++- ...phany-repo-work-service-lifecycle-smoke.rs | 121 ++++++++--- notes/epiphany-repo-swarm-mvp-contract.md | 69 +++--- notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 360907 -> 361433 bytes state/map.yaml | 3 +- tools/epiphany_local_run.ps1 | 31 ++- 7 files changed, 360 insertions(+), 70 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-daemon-supervisor.rs b/epiphany-core/src/bin/epiphany-daemon-supervisor.rs index a8d275b1..fcfbab82 100644 --- a/epiphany-core/src/bin/epiphany-daemon-supervisor.rs +++ b/epiphany-core/src/bin/epiphany-daemon-supervisor.rs @@ -32,7 +32,7 @@ use sha2::Digest; use sha2::Sha256; use std::env; use std::fs; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::process::Command; use std::process::Stdio; @@ -48,6 +48,9 @@ fn main() -> Result<()> { "service-plan" | "install-service" => service_plan(args), "service-launch" | "launch-service" | "start-service" => service_launch(args), "service-runbook" | "runbook-service" => service_runbook(args), + "repo-work-service-audit" + | "repo-work-service-readiness" + | "repo-work-queue-runner-audit" => repo_work_service_audit(args), "cluster-service-runbook" | "cluster-daemon-runbook" => cluster_daemon_runbook(args), "cluster-windows-service-install" | "cluster-service-install-plan" @@ -98,7 +101,7 @@ fn main() -> Result<()> { "windows-service-stop" | "service-stop" => windows_service_control(args, "stop"), "policy" | "write-policy" => write_policy(args), other => anyhow::bail!( - "unknown command {other:?}; use reconcile, tick, serve, service-plan, service-launch, service-runbook, cluster-service-runbook, cluster-service-install-plan, cluster-service-audit, cluster-service-start, cluster-service-stop, cluster-service-execution-readiness, cluster-service-execution-runbook, cluster-service-execution-audit, windows-service-install, windows-service-execution-readiness, windows-service-execution-runbook, windows-service-execution-audit, service-execution-audit-smoke, windows-service-reconcile, windows-service-status, windows-service-start, windows-service-stop, or policy" + "unknown command {other:?}; use reconcile, tick, serve, service-plan, service-launch, service-runbook, repo-work-service-audit, cluster-service-runbook, cluster-service-install-plan, cluster-service-audit, cluster-service-start, cluster-service-stop, cluster-service-execution-readiness, cluster-service-execution-runbook, cluster-service-execution-audit, windows-service-install, windows-service-execution-readiness, windows-service-execution-runbook, windows-service-execution-audit, service-execution-audit-smoke, windows-service-reconcile, windows-service-status, windows-service-start, windows-service-stop, or policy" ), } } @@ -343,6 +346,201 @@ fn service_runbook(args: Args) -> Result<()> { Ok(()) } +fn repo_work_service_audit(args: Args) -> Result<()> { + seed_epiphany_local_verse_context( + &args.store, + args.runtime_id.clone(), + Utc::now().to_rfc3339(), + )?; + let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; + assert_swarm_brake_allows_service_lifecycle(&context)?; + let started_at = Utc::now(); + let receipts = load_epiphany_cultmesh_daemon_service_lifecycle_receipts( + &args.store, + &args.runtime_id, + )?; + let service_receipts = receipts + .iter() + .filter(|receipt| receipt.service_id == args.service_id) + .collect::>(); + let plan = latest_service_lifecycle_receipt(&service_receipts, "install-plan"); + let runbook = latest_service_lifecycle_receipt(&service_receipts, "runbook"); + let launch = latest_service_lifecycle_receipt(&service_receipts, "launch"); + + let mut missing_checks = Vec::new(); + let mut failed_checks = Vec::new(); + + let plan_status = receipt_status_or_missing(plan); + if plan.is_none() { + missing_checks.push("install-plan".to_string()); + } else if plan_status != "planned" { + failed_checks.push(format!("install-plan status {plan_status}")); + } + + let runbook_status = receipt_status_or_missing(runbook); + if runbook.is_none() { + missing_checks.push("runbook".to_string()); + } else if runbook_status != "written" { + failed_checks.push(format!("runbook status {runbook_status}")); + } + let runbook_ref = runbook + .map(|receipt| receipt.operator_artifact_ref.as_str()) + .unwrap_or("none"); + let runbook_artifact_status = service_artifact_status(runbook_ref); + let runbook_sha256 = local_file_sha256(runbook_ref).unwrap_or_else(|| "none".to_string()); + if runbook.is_some() && runbook_artifact_status != "present" { + failed_checks.push(format!("runbook artifact {runbook_artifact_status}")); + } + + let launch_status = receipt_status_or_missing(launch); + let launch_exit_code = launch.and_then(|receipt| receipt.exit_code); + if launch.is_none() { + missing_checks.push("launch".to_string()); + } else { + if launch_status != "completed" { + failed_checks.push(format!("launch status {launch_status}")); + } + if launch_exit_code != Some(0) { + failed_checks.push(format!( + "launch exit code {}", + launch_exit_code + .map(|code| code.to_string()) + .unwrap_or_else(|| "none".to_string()) + )); + } + } + + let private_state_exposed = service_receipts + .iter() + .any(|receipt| receipt.private_state_exposed); + if private_state_exposed { + failed_checks.push("private state exposed".to_string()); + } + + let status = if missing_checks.is_empty() && failed_checks.is_empty() { + "complete" + } else { + "incomplete" + }; + let next_safe_move = if missing_checks.iter().any(|check| check == "install-plan") + || failed_checks + .iter() + .any(|check| check.starts_with("install-plan ")) + { + "tools/epiphany_local_run.ps1 -Mode repo-work-service-plan" + } else if missing_checks.iter().any(|check| check == "runbook") + || failed_checks.iter().any(|check| check.starts_with("runbook ")) + { + "tools/epiphany_local_run.ps1 -Mode repo-work-service-runbook" + } else if missing_checks.iter().any(|check| check == "launch") + || failed_checks.iter().any(|check| check.starts_with("launch ")) + { + "tools/epiphany_local_run.ps1 -Mode repo-work-service-launch" + } else { + "continue repo-swarm MVP planner/interpreter hardening" + }; + + let receipt = service_lifecycle_receipt( + &args, + "repo-work-service-audit", + status, + "repo-work-service-audit".to_string(), + vec![ + format!("plan={plan_status}"), + format!("runbook={runbook_status}"), + format!("runbookArtifact={runbook_artifact_status}"), + format!("launch={launch_status}"), + format!( + "launchExitCode={}", + launch_exit_code + .map(|code| code.to_string()) + .unwrap_or_else(|| "none".to_string()) + ), + format!("missing={}", missing_checks.len()), + format!("failed={}", failed_checks.len()), + ], + None, + None, + started_at, + Some(Utc::now()), + Some(format!( + "service://{}/repo-work-service-audit", + sanitize_id(&args.service_id) + )), + ); + let written = write_epiphany_cultmesh_daemon_service_lifecycle_receipt( + &args.store, + args.runtime_id.clone(), + receipt, + )?; + println!( + "{}", + serde_json::to_string_pretty(&json!({ + "schemaVersion": "epiphany.repo_work_service_audit.v0", + "status": status, + "store": args.store, + "runtimeId": args.runtime_id, + "serviceId": written.service_id, + "schedulerId": written.scheduler_id, + "receiptId": written.receipt_id, + "planStatus": plan_status, + "runbookStatus": runbook_status, + "runbookArtifactStatus": runbook_artifact_status, + "runbookArtifactRef": runbook_ref, + "runbookSha256": runbook_sha256, + "launchStatus": launch_status, + "launchExitCode": launch_exit_code, + "missingChecks": missing_checks, + "failedChecks": failed_checks, + "lifecycleOwner": "Idunn", + "hostedBody": "repo-work", + "mutatesServiceManager": false, + "requiresElevatedAuthority": false, + "privateStateExposed": private_state_exposed, + "nextSafeMove": next_safe_move, + }))? + ); + Ok(()) +} + +fn latest_service_lifecycle_receipt<'a>( + receipts: &'a [&EpiphanyCultMeshDaemonServiceLifecycleReceiptEntry], + action: &str, +) -> Option<&'a EpiphanyCultMeshDaemonServiceLifecycleReceiptEntry> { + receipts + .iter() + .copied() + .filter(|receipt| receipt.action == action) + .max_by_key(|receipt| { + receipt + .completed_at_utc + .as_deref() + .unwrap_or(&receipt.started_at_utc) + }) +} + +fn receipt_status_or_missing( + receipt: Option<&EpiphanyCultMeshDaemonServiceLifecycleReceiptEntry>, +) -> String { + receipt + .map(|receipt| receipt.status.clone()) + .unwrap_or_else(|| "missing".to_string()) +} + +fn service_artifact_status(artifact_ref: &str) -> &'static str { + if artifact_ref.trim().is_empty() || artifact_ref == "none" { + return "none"; + } + let path = Path::new(artifact_ref); + if path.is_file() { + return "present"; + } + if artifact_ref.contains("://") { + return "external-ref"; + } + "missing" +} + fn cluster_daemon_runbook(args: Args) -> Result<()> { seed_epiphany_local_verse_context( &args.store, @@ -3171,6 +3369,9 @@ impl Args { | "start-service" | "service-runbook" | "runbook-service" + | "repo-work-service-audit" + | "repo-work-service-readiness" + | "repo-work-queue-runner-audit" | "cluster-service-runbook" | "cluster-daemon-runbook" | "cluster-windows-service-install" diff --git a/epiphany-core/src/bin/epiphany-repo-work-service-lifecycle-smoke.rs b/epiphany-core/src/bin/epiphany-repo-work-service-lifecycle-smoke.rs index f2e69859..86d4838b 100644 --- a/epiphany-core/src/bin/epiphany-repo-work-service-lifecycle-smoke.rs +++ b/epiphany-core/src/bin/epiphany-repo-work-service-lifecycle-smoke.rs @@ -195,38 +195,9 @@ fn run_smoke(args: Args) -> Result { ], &service_args, )?; - - require_eq(&plan, &["status"], "planned")?; - require_eq(&runbook, &["status"], "written")?; - require_eq(&launch, &["status"], "completed")?; - require_eq(&plan, &["serviceId"], service_id)?; - require_eq(&runbook, &["serviceId"], service_id)?; - require_eq(&launch, &["serviceId"], service_id)?; - require_bool(&plan, &["privateStateExposed"], false)?; - require_bool(&runbook, &["privateStateExposed"], false)?; - require_bool(&launch, &["privateStateExposed"], false)?; - require_i64(&launch, &["exitCode"], 0)?; - require_text_array_contains(&plan, &["args"], "queue-run")?; - require_text_array_contains(&plan, &["args"], "--dry-run")?; - require_text_array_contains(&plan, &["args"], path_str(&repo)?)?; - require_text_array_contains(&runbook, &["args"], "queue-run")?; - require_text_array_contains(&runbook, &["args"], "--dry-run")?; - - let runbook_text = fs::read_to_string(&runbook_path) - .with_context(|| format!("failed to read {}", runbook_path.display()))?; - require_text( - &runbook_text, - "Generated by epiphany-daemon-supervisor service-runbook", - )?; - require_text(&runbook_text, "Start-Process")?; - require_text(&runbook_text, "-WindowStyle Hidden")?; - require_text(&runbook_text, "queue-run")?; - require_text(&runbook_text, "--dry-run")?; - let runbook_sha256 = sha256_file(&runbook_path)?; - - let receipts = receipt_directory(&manifest, &root, &local_verse, runtime_id)?; - let receipt_rows = rows(&receipts); - let launch_row = receipt_rows.iter().find(|row| { + let launch_receipts = receipt_directory(&manifest, &root, &local_verse, runtime_id)?; + let launch_rows = rows(&launch_receipts); + let launch_row = launch_rows.iter().find(|row| { row.get("family").and_then(Value::as_str) == Some("service-lifecycle") && row.get("serviceId").and_then(Value::as_str) == Some(service_id) && row @@ -241,6 +212,85 @@ fn run_smoke(args: Args) -> Result { }; require_eq(launch_row, &["status"], "completed")?; + let audit = daemon_supervisor( + &manifest, + &root, + &local_verse, + &[ + "repo-work-service-audit", + "--store", + path_str(&local_verse)?, + "--runtime-id", + runtime_id, + "--daemon-id", + daemon_id, + "--scheduler-id", + scheduler_id, + "--service-id", + service_id, + "--service-command", + path_str(&epiphany_work_bin)?, + "--reason", + "Idunn-owned readiness audit for Self-owned repo work queue-run pulse.", + "--cwd", + path_str(&root)?, + ], + &service_args, + )?; + + require_eq(&plan, &["status"], "planned")?; + require_eq(&runbook, &["status"], "written")?; + require_eq(&launch, &["status"], "completed")?; + require_eq(&audit, &["status"], "complete")?; + require_eq(&plan, &["serviceId"], service_id)?; + require_eq(&runbook, &["serviceId"], service_id)?; + require_eq(&launch, &["serviceId"], service_id)?; + require_eq(&audit, &["serviceId"], service_id)?; + require_bool(&plan, &["privateStateExposed"], false)?; + require_bool(&runbook, &["privateStateExposed"], false)?; + require_bool(&launch, &["privateStateExposed"], false)?; + require_bool(&audit, &["privateStateExposed"], false)?; + require_i64(&launch, &["exitCode"], 0)?; + require_i64(&audit, &["launchExitCode"], 0)?; + require_text_array_contains(&plan, &["args"], "queue-run")?; + require_text_array_contains(&plan, &["args"], "--dry-run")?; + require_text_array_contains(&plan, &["args"], path_str(&repo)?)?; + require_text_array_contains(&runbook, &["args"], "queue-run")?; + require_text_array_contains(&runbook, &["args"], "--dry-run")?; + require_eq(&audit, &["planStatus"], "planned")?; + require_eq(&audit, &["runbookStatus"], "written")?; + require_eq(&audit, &["runbookArtifactStatus"], "present")?; + require_eq(&audit, &["launchStatus"], "completed")?; + + let runbook_text = fs::read_to_string(&runbook_path) + .with_context(|| format!("failed to read {}", runbook_path.display()))?; + require_text( + &runbook_text, + "Generated by epiphany-daemon-supervisor service-runbook", + )?; + require_text(&runbook_text, "Start-Process")?; + require_text(&runbook_text, "-WindowStyle Hidden")?; + require_text(&runbook_text, "queue-run")?; + require_text(&runbook_text, "--dry-run")?; + let runbook_sha256 = sha256_file(&runbook_path)?; + + let audit_receipts = receipt_directory(&manifest, &root, &local_verse, runtime_id)?; + let audit_rows = rows(&audit_receipts); + let audit_row = audit_rows.iter().find(|row| { + row.get("family").and_then(Value::as_str) == Some("service-lifecycle") + && row.get("serviceId").and_then(Value::as_str) == Some(service_id) + && row + .get("serviceRoute") + .and_then(Value::as_str) + == Some("epiphany-repo-work-queue-runner::repo-work-service-audit") + }); + let Some(audit_row) = audit_row else { + return Err(anyhow!( + "receipt directory did not expose audit service-lifecycle row for {service_id}" + )); + }; + require_eq(audit_row, &["status"], "complete")?; + let summary = json!({ "schemaVersion": "epiphany.repo_work_service_lifecycle_smoke.v0", "status": "ok", @@ -259,6 +309,13 @@ fn run_smoke(args: Args) -> Result { "launchStatus": launch["status"], "launchReceiptId": launch["receiptId"], "launchExitCode": launch["exitCode"], + "auditStatus": audit["status"], + "auditReceiptId": audit["receiptId"], + "auditPlanStatus": audit["planStatus"], + "auditRunbookStatus": audit["runbookStatus"], + "auditRunbookArtifactStatus": audit["runbookArtifactStatus"], + "auditLaunchStatus": audit["launchStatus"], + "auditLaunchExitCode": audit["launchExitCode"], "serviceCommand": plan["command"], "serviceArgs": plan["args"], "lifecycleOwner": "Idunn", diff --git a/notes/epiphany-repo-swarm-mvp-contract.md b/notes/epiphany-repo-swarm-mvp-contract.md index 2cc7fca8..2f7dc580 100644 --- a/notes/epiphany-repo-swarm-mvp-contract.md +++ b/notes/epiphany-repo-swarm-mvp-contract.md @@ -1730,7 +1730,7 @@ temptation wearing clean robes. | Local Verse online | `epiphany-swarm online` seeds repo-local CultMesh, standing-faculty SoA, topology, liveness, Eve, and tool sight. | Keep private Verse sealed while exposing operator-safe repo status. | | Persona/Bifrost intake | `epiphany-work accept` records pressure and candidate action refs without Hands authority. `epiphany-work persona-intake` now invokes the Persona bubble speech-audit path, records public discussion and candidate-action refs, then delegates to `accept`; wrapper mode `repo-persona-intake` exposes the operator mouth. | Deepen the intake-to-Imagination interpreter so richer model-authored action items can be proposed without granting Hands, publication, or durable-state authority at the mouth edge. | | 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-planning-brief` / `repo.planning_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`, `repo-deployment-config` / `repo.deployment_config`, and `repo-deployment-request` / `repo.deployment_request`. `repo.planning_brief` is the rough-pressure decomposition family: it names candidate next safe families, requested-path / verification-ask / evidence-need requirements, and Mind/Self/Substrate/Hands/Soul/Bifrost/Idunn gates while granting no action authority; Soul closure now emits `epiphany.repo_work_safe_family_planning_readback.v0` for that family with candidate-family counts, gate/readiness flags, authority denials, and private-state seal. `adopt` writes `epiphany.repo_work_mind_adoption_decision.v0` before the main adoption receipt cites the decision and grants branch-local Hands authority, and refuses plan-derived items that lack explicit verification asks or planning evidence needs. `plan` remains manual quarantine scaffolding. | Deepen further interpreter behavior and semantic closure/map readback 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. | +| 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`, `repo-work-service-runbook`, `repo-work-service-launch`, and `repo-work-service-audit` write Idunn lifecycle receipts/artifacts for the same queue-run command and prove non-mutating launch/readiness closure. | Keep any future queue-run service install/start mutation behind Idunn and explicit elevated 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, refuses missing/tampered/non-affirmative Mind adoption proof, runs known safe-family content assertions, optionally gates on model-authored closure verdicts, can require verification output to cite declared changed paths with `--require-source-grounding`, writes Soul/Modeling/Mind receipts, admits a compact typed repo map entry into `.epiphany/state/repo-work-map.msgpack`, and mirrors that admitted fact into local Verse as `epiphany.cultmesh.repo_work_map_entry.v0`. | Keep extending closure toward source-grounded semantic review and richer semantic map lenses, 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; `close` mirrors Mind-admitted map facts as `epiphany.cultmesh.repo_work_map_entry.v0`; Gjallar enumerates overview history, map rows, family lens rows, path lens rows, branch lens rows, and public-proof rows without private-state exposure; Persona's Eve surface and Eve connection readbacks expose peer-readable gate/blocker/next-action rows; `queue-run` consumes the same overview queue for branch-local scheduler pulses. | Deepen the Persona-to-plan loop and semantic map readback without moving action authority out of Hands/Self/Bifrost. | @@ -1752,16 +1752,19 @@ Build the remaining MVP in this order: 1. **Idunn-hosted queue-run lifecycle.** Keep `epiphany-work queue-run` as the Self-owned branch-local pulse, but let Idunn publish the service plan, runbook, audit, and optional elevated installation/start path for that same - pulse. The first cut should be non-mutating plan/runbook receipts. Only the - operator may grant service mutation. Self must not become the daemon keeper. - This first cut is landed through `tools/epiphany_local_run.ps1 -Mode + pulse. The non-mutating plan/runbook/launch/audit artery is landed; only the + operator may grant service-manager mutation or elevated startup. Self must + not become the daemon keeper. This first cut is landed through + `tools/epiphany_local_run.ps1 -Mode repo-work-service-plan`, `-Mode repo-work-service-runbook`, and `-Mode - repo-work-service-launch`, and now has a native repeatable smoke at - `.epiphany-smoke\repo-work-service-lifecycle-20260621-002707` proving the - exact queue-run command vector with `--dry-run`, a written runbook receipt, - receipt-directory readback before launch, a bounded `service-launch - --wait-child` receipt with exit code 0, no service-manager mutation, no - elevation, and `privateStateExposed=false`. + repo-work-service-launch`, plus `-Mode repo-work-service-audit`. Native + smoke `.epiphany-smoke\repo-work-service-lifecycle-20260621-004202` proves + the exact queue-run command vector with `--dry-run`, a written runbook + receipt, receipt-directory readback before launch, a bounded + `service-launch --wait-child` receipt with exit code 0, then a + `repo-work-service-audit` receipt with `auditStatus=complete`, + `auditRunbookArtifactStatus=present`, no missing or failed checks, no + service-manager mutation, no elevation, and `privateStateExposed=false`. 2. **Persona-to-Imagination action items.** The first repo Persona intake mouth is landed: `epiphany-work persona-intake` routes work-shaped speech through the Persona bubble speech-audit path, records public discussion refs and @@ -1978,28 +1981,35 @@ The chain is typed and sealed enough to be useful: relies on per-pulse tick receipts, and zero-interval unbounded polling is refused. - `tools/epiphany_local_run.ps1 -Mode repo-work-service-plan`, `-Mode - repo-work-service-runbook`, and `-Mode repo-work-service-launch` are the + repo-work-service-runbook`, `-Mode repo-work-service-launch`, and `-Mode + repo-work-service-audit` are the first Idunn-hosted lifecycle artifacts for the repo-work queue pulse. They call `epiphany-daemon-supervisor service-plan` / `service-runbook` / - `service-launch --wait-child` with `--service-command ` and - explicit `--service-arg` values for `queue-run --workspace + `service-launch --wait-child` / `repo-work-service-audit` with + `--service-command ` and explicit `--service-arg` values for + `queue-run --workspace --epiphany-root --local-verse-store \.epiphany\local-verse.ccmp --runtime-id --max-items `. The receipts and runbook describe or - launch the real queue-run command, but do not install a Windows service, - publish, merge, cross repo boundaries, elevate, or expose private state. - Native smoke `.epiphany-smoke\repo-work-service-lifecycle-20260621-002707` - now proves the same Idunn plan/runbook/launch artery without wrapper trust: + launch the real queue-run command and then audit the typed lifecycle trail, + but do not install a Windows service, publish, merge, cross repo boundaries, + elevate, or expose private state. Native smoke + `.epiphany-smoke\repo-work-service-lifecycle-20260621-004202` now proves the + same Idunn plan/runbook/launch/audit artery without wrapper trust: plan status `planned`, runbook status `written`, launch status `completed`, - launch exit code `0`, service id `epiphany-repo-work-queue-runner`, + launch exit code `0`, audit status `complete`, audit runbook artifact status + `present`, service id `epiphany-repo-work-queue-runner`, runbook receipt-directory readback before launch, launch receipt-directory readback after launch, service args containing `queue-run` and `--dry-run`, runbook SHA-256 - `50c3776c7d763a67634cdcefc1b1ed17d700107958bf7c5e221f6c03ce49f2a6`, + `19af4154a19e41563a1a9e717b36e4db2a959db42892bef176c4493698d4b84a`, `lifecycleOwner=Idunn`, `hostedBody=repo-work`, `mutatesServiceManager=false`, `launchesService=true`, `waitChild=true`, `requiresElevatedAuthority=false`, and `privateStateExposed=false`. Wrapper - proof `local-20260621-012741-653-dd4fdae2` exercised - `repo-work-service-launch` and printed `status=completed`, `exitCode=0`, + proofs `local-20260621-014302-362-31bbef47`, + `local-20260621-014337-108-cbd99615`, + `local-20260621-014413-125-09e183c5`, and + `local-20260621-014558-197-f6951806` exercised plan/runbook/launch/audit; + final audit printed `status=complete`, `missing=none`, `failed=none`, `owner=Idunn`, `hostedBody=repo-work`, and `serviceManagerMutation=false`. - `epiphany-work persona-intake` is the first repo Persona mouth over accepted work pressure. It requires an online repo swarm receipt, writes a Persona @@ -2043,9 +2053,10 @@ Required organs before MVP: `epiphany-work serve` adds bounded/unbounded cadence around that pulse, and `epiphany-swarm run` plus wrapper expose the bounded repo-swarm run mouth over the typed queue. Idunn-owned non-mutating queue-run service plan/runbook - receipts also exist, and the queue/tick path now hands branch-local execution - into `close-from-execute`. Remaining work is any later Idunn service - launch/install under explicit operator authority. + receipts plus bounded launch/audit readiness receipts also exist, and the + queue/tick path now hands branch-local execution into `close-from-execute`. + Remaining Idunn service work is optional elevated install/start execution + under explicit operator authority. - Persona-to-plan depth: deterministic `append-worklog` and `planning-note` derivations exist for accepted Persona/Bifrost pressure, `persona-intake` gives the project Persona a speech-audited mouth into that @@ -2231,11 +2242,11 @@ Required organs before MVP: blocker, and `authority-gated` / Bifrost/GitHub / `awaiting-upstream-sync` for the upstream-main sync blocker. All stop packets are non-mutating, non-elevated, and private-state sealed. Native - service lifecycle plan/runbook proof for the queue-run pulse now exists at - `.epiphany-smoke\repo-work-service-lifecycle-20260620-185853`; remaining - service lifecycle work is optional elevated install/start execution proof - under explicit operator authority plus richer closure depth rather than basic - safe-family planning cargo. + service lifecycle plan/runbook/launch/audit proof for the queue-run pulse now + exists at `.epiphany-smoke\repo-work-service-lifecycle-20260621-004202`; + remaining service lifecycle work is optional elevated install/start execution + proof under explicit operator authority plus richer closure depth rather than + basic safe-family planning cargo. - Proof bundle depth: maintainers and future agents can inspect local operator-safe receipt chains, artifact schema/status rows, SHA-256 receipt hashes, compact TUI rows, commit refs, verification verdicts, map admission, diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 807ba7bc..81d4e870 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -161,6 +161,7 @@ remembers doctrine; the branch remembers the blade. - 2026-06-20: Gjallar repo-work map sight now includes per-entry semantic readback rows. `epiphany-verse-query gjallar`, swarm overview, and swarm triage expose `repoWorkMapSemanticRows` plus `REPO-WORK-MAP-SEMANTIC` rows derived from Mind-admitted local Verse map entries, combining durable modeling summary, safe family, stage owner, publication gate owner, latest commit, and Mind commit receipt for each accepted item. Focused smoke `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-234131` proves accepted `repo.markdown_planning_note` work reports `stage=imagination-planning`, `stageOwner=Imagination`, `gateOwner=Bifrost`, the durable modeling summary, `sightOnly=true`, `publicationAuthorized=false`, and `privateStateExposed=false` while counterfeit Mind adoption is still refused. This is compact meaning readback only; Gjallar still does not schedule, publish, merge, deploy, keep daemons alive, or admit Mind state. - 2026-06-21: The local wrapper mouth now forwards Rust-owned repo-work map rows for `gjallar` and `swarm-triage` from an explicit repo-local Verse target. `tools/epiphany_local_run.ps1` accepts `-LocalVerseStore` and `-LocalVerseRuntimeId`; operator run intent/receipt documents still write to the operator local Verse, while the readback modes target the requested store/runtime. Live wrapper proofs `local-20260621-011151-541-70056545` and `local-20260621-011207-755-d65e5c7e` pointed at `.epiphany-smoke\repo-planning-brief-family-20260620-235939\repo-body\.epiphany\local-verse.ccmp` with runtime `repo-planning-brief-family-smoke` and printed actual `repoWorkMapRows`, `repoWorkSemanticRows`, family/path/branch/stage/gate lens rows, and `privateStateExposed=false`. Earlier wrapper proofs that rendered `none` were aimed at the wrong operator store/runtime; PowerShell only lowers existing Rust TUI arrays and does not reinterpret repo-work truth or gain scheduler/publication/Mind/Idunn authority. - 2026-06-21: Idunn-hosted repo-work queue-run lifecycle now has bounded launch proof. `tools/epiphany_local_run.ps1 -Mode repo-work-service-launch` reuses the `epiphany-repo-work-queue-runner` service id and launches the exact `epiphany-work queue-run --workspace --local-verse-store \.epiphany\local-verse.ccmp --runtime-id --max-items ` command through `epiphany-daemon-supervisor service-launch --wait-child`; it writes an Idunn service lifecycle receipt and does not install a Windows service, elevate, publish, merge, cross repos, or expose private state. Native smoke `.epiphany-smoke\repo-work-service-lifecycle-20260621-002707` proves plan/runbook/launch with launch exit code `0`, runbook receipt-directory readback before launch, launch readback after launch, `mutatesServiceManager=false`, `launchesService=true`, `waitChild=true`, and `privateStateExposed=false`. Wrapper proof `local-20260621-012741-653-dd4fdae2` prints `status=completed`, `exitCode=0`, `owner=Idunn`, `hostedBody=repo-work`, and `serviceManagerMutation=false`. +- 2026-06-21: Idunn-hosted repo-work queue-run lifecycle now has audit/readiness closure. `epiphany-daemon-supervisor repo-work-service-audit` reads the typed service lifecycle receipts for `epiphany-repo-work-queue-runner`, requires planned install-plan, written local runbook artifact, completed launch with exit code `0`, and no private-state exposure, then writes a `repo-work-service-audit` receipt. Native smoke `.epiphany-smoke\repo-work-service-lifecycle-20260621-004202` proves plan/runbook/launch/audit with `auditStatus=complete`, `auditRunbookArtifactStatus=present`, `auditLaunchExitCode=0`, `mutatesServiceManager=false`, `requiresElevatedAuthority=false`, and `privateStateExposed=false`. Wrapper proofs `local-20260621-014302-362-31bbef47`, `local-20260621-014337-108-cbd99615`, `local-20260621-014413-125-09e183c5`, and `local-20260621-014558-197-f6951806` prove plan/runbook/launch/audit ergonomics; the final audit summary reports `missing=none`, `failed=none`, and `nextSafeMove=continue repo-swarm MVP planner/interpreter hardening`. Remaining Idunn service work is optional elevated install/start execution under explicit operator authority, not Self scheduling. - 2026-06-20: Mind now has explicit repo-work safe-family and requested-path guards before branch-local Hands authority. `adopt --from-plan` treats unsupported plan-derived safe-family labels as refused interpreter decisions, writes `epiphany.repo_work_mind_adoption_decision.v0` with `status=refused-unsupported-safe-family`, keeps `actionItemAccepted=false` and `safeFamilyRecognized=false`, grants no Hands/durable-state/service/publication/cross-body/private-state authority, and writes no normal adoption receipt. It also compares the sorted action-item `requestedPaths` against the sorted plan action `changedPaths`; mismatches write `status=refused-requested-path-mismatch`, keep `safeFamilyRecognized=true` but `requestedPathsMatchPlan=false`, point the next gate at `imagination.replan_with_matching_requested_paths`, and grant no Hands/durable-state/service/publication/cross-body/private-state authority. Focused smokes `.epiphany-smoke\repo-mind-safe-family-guard-20260620-194425` and `.epiphany-smoke\repo-mind-path-guard-20260620-194239` prove both refusal paths; earlier positive smokes `.epiphany-smoke\repo-planning-facets-20260620-190916` and `.epiphany-smoke\closure-model-gate-20260620-190916` prove recognized planning facets and closure model gates still pass. Current remaining repo-swarm MVP organs are deeper interpreter semantics beyond adoption refusal, more useful repo-owned configuration/action families, richer closure depth, and Idunn-owned queue-run service lifecycle under explicit operator authority. - 2026-06-20: Mind now also refuses plan-derived repo work that is not evidence-ready. `derive-plan` embeds verification asks in the Imagination action-item receipt, `adopt --from-plan` records verification asks and planning evidence needs in `epiphany.repo_work_mind_interpretation.v0`, and empty verification asks or evidence needs write `status=refused-missing-evidence-needs` with next gate `imagination.replan_with_explicit_soul_evidence_needs`. The refusal grants no Hands, durable-state, service, publication, cross-body, or private-state authority and writes no adoption receipt. Focused proof `.epiphany-smoke\repo-mind-evidence-guard-20260620-224426` tampers both arrays empty and proves the refusal; regression `.epiphany-smoke\repo-planning-facets-20260620-224428` proves normal planning facets still close through Soul/Modeling/Mind. - 2026-06-20: `repo-eve-surface` is now live as repo-owned Eve/CultUI surface contract cargo. `epiphany-work derive-plan --action-family repo-eve-surface` writes `.epiphany/eve-surfaces/.toml` with safe family `repo.eve_surface`, compact agent TUI and GUI lowering contracts, local/public Verse routing, Odin discovery, provider-owned surface identity, Persona/human collaboration flags, feedback routing to Imagination, and denials for renderer ownership, rendering/state/publication/service/cross-body authority, private Verse rummaging, and private-state exposure. Soul closure assertions inspect schema, family, summary, surface routing, Verse routing, CultUI contracts, collaboration route, authority seals, and private-state seal. Focused smoke `.epiphany-smoke\repo-eve-surface-family-20260620-165927` ran init -> online -> accept -> repo-eve-surface derive-plan -> tick run/adopt/execute/close; Hands committed only `.epiphany/eve-surfaces/repo-eve-surface-family.toml`, Soul passed with `pathScopeMatched=true`, `familyAssertions.status=passed`, `hasCultUiContracts=true`, `hasVerseRouting=true`, `odinDiscoverable=true`, `feedbackRoutesToImagination=true`, `rendererOwnsTruth=false`, `renderingAuthority=false`, `stateAuthority=false`, `publicationAuthority=false`, `serviceLifecycleAuthority=false`, `crossBodyMutationAuthority=false`, `privateVerseRummaging=false`, and `privateStateExposed=false`. Current remaining repo-swarm MVP organs are deeper interpreter/adoption semantics, more useful repo-owned configuration/action families, and Idunn-owned queue-run service lifecycle under explicit operator authority. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index c94fa6d2de35cf56858374c62edb9a28a3b4d962..e848675e3221b62a1eb1d5e1fffe4a07c5cf45a8 100644 GIT binary patch delta 375 zcmZvXF;Buk0EI2|B8E*25u@=4lL?pJwb#<(!+|Q6Lr)9 zu(S__pZ14bX?3uzb~gY}U&o+UA_!w@VpBcd=x}W2lTZtr$Z~Q>5b!Q-8IcVA2<4W8 zoqxq@A%a~L2F&vuVlPoBu@EtBggs7ND_o}7wu^|@LS4tRiHjWy<3tWQj3ZwdNhSg* z&yC2>MA$PHe@6YZ2NyMz7jeW>uKY%^vK1$Mz(v}G3mx*S{5@_$A=Uh+SX18}0Paq} F-Y-xSZ+HLz delta 53 zcmccFE_S+EY=Z