From 11036618a1bb53905a6c475a72108f353b34b0dd Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 20 Jun 2026 01:51:45 +0100 Subject: [PATCH] Add repo work queue run surface --- epiphany-core/src/bin/epiphany-work.rs | 284 +++++++++++++++++++++- notes/epiphany-repo-swarm-mvp-contract.md | 33 ++- notes/fresh-workspace-handoff.md | 4 +- state/ledgers.msgpack | Bin 309389 -> 310075 bytes state/map.yaml | 6 +- tools/epiphany_local_run.ps1 | 47 +++- 6 files changed, 357 insertions(+), 17 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-work.rs b/epiphany-core/src/bin/epiphany-work.rs index e504fda1..66b39046 100644 --- a/epiphany-core/src/bin/epiphany-work.rs +++ b/epiphany-core/src/bin/epiphany-work.rs @@ -26,7 +26,9 @@ use epiphany_core::hands_commit_receipt_for_review; 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_repo_work_overviews; use epiphany_core::load_epiphany_cultmesh_swarm_brake; +use epiphany_core::load_latest_epiphany_cultmesh_repo_work_overview; use epiphany_core::mind_state_commit_receipt; use epiphany_core::put_hands_action_intent; use epiphany_core::put_hands_action_review; @@ -71,6 +73,9 @@ fn main() -> Result<()> { "sync" | "sync-main" => run_sync(parse_sync_args(args)?), "overview" | "proof-bundle" | "status" => run_overview(parse_overview_args(args)?), "tick" | "pulse" | "schedule" => run_tick(parse_tick_args(args)?), + "queue-run" | "run-queue" | "queue-tick" | "scheduler-run" => { + run_queue(parse_queue_args(args)?) + } "serve" | "loop" | "daemon" => run_serve(parse_serve_args(args)?), other => Err(anyhow!("unknown epiphany-work command {other:?}")), }?; @@ -247,6 +252,20 @@ struct TickArgs { dry_run: bool, } +#[derive(Clone, Debug)] +struct QueueArgs { + workspace: PathBuf, + epiphany_root: PathBuf, + local_verse_store: Option, + artifact_dir: Option, + runtime_store: Option, + runtime_id: String, + max_items: u64, + cooldown_seconds: u64, + active_timeout_seconds: u64, + dry_run: bool, +} + #[derive(Clone, Debug)] struct ServeArgs { tick: TickArgs, @@ -950,6 +969,55 @@ fn parse_serve_args(args: impl Iterator) -> Result { }) } +fn parse_queue_args(args: impl Iterator) -> Result { + let mut workspace = None; + let mut epiphany_root = None; + let mut local_verse_store = None; + let mut artifact_dir = None; + let mut runtime_store = None; + let mut runtime_id = "repo-swarm-local".to_string(); + let mut max_items = 1_u64; + let mut cooldown_seconds = 0_u64; + let mut active_timeout_seconds = 900_u64; + let mut dry_run = false; + + let mut args = args.peekable(); + while let Some(arg) = args.next() { + match arg.as_str() { + "--workspace" => workspace = Some(take_path(&mut args, "--workspace")?), + "--epiphany-root" => epiphany_root = Some(take_path(&mut args, "--epiphany-root")?), + "--local-verse-store" | "--store" => { + local_verse_store = Some(take_path(&mut args, "--local-verse-store")?); + } + "--artifact-dir" => artifact_dir = Some(take_path(&mut args, "--artifact-dir")?), + "--runtime-store" => runtime_store = Some(take_path(&mut args, "--runtime-store")?), + "--runtime-id" => runtime_id = take_string(&mut args, "--runtime-id")?, + "--max-items" => max_items = take_u64(&mut args, "--max-items")?, + "--cooldown-seconds" => { + cooldown_seconds = take_u64(&mut args, "--cooldown-seconds")?; + } + "--active-timeout-seconds" => { + active_timeout_seconds = take_u64(&mut args, "--active-timeout-seconds")?; + } + "--dry-run" | "--no-execute" => dry_run = true, + other => return Err(anyhow!("unexpected queue-run argument {other:?}")), + } + } + Ok(QueueArgs { + workspace: workspace.context("missing --workspace")?, + epiphany_root: epiphany_root + .unwrap_or(env::current_dir().context("failed to resolve current directory")?), + local_verse_store, + artifact_dir, + runtime_store, + runtime_id, + max_items, + cooldown_seconds, + active_timeout_seconds, + dry_run, + }) +} + fn run_accept(args: AcceptArgs) -> Result { let workspace = args .workspace @@ -2941,6 +3009,147 @@ fn run_serve(args: ServeArgs) -> Result { })) } +fn run_queue(args: QueueArgs) -> Result { + if args.max_items == 0 { + return Err(anyhow!("queue-run requires --max-items greater than 0")); + } + + let workspace = args + .workspace + .canonicalize() + .with_context(|| format!("failed to resolve {}", args.workspace.display()))?; + ensure_git_repo(&workspace)?; + let local_verse_store = args + .local_verse_store + .clone() + .unwrap_or_else(|| workspace.join(".epiphany").join("local-verse.ccmp")); + if !local_verse_store.exists() { + return Err(anyhow!( + "repo-work queue-run requires a local Verse store at {}; run epiphany-swarm online and epiphany-work overview first, or pass --local-verse-store", + local_verse_store.display() + )); + } + let artifact_dir = args + .artifact_dir + .clone() + .unwrap_or_else(|| workspace.join(".epiphany").join("work")); + fs::create_dir_all(&artifact_dir) + .with_context(|| format!("failed to create {}", artifact_dir.display()))?; + + let (latest_repo_work_overview, repo_work_overviews) = + load_repo_work_overview_queue_from_store(&local_verse_store, &args.runtime_id)?; + let selected = repo_work_overviews + .iter() + .filter(|overview| overview_workspace_matches(overview, &workspace)) + .filter(|overview| repo_work_gate_is_tick_actionable(&overview.current_gate)) + .take(args.max_items as usize) + .cloned() + .collect::>(); + let queue_rows = repo_work_queue_selection_rows(&repo_work_overviews, &workspace); + let selected_rows = repo_work_queue_selection_rows(&selected, &workspace); + + let started_at = Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true); + let mut outputs = Vec::new(); + for overview in &selected { + let tick_output = run_tick(TickArgs { + workspace: workspace.clone(), + epiphany_root: args.epiphany_root.clone(), + item: Some(overview.item.clone()), + local_verse_store: Some(local_verse_store.clone()), + artifact_dir: Some(artifact_dir.clone()), + runtime_store: args.runtime_store.clone(), + cooldown_seconds: args.cooldown_seconds, + active_timeout_seconds: args.active_timeout_seconds, + dry_run: args.dry_run, + })?; + let refreshed_overview = if args.dry_run { + Value::Null + } else { + run_overview(OverviewArgs { + workspace: workspace.clone(), + item: Some(overview.item.clone()), + accept_receipt: None, + artifact_dir: Some(artifact_dir.clone()), + write_receipt: true, + })? + }; + outputs.push(json!({ + "item": overview.item, + "overviewId": overview.overview_id, + "gateBefore": overview.current_gate, + "blockerBefore": overview.blocker, + "tick": tick_output, + "refreshedOverview": refreshed_overview + })); + } + + let status = if selected.is_empty() { + "blocked-or-noop" + } else if args.dry_run { + "would-advance" + } else { + "advanced" + }; + let next_safe_move = if selected.is_empty() { + "No tick-actionable repo-work queue rows were found; inspect queue rows for plan, closure, publication, or sync gates." + } else if args.dry_run { + "Rerun queue-run without --dry-run to pulse the selected repo-work items." + } else { + "Inspect refreshed repo-work overview rows, then continue queue-run only while branch-local gates remain tick-actionable." + }; + let completed_at = Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true); + let receipt_path = artifact_dir.join("work-queue-run.json"); + let receipt = json!({ + "schemaVersion": "epiphany.repo_work_queue_run_receipt.v0", + "createdAt": completed_at, + "startedAt": started_at, + "completedAt": completed_at, + "status": status, + "workspace": workspace, + "localVerseStore": local_verse_store, + "runtimeId": args.runtime_id, + "latestRepoWorkOverview": latest_repo_work_overview.as_ref().map(|overview| overview.overview_id.clone()), + "queueCount": repo_work_overviews.len(), + "actionableCount": selected.len(), + "maxItems": args.max_items, + "dryRun": args.dry_run, + "queueRows": queue_rows, + "selectedRows": selected_rows, + "outputs": outputs, + "authority": { + "owner": "Self", + "selectionOnly": false, + "delegatesActuationTo": "epiphany.repo_work_scheduler_tick", + "branchLocalOnly": true, + "publicationAuthorized": false, + "mergeAuthorized": false, + "serviceLifecycleAuthorized": false, + "crossRepoMutationAuthorized": false, + "privateStateExposed": false + }, + "nextSafeMove": next_safe_move, + "privateStateExposed": false + }); + write_json(&receipt_path, &receipt)?; + Ok(json!({ + "schemaVersion": "epiphany.repo_work_queue_run.v0", + "status": receipt["status"], + "workspace": receipt["workspace"], + "localVerseStore": receipt["localVerseStore"], + "runtimeId": receipt["runtimeId"], + "queueCount": receipt["queueCount"], + "actionableCount": receipt["actionableCount"], + "maxItems": receipt["maxItems"], + "dryRun": receipt["dryRun"], + "receiptPath": receipt_path, + "selectedRows": receipt["selectedRows"], + "outputs": receipt["outputs"], + "authority": receipt["authority"], + "privateStateExposed": false, + "nextSafeMove": receipt["nextSafeMove"], + })) +} + fn run_tick(args: TickArgs) -> Result { let workspace = args .workspace @@ -3711,6 +3920,76 @@ fn repo_work_overview_gate( } } +fn load_repo_work_overview_queue_from_store( + store: &Path, + runtime_id: &str, +) -> Result<( + Option, + Vec, +)> { + let latest = load_latest_epiphany_cultmesh_repo_work_overview(store, runtime_id.to_string())?; + let mut overviews = load_epiphany_cultmesh_repo_work_overviews(store, runtime_id.to_string())?; + if let Some(latest_overview) = latest.as_ref() { + if !overviews + .iter() + .any(|overview| overview.overview_id == latest_overview.overview_id) + { + overviews.push(latest_overview.clone()); + overviews.sort_by(|a, b| { + b.generated_at + .cmp(&a.generated_at) + .then_with(|| a.overview_id.cmp(&b.overview_id)) + }); + } + } + Ok((latest, overviews)) +} + +fn repo_work_gate_is_tick_actionable(gate: &str) -> bool { + matches!(gate, "ready-to-run" | "ready-to-adopt" | "ready-to-execute") +} + +fn overview_workspace_matches( + overview: &EpiphanyCultMeshRepoWorkOverviewEntry, + workspace: &Path, +) -> bool { + let overview_path = PathBuf::from(&overview.workspace); + overview_path + .canonicalize() + .map(|path| path == workspace) + .unwrap_or_else(|_| { + normalize_path_text(&overview.workspace) + == normalize_path_text(&workspace.display().to_string()) + }) +} + +fn normalize_path_text(value: &str) -> String { + value.replace('\\', "/").to_ascii_lowercase() +} + +fn repo_work_queue_selection_rows( + overviews: &[EpiphanyCultMeshRepoWorkOverviewEntry], + workspace: &Path, +) -> Vec { + overviews + .iter() + .map(|overview| { + let workspace_match = overview_workspace_matches(overview, workspace); + let tick_actionable = repo_work_gate_is_tick_actionable(&overview.current_gate); + format!( + "QUEUE-RUN | item={} | gate={} | blocker={} | actionable={} | workspaceMatch={} | next={} | private={}", + overview.item, + overview.current_gate, + overview.blocker, + tick_actionable, + workspace_match, + overview.next_safe_move, + overview.private_state_exposed + ) + }) + .collect() +} + fn latest_receipt_in(work_dir: &Path, prefix: &str) -> Option { let mut candidates = Vec::new(); if work_dir.exists() { @@ -4092,7 +4371,7 @@ fn sanitize(value: &str) -> String { fn print_usage() { eprintln!( - "usage: epiphany-work ...\n\ + "usage: epiphany-work ...\n\ accept --workspace --from --item [--summary ] [--topic ] [--store ] [--runtime-id ] [--online-receipt ] [--public-discussion-ref ] [--candidate-action-ref ]\n\ derive-plan --workspace [--item ] [--accept-receipt ] [--target-path EPIPHANY_WORKLOG.md] [--model-ref ]\n\ plan --workspace [--item ] --objective --plan-summary --command --changed-path --commit-message [--adoption-evidence-ref ]\n\ @@ -4103,6 +4382,7 @@ fn print_usage() { publish --workspace [--item ] --change-summary --justification --verification-receipt --review-receipt --ledger-entry-id --pull-request-url --pull-request-title \n\ sync --workspace [--item ] [--publish-receipt ] [--upstream-ref origin/main] --merge-receipt \n\ overview --workspace [--item ] [--accept-receipt ] [--no-write]\n\ - tick --workspace [--item ] [--local-verse-store ] [--runtime-store ] [--dry-run]" + tick --workspace [--item ] [--local-verse-store ] [--runtime-store ] [--dry-run]\n\ + queue-run --workspace [--local-verse-store ] [--runtime-id repo-swarm-local] [--max-items 1] [--dry-run]" ); } diff --git a/notes/epiphany-repo-swarm-mvp-contract.md b/notes/epiphany-repo-swarm-mvp-contract.md index e0ca7a3e..dcd57b16 100644 --- a/notes/epiphany-repo-swarm-mvp-contract.md +++ b/notes/epiphany-repo-swarm-mvp-contract.md @@ -678,6 +678,22 @@ globally invokable Persona `eve-connect` daemon tool embeds the queue in its items through `eve-surfaces`, `connect-eve`, and `invoke-tool`, with no mutation, elevation, or private-state exposure. +The first runnable queue surface is now native too. `epiphany-work queue-run` +reads the typed `epiphany.cultmesh.repo_work_overview.v0` queue from the +repo-local Verse, selects only tick-actionable rows (`ready-to-run`, +`ready-to-adopt`, `ready-to-execute`) for the current repo Body, delegates each +selected item to the existing Self-owned `tick` artery, and refreshes the +overview after a real advancement. It writes +`epiphany.repo_work_queue_run_receipt.v0` as `work-queue-run.json`; it does not +publish, merge, close, install services, mutate another repo, or inspect private +worker thought. `tools/epiphany_local_run.ps1 -Mode repo-work-queue-run` is the +operator wrapper over the same surface. Proofs: +`.epiphany-smoke\queue-run-20260620-014314` selected item `first` from a +two-item queue, advanced `run-from-plan`, refreshed its gate to +`ready-to-adopt`, and left blocked item `second` at `awaiting-plan`; wrapper +artifact `local-20260620-014627-174-aada0241` dry-ran the next selected step as +`adopt-from-plan` with `privateStateExposed=false`. + ## Migration Implication The next migration plan must treat autonomous branch-local work as a required @@ -754,10 +770,10 @@ 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. | Add a repo Persona intake mouth so humans can talk to the project instead of hand-authoring CLI work items. | | Imagination planning | `derive-plan` deterministically creates append-only worklog plans; `plan` remains manual quarantine scaffolding. | Replace operator-authored shell details with model-authored, typed Imagination action items for richer safe command families. | -| Self scheduling | `tick` and `serve` prove one-step branch-local advancement, brake refusal, active-turn refusal, cooldown, and stale-turn recovery. | Wire the same pulse into a usable repo-swarm run surface and optional Idunn-hosted lifecycle without taking Idunn's authority. | +| Self scheduling | `tick` and `serve` prove one-step branch-local advancement, brake refusal, active-turn refusal, cooldown, and stale-turn recovery; `queue-run` selects tick-actionable rows from the typed repo-work queue and delegates to `tick`. | Add optional Idunn-hosted lifecycle for the same queue-run surface without taking Idunn's 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 and writes deterministic Soul, Modeling, and Mind receipts. | Add richer model-authored closure where useful, 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. | Wire the queue into a usable repo-swarm run surface and richer Persona-to-plan loop without moving action authority out of Hands/Self/Bifrost. | +| 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. | | Daemon survival | Idunn service lifecycle receipts and runbooks exist outside repo-work tick authority. | Preserve Idunn as lifecycle owner; repo swarm may request or inspect service state, not impersonate daemon keeping. | @@ -883,6 +899,11 @@ The chain is typed and sealed enough to be useful: refuses under local Verse brake, refuses while an active turn is live, refuses during explicit completion-anchored cooldown, recovers stale active markers, then stops before Soul/Mind/Bifrost gates. +- `epiphany-work queue-run` is the first queue-aware run surface: it reads the + typed repo-local overview queue, selects only tick-actionable rows for the + current repo Body, delegates to `tick`, refreshes overview after advancement, + and writes a queue-run receipt. Wrapper: + `tools/epiphany_local_run.ps1 -Mode repo-work-queue-run`. - `epiphany-work serve` is the first Self-owned cadence loop around that pulse: bounded proof mode records finite iteration outputs, unbounded service mode relies on per-pulse tick receipts, and zero-interval unbounded polling is @@ -914,12 +935,14 @@ Required organs before MVP: - 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 projection: local `epiphany-work overview` proof bundles, typed +- 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 exist. Persona's Eve surface, direct Eve connection, and globally invokable - Persona Eve tool readback now expose peer-readable queue rows. Remaining work - is a usable repo-swarm run surface and richer Persona-to-plan depth. + Persona Eve tool readback now expose peer-readable queue rows, and + `epiphany-work queue-run` plus wrapper `repo-work-queue-run` consume that + queue for safe branch-local pulses. Remaining work is richer + Persona-to-plan depth. - Proof bundle depth: maintainers and future agents can inspect local operator-safe receipt chains, commit refs, verification verdicts, map admission, Bifrost/GitHub refs, credit refs, and sync state; remaining work is diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index db405950..2522525b 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -103,9 +103,9 @@ 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 thirteen-front-door chain from `epiphany-repo init` through `epiphany-work derive-plan`, `close`, `overview`, `tick`, `publish`, and `sync`, documents the operator-safe proof receipts already proved with `privateStateExposed=false`, and names the remaining MVP organs: model-authored Persona-to-plan depth, a usable repo-swarm run surface over the now-visible work queue, optional execute-to-close handoff, richer published proof bundles, 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. `epiphany-work derive-plan` now consumes accepted Persona/Bifrost pressure and writes an Imagination/Self action plan in deterministic `append-worklog` quarantine mode with `operatorAuthoredShellDetails=false`; disposable smoke proved accept -> derive-plan -> run -> adopt -> execute -> close, changed only `EPIPHANY_WORKLOG.md`, ended `closed:passed`, and reported no private-state exposure. `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. Disposable smokes proved pre-plan `awaiting-plan`/`plan-receipt-missing`, post-close `awaiting-publication`/`bifrost-publication-missing`, and latest-key CultMesh readback through `epiphany-verse-query smoke` as `latestRepoWorkOverview=repo-work-overview-verse-overview-request`, `latestRepoWorkGate=awaiting-publication`, `latestRepoWorkBlocker=bifrost-publication-missing`, with no private-state exposure. 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 serve` 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` 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. +- `notes/epiphany-repo-swarm-mvp-contract.md` is the repo-swarm MVP authority map and migration plan. It states the live fourteen-front-door chain from `epiphany-repo init` through `epiphany-work derive-plan`, `close`, `overview`, `tick`, `queue-run`, `publish`, and `sync`, documents the operator-safe proof receipts already proved with `privateStateExposed=false`, and names the remaining MVP organs: model-authored Persona-to-plan depth, optional Idunn-hosted queue-run lifecycle, optional execute-to-close handoff, richer published proof bundles, 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. `epiphany-work derive-plan` now consumes accepted Persona/Bifrost pressure and writes an Imagination/Self action plan in deterministic `append-worklog` quarantine mode with `operatorAuthoredShellDetails=false`; disposable smoke proved accept -> derive-plan -> run -> adopt -> execute -> close, changed only `EPIPHANY_WORKLOG.md`, ended `closed:passed`, and reported no private-state exposure. `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. Disposable smokes proved pre-plan `awaiting-plan`/`plan-receipt-missing`, post-close `awaiting-publication`/`bifrost-publication-missing`, and latest-key CultMesh readback through `epiphany-verse-query smoke` as `latestRepoWorkOverview=repo-work-overview-verse-overview-request`, `latestRepoWorkGate=awaiting-publication`, `latestRepoWorkBlocker=bifrost-publication-missing`, with no private-state exposure. 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 only tick-actionable rows for the current repo Body, delegates to `tick`, refreshes overview after real advancement, and is wrapped by `tools/epiphany_local_run.ps1 -Mode repo-work-queue-run`. `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 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. - 2026-06-20: The same repo-swarm note now carries the explicit migration thesis, MVP status board, authority matrix, local CultMesh tool availability doctrine, and upstream-main sync doctrine. Use that note when answering "are we headed toward a functional swarm?" The answer is yes, but only if the remaining cuts preserve the typed organ ownership: 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: Gjallar/swarm-overview now exposes repo-work overview history as first-class compact sight, and Persona's public Eve surface lowers the same queue for peer-readable collaboration. `SwarmOverviewOutput` and `SwarmTriageOutput` include `repoWorkOverviewCount`, `repoWorkOverviewRows`, `repoWorkOverviewTuiRows`, `latestRepoWorkOverview`, `latestRepoWorkGate`, `latestRepoWorkBlocker`, and `latestRepoWorkNextSafeMove`; the shared `swarmActionRows` queue gets priority 35 `repo-work-overview` rows owned by Gjallar, hosted body `repo-work`, authority gate `repo.work.overview`, effect class `repo-work-readback`, no mutation, no elevation, proof-bundle ref, and private-state seal. `eve-surfaces`, direct `connect-eve`, and the globally invokable Persona `eve-connect` daemon tool readback now expose public `REPO-WORK-PEER` rows with item, gate, blocker, next safe move, branch, publication, sync, and `private=false`. Disposable proof `.epiphany-smoke\gjallar-repo-work-queue-20260620-012027` proved typed event-history queue enumeration; disposable proof `.epiphany-smoke\eve-repo-work-queue-20260620-013322` proved two accepted items through Persona Eve surface, direct Eve connection, and Persona tool invocation readback with queue count 2 and no private-state exposure. The next cut is not another sight surface: wire this queue into a usable repo-swarm run surface and deepen Persona-to-Imagination plan derivation. +- 2026-06-20: Gjallar/swarm-overview now exposes repo-work overview history as first-class compact sight, Persona's public Eve surface lowers the same queue for peer-readable collaboration, and Self has a first runnable queue surface over it. `SwarmOverviewOutput` and `SwarmTriageOutput` include `repoWorkOverviewCount`, `repoWorkOverviewRows`, `repoWorkOverviewTuiRows`, `latestRepoWorkOverview`, `latestRepoWorkGate`, `latestRepoWorkBlocker`, and `latestRepoWorkNextSafeMove`; the shared `swarmActionRows` queue gets priority 35 `repo-work-overview` rows owned by Gjallar, hosted body `repo-work`, authority gate `repo.work.overview`, effect class `repo-work-readback`, no mutation, no elevation, proof-bundle ref, and private-state seal. `eve-surfaces`, direct `connect-eve`, and the globally invokable Persona `eve-connect` daemon tool readback expose public `REPO-WORK-PEER` rows with item, gate, blocker, next safe move, branch, publication, sync, and `private=false`. `epiphany-work queue-run` reads the same typed queue, selects current-repo rows at `ready-to-run`, `ready-to-adopt`, or `ready-to-execute`, delegates to `tick`, refreshes overview after real advancement, and wrapper `repo-work-queue-run` exposes the operator surface. Disposable proofs `.epiphany-smoke\gjallar-repo-work-queue-20260620-012027`, `.epiphany-smoke\eve-repo-work-queue-20260620-013322`, `.epiphany-smoke\queue-run-20260620-014314`, and wrapper artifact `local-20260620-014627-174-aada0241` prove two-item queue sight, Eve lowering, direct queue-run advancement, and wrapper dry-run without publication, merge, service lifecycle mutation, elevation, cross-repo mutation, or private-state exposure. The next cut is richer Persona-to-Imagination plan derivation, not another queue display surface. - `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 4b84219b32e5b387a8b871337845835bcb28f0a0..c098f72fc668acd2c2a34ec217aba164481193b4 100644 GIT binary patch delta 565 zcmY+AziSjh6vy4$#X`X%ibP`ZK(LUTu(zHUun>!2?TGURSbA_b=-N*^T zCbqn-sp!Ze-#P0~io6)*qar8yV0d>hgjR))EX*@b5^k_rvVf~mAuI|NSK5H18Z=JB z3}k(vY(_;Hgr?qA(vE8|yqo|n4VNMUlS;{kv{Nejps-S?>-bxSgtCqpNhp)8=`TlU zETv$e4ecU~qug*YUdlavltS{{f3WGzjV1V~*dl|iA)%DfyciA^F8t5^^mc$=?UbB( z2Bx~WTOD8#1n!3|t&IFfy#PAr2FFb;t%26Qn(~rHXMJc;jnRKn+0{GHShK2zcC*#B QR8ngaG0xxp<2TvHKMC;1WB>pF delta 49 zcmdn}O{n*y&;|)cZew#R6U(S$3@qETHY+n0GBWZuPi1PK%ESo7AewpmR3?@mTLGW| B5KaI9 diff --git a/state/map.yaml b/state/map.yaml index daefbf20..9d394032 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -88,8 +88,8 @@ 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. Thirteen native repo-swarm front doors are live and documented there: `epiphany-repo init`, `epiphany-swarm online`, `epiphany-work accept`, `epiphany-work derive-plan`, `epiphany-work plan`, `epiphany-work run`, `epiphany-work adopt --from-plan`, `epiphany-work execute --from-plan`, `epiphany-work close`, `epiphany-work overview`, `epiphany-work tick`, `epiphany-work publish`, and `epiphany-work sync`. Fresh-repo smokes proved the chain with `privateStateExposed=false`, including deterministic Persona/Bifrost pressure-to-plan derivation (`append-worklog`, `operatorAuthoredShellDetails=false`) into `EPIPHANY_WORKLOG.md`, 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, local `epiphany-work overview` proof bundle that reports pre-plan `awaiting-plan`/`plan-receipt-missing` and post-close `awaiting-publication`/`bifrost-publication-missing` with branch, commit, changed paths, Soul verdict, compact rows, and private seal, typed local Verse projection as `epiphany.cultmesh.repo_work_overview.v0` with latest-key/event-history readback through Gjallar plus peer-readable Persona Eve lowering, `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 model-authored Persona-to-plan depth for richer actions, a usable repo-swarm run surface over the queue, optional execute-to-close scheduler handoff, richer published proof bundles, 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. - - Gjallar/swarm-overview now projects typed repo-work overview history into the compact global sight report, and Persona's public Eve surface lowers the same queue for peers. `epiphany-verse-query gjallar` reads all `epiphany.cultmesh.repo_work_overview.v0` event documents from local Verse, excludes the `latest` mirror, preserves latest scalar fields, emits multi-item `repoWorkOverviewRows`/TUI rows, and publishes bounded priority 35-39 non-mutating `repo-work-overview` action rows with `owner=Gjallar`, `hostedBody=repo-work`, `authorityGate=repo.work.overview`, `mutatesState=false`, `requiresElevatedAuthority=false`, proof-bundle refs, current gate/blocker/next-safe-move, and `privateStateExposed=false`. `epiphany-verse-query eve-surfaces`, `connect-eve`, and globally invokable Persona `eve-connect` tool readbacks now expose compact `REPO-WORK-PEER` rows with item, gate, blocker, next safe move, branch, publication/sync state, and private seal for the public Persona surface only. Disposable proofs `.epiphany-smoke\gjallar-repo-work-queue-20260620-012027` and `.epiphany-smoke\eve-repo-work-queue-20260620-013322` showed two-item queues through Gjallar, Persona Eve surface, direct Eve connection, and daemon tool invocation, all without mutation, elevation, or private-state exposure. + - 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. Fourteen native repo-swarm front doors are live and documented there: `epiphany-repo init`, `epiphany-swarm online`, `epiphany-work accept`, `epiphany-work derive-plan`, `epiphany-work plan`, `epiphany-work run`, `epiphany-work adopt --from-plan`, `epiphany-work execute --from-plan`, `epiphany-work close`, `epiphany-work overview`, `epiphany-work tick`, `epiphany-work queue-run`, `epiphany-work publish`, and `epiphany-work sync`. Fresh-repo smokes proved the chain with `privateStateExposed=false`, including deterministic Persona/Bifrost pressure-to-plan derivation (`append-worklog`, `operatorAuthoredShellDetails=false`) into `EPIPHANY_WORKLOG.md`, 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, local `epiphany-work overview` proof bundle that reports pre-plan `awaiting-plan`/`plan-receipt-missing` and post-close `awaiting-publication`/`bifrost-publication-missing` with branch, commit, changed paths, Soul verdict, compact rows, and private seal, typed local Verse projection as `epiphany.cultmesh.repo_work_overview.v0` with latest-key/event-history readback through Gjallar plus peer-readable Persona Eve lowering, `epiphany-work queue-run` selection over tick-actionable queue rows with wrapper `repo-work-queue-run`, `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 model-authored Persona-to-plan depth for richer actions, optional Idunn-hosted queue-run lifecycle, optional execute-to-close scheduler handoff, richer published proof bundles, 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. + - Gjallar/swarm-overview now projects typed repo-work overview history into the compact global sight report, Persona's public Eve surface lowers the same queue for peers, and Self has a first runnable queue surface over it. `epiphany-verse-query gjallar` reads all `epiphany.cultmesh.repo_work_overview.v0` event documents from local Verse, excludes the `latest` mirror, preserves latest scalar fields, emits multi-item `repoWorkOverviewRows`/TUI rows, and publishes bounded priority 35-39 non-mutating `repo-work-overview` action rows with `owner=Gjallar`, `hostedBody=repo-work`, `authorityGate=repo.work.overview`, `mutatesState=false`, `requiresElevatedAuthority=false`, proof-bundle refs, current gate/blocker/next-safe-move, and `privateStateExposed=false`. `epiphany-verse-query eve-surfaces`, `connect-eve`, and globally invokable Persona `eve-connect` tool readbacks expose compact `REPO-WORK-PEER` rows with item, gate, blocker, next safe move, branch, publication/sync state, and private seal for the public Persona surface only. `epiphany-work queue-run` selects current-repo rows at `ready-to-run`, `ready-to-adopt`, or `ready-to-execute`, delegates action to `tick`, refreshes overview after real advancement, and writes `epiphany.repo_work_queue_run_receipt.v0`; wrapper mode `tools/epiphany_local_run.ps1 -Mode repo-work-queue-run` exposes the same surface. Disposable proofs `.epiphany-smoke\gjallar-repo-work-queue-20260620-012027`, `.epiphany-smoke\eve-repo-work-queue-20260620-013322`, `.epiphany-smoke\queue-run-20260620-014314`, and wrapper artifact `local-20260620-014627-174-aada0241` showed two-item queues through sight, public Eve, direct queue-run, and wrapper dry-run without publication, merge, service lifecycle mutation, elevation, cross-repo mutation, or private-state exposure. - 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. @@ -634,4 +634,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 thirteen-front-door chain. Typed Gjallar repo-work history/queue sight and peer-readable Persona Eve lowering are live over `epiphany.cultmesh.repo_work_overview.v0`; next wire that queue into a usable repo-swarm run surface and deepen Persona-to-Imagination plan derivation without opening raw worker thought. 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 fourteen-front-door chain. Typed Gjallar repo-work history/queue sight, peer-readable Persona Eve lowering, and Self-owned `epiphany-work queue-run` over tick-actionable rows are live over `epiphany.cultmesh.repo_work_overview.v0`; next deepen Persona-to-Imagination plan derivation for richer safe action classes without opening raw worker thought, then decide whether queue-run needs Idunn-hosted lifecycle. Preserve Idunn service lifecycle surfaces and existing CultMesh/Odin/Eve tool directories; service install/start execution still requires explicit elevated operator authority. diff --git a/tools/epiphany_local_run.ps1 b/tools/epiphany_local_run.ps1 index a831b99d..d1288235 100644 --- a/tools/epiphany_local_run.ps1 +++ b/tools/epiphany_local_run.ps1 @@ -1,5 +1,5 @@ param( - [ValidateSet("status", "plan", "smoke", "run", "mvp", "agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "bifrost-publication", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "swarm-online-runbook", "service-policy-directory", "service-plan", "service-launch", "service-runbook", "cluster-service-runbook", "cluster-service-install-plan", "cluster-service-install-execute", "cluster-service-audit", "cluster-service-start-plan", "cluster-service-stop-plan", "cluster-service-start-execute", "cluster-service-stop-execute", "cluster-service-execution-readiness", "cluster-service-execution-runbook", "cluster-service-execution-audit", "service-execution-runbook", "service-install-plan", "service-install-execute", "service-tick", "service-status", "service-reconcile", "service-execution-readiness", "service-execution-audit", "service-start-plan", "service-stop-plan", "service-start-execute", "service-stop-execute")] + [ValidateSet("status", "plan", "smoke", "run", "mvp", "agent-state-soa", "swarm-status", "swarm-poke-down", "swarm-triage", "cluster-topology", "eve-surfaces", "eve-connect", "collaboration-feedback", "bifrost-publication", "bifrost-ledger", "receipt-directory", "tool-directory", "tool-invoke", "swarm-overview", "gjallar", "repo-work-queue-run", "swarm-online-runbook", "service-policy-directory", "service-plan", "service-launch", "service-runbook", "cluster-service-runbook", "cluster-service-install-plan", "cluster-service-install-execute", "cluster-service-audit", "cluster-service-start-plan", "cluster-service-stop-plan", "cluster-service-start-execute", "cluster-service-stop-execute", "cluster-service-execution-readiness", "cluster-service-execution-runbook", "cluster-service-execution-audit", "service-execution-runbook", "service-install-plan", "service-install-execute", "service-tick", "service-status", "service-reconcile", "service-execution-readiness", "service-execution-audit", "service-start-plan", "service-stop-plan", "service-start-execute", "service-stop-execute")] [string]$Mode = "smoke", [string]$Root = (Resolve-Path ".").Path, [string]$Workspace = "", @@ -41,6 +41,9 @@ param( [string]$ToolInvocationReason = "", [string]$ToolIntentId = "", [string]$ToolReceiptId = "", + [int]$RepoWorkMaxItems = 1, + [string]$RepoWorkRuntimeId = "repo-swarm-local", + [switch]$RepoWorkDryRun, [string]$PersonaInput = "", [switch]$SkipBuild, [switch]$AutoReview, @@ -289,6 +292,7 @@ $statusExe = Join-Path $TargetDir "debug\epiphany-mvp-status.exe" $operatorRunExe = Join-Path $TargetDir "debug\epiphany-operator-run.exe" $operatorSnapshotExe = Join-Path $TargetDir "debug\epiphany-operator-snapshot.exe" $verseQueryExe = Join-Path $TargetDir "debug\epiphany-verse-query.exe" +$repoWorkExe = Join-Path $TargetDir "debug\epiphany-work.exe" $daemonSupervisorExe = Join-Path $TargetDir "debug\epiphany-daemon-supervisor.exe" $clusterDaemonExe = Join-Path $TargetDir "debug\epiphany-cluster-daemon.exe" $handsActionExe = Join-Path $TargetDir "debug\epiphany-hands-action.exe" @@ -319,7 +323,7 @@ $runtimeStore = Join-Path $Workspace "state\runtime-spine.msgpack" $liveRuntimeMode = @("run", "mvp") -contains $Mode if (-not $SkipBuild) { - if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") { + if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") { Invoke-Checked ` -Label "build Codex app-server compatibility organ" ` -FilePath $cargoExe ` @@ -339,6 +343,7 @@ if (-not $SkipBuild) { "--bin", "epiphany-operator-run", "--bin", "epiphany-operator-snapshot", "--bin", "epiphany-verse-query", + "--bin", "epiphany-work", "--bin", "epiphany-daemon-supervisor", "--bin", "epiphany-cluster-daemon", "--bin", "epiphany-hands-action", @@ -373,8 +378,8 @@ if (-not $SkipBuild) { } } -$requiredBinaries = @($statusExe, $operatorRunExe, $operatorSnapshotExe, $verseQueryExe, $daemonSupervisorExe, $handsActionExe) -if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") { +$requiredBinaries = @($statusExe, $operatorRunExe, $operatorSnapshotExe, $verseQueryExe, $repoWorkExe, $daemonSupervisorExe, $handsActionExe) +if ($Mode -ne "status" -and $Mode -ne "agent-state-soa" -and $Mode -ne "swarm-status" -and $Mode -ne "swarm-poke-down" -and $Mode -ne "swarm-triage" -and $Mode -ne "cluster-topology" -and $Mode -ne "eve-surfaces" -and $Mode -ne "eve-connect" -and $Mode -ne "collaboration-feedback" -and $Mode -ne "bifrost-publication" -and $Mode -ne "bifrost-ledger" -and $Mode -ne "receipt-directory" -and $Mode -ne "tool-directory" -and $Mode -ne "tool-invoke" -and $Mode -ne "swarm-overview" -and $Mode -ne "gjallar" -and $Mode -ne "repo-work-queue-run" -and $Mode -ne "swarm-online-runbook" -and $Mode -ne "service-policy-directory" -and $Mode -ne "service-plan" -and $Mode -ne "service-launch" -and $Mode -ne "service-runbook" -and $Mode -ne "cluster-service-runbook" -and $Mode -ne "cluster-service-install-plan" -and $Mode -ne "cluster-service-install-execute" -and $Mode -ne "cluster-service-audit" -and $Mode -ne "cluster-service-start-plan" -and $Mode -ne "cluster-service-stop-plan" -and $Mode -ne "cluster-service-start-execute" -and $Mode -ne "cluster-service-stop-execute" -and $Mode -ne "cluster-service-execution-readiness" -and $Mode -ne "cluster-service-execution-runbook" -and $Mode -ne "cluster-service-execution-audit" -and $Mode -ne "service-execution-runbook" -and $Mode -ne "service-install-plan" -and $Mode -ne "service-install-execute" -and $Mode -ne "service-tick" -and $Mode -ne "service-status" -and $Mode -ne "service-reconcile" -and $Mode -ne "service-execution-readiness" -and $Mode -ne "service-execution-audit" -and $Mode -ne "service-start-plan" -and $Mode -ne "service-stop-plan" -and $Mode -ne "service-start-execute" -and $Mode -ne "service-stop-execute") { $requiredBinaries += @($codexAppServer, $coordinatorExe) } function Assert-SwarmBrakeAllowsLiveRun { @@ -447,7 +452,7 @@ function Assert-SwarmBrakeAllowsLiveRun { } } -if (@("plan", "run", "mvp", "service-plan", "service-launch", "service-runbook", "cluster-service-runbook", "cluster-service-install-plan", "cluster-service-install-execute", "cluster-service-audit", "cluster-service-start-plan", "cluster-service-stop-plan", "cluster-service-start-execute", "cluster-service-stop-execute", "cluster-service-execution-readiness", "cluster-service-execution-runbook", "cluster-service-execution-audit", "service-execution-runbook", "service-install-plan", "service-install-execute", "service-tick", "service-status", "service-reconcile", "service-execution-readiness", "service-execution-audit", "service-start-plan", "service-stop-plan", "service-start-execute", "service-stop-execute") -contains $Mode) { +if (@("plan", "run", "mvp", "repo-work-queue-run", "service-plan", "service-launch", "service-runbook", "cluster-service-runbook", "cluster-service-install-plan", "cluster-service-install-execute", "cluster-service-audit", "cluster-service-start-plan", "cluster-service-stop-plan", "cluster-service-start-execute", "cluster-service-stop-execute", "cluster-service-execution-readiness", "cluster-service-execution-runbook", "cluster-service-execution-audit", "service-execution-runbook", "service-install-plan", "service-install-execute", "service-tick", "service-status", "service-reconcile", "service-execution-readiness", "service-execution-audit", "service-start-plan", "service-stop-plan", "service-start-execute", "service-stop-execute") -contains $Mode) { if (-not (Test-Path -LiteralPath $verseQueryExe)) { throw "required binary not found for swarm brake preflight: $verseQueryExe" } @@ -1786,6 +1791,29 @@ if ($Mode -eq "service-start-plan" -or $Mode -eq "service-stop-plan" -or $Mode - -StderrPath (Join-Path $artifactRoot "daemon-service-$control-$controlModeName.stderr.log") } +if ($Mode -eq "repo-work-queue-run") { + $resultPath = Join-Path $artifactRoot "repo-work-queue-run.stdout.json" + $repoWorkVerseStore = Join-Path $Workspace ".epiphany\local-verse.ccmp" + $repoWorkArgs = @( + "queue-run", + "--workspace", $Workspace, + "--epiphany-root", $Root, + "--local-verse-store", $repoWorkVerseStore, + "--runtime-id", $RepoWorkRuntimeId, + "--max-items", "$RepoWorkMaxItems" + ) + if ($RepoWorkDryRun.IsPresent) { + $repoWorkArgs += @("--dry-run") + } + Invoke-Checked ` + -Label "run repo-work queue surface" ` + -FilePath $repoWorkExe ` + -Arguments $repoWorkArgs ` + -WorkingDirectory $Root ` + -StdoutPath $resultPath ` + -StderrPath (Join-Path $artifactRoot "repo-work-queue-run.stderr.log") +} + if ($Mode -eq "plan") { $resultPath = Join-Path $artifactRoot "coordinator-plan.stdout.json" $planArgs = @( @@ -2257,6 +2285,15 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { $overviewLabel = "Gjallar" } Write-Host "${overviewLabel}: status=$($result.status), liveness=$($result.livenessStatus), recovery=$($result.recoveryStatus), agents=$($result.agentCount), clusters=$($result.clusterCount), privateVerses=$($result.privateVerseCount), surfaces=$($result.surfaceCount), tools=$($result.toolCount), nonReady=$($result.nonReadyDaemonCount), policyMissing=$($result.policyMissingCount), recommended=$($result.recommendedWrapperMode), serviceRecommended=$($result.serviceLifecycleRecommendedWrapperMode), swarmOnlineTool=$swarmOnlineTool, actionQueue=$actionQueue, actionRows=$actionRows, attention=$attention, daemonRows=$daemonRows, toolRows=$toolRows, policyRows=$policyRows, toolHostAttention=$toolHostAttention, toolAttentionRows=$toolAttentionRows, serviceLifecycleAttention=$serviceLifecycleAttention, serviceAttentionRows=$serviceAttentionRows, serviceExecutionFailedChecks=$serviceExecutionFailedChecks, serviceFailedCheckRows=$serviceFailedCheckRows, privateStateExposed=$($result.privateStateExposed)" + } elseif ($Mode -eq "repo-work-queue-run") { + $selectedRows = Format-TuiRows $result.selectedRows + $tickRows = "none" + if ($null -ne $result.outputs -and @($result.outputs).Count -gt 0) { + $tickRows = ((@($result.outputs) | ForEach-Object { + "$($_.item):gateBefore=$($_.gateBefore):tick=$($_.tick.status)/$($_.tick.action):next=$($_.tick.nextSafeMove)" + }) -join "; ") + } + Write-Host "Repo work queue run: status=$($result.status), queue=$($result.queueCount), actionable=$($result.actionableCount), maxItems=$($result.maxItems), dryRun=$($result.dryRun), selectedRows=$selectedRows, tickRows=$tickRows, privateStateExposed=$($result.privateStateExposed)" } elseif ($Mode -eq "swarm-online-runbook") { $aftercare = "none" if ($null -ne $result.aftercareCommands -and $result.aftercareCommands.Count -gt 0) {