From f1f87d7b0eec653bbc424b6e9b102fd1a4c1f387 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 18 Jun 2026 16:31:10 +0100 Subject: [PATCH] Expose elevated runbook commands in swarm actions --- epiphany-core/src/bin/epiphany-verse-query.rs | 62 ++++++++++++++++++ notes/fresh-workspace-handoff.md | 4 +- state/ledgers.msgpack | Bin 257221 -> 257782 bytes state/map.yaml | 4 +- tools/epiphany_local_run.ps1 | 12 +++- 5 files changed, 76 insertions(+), 6 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 2550c688..4a79b239 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -1454,6 +1454,11 @@ fn main() -> Result<()> { ); } "smoke" => { + if args.smoke_default_store { + if let Some(parent) = args.store.parent() { + fs::remove_dir_all(parent).ok(); + } + } seed_epiphany_local_verse_context( &args.store, args.runtime_id.clone(), @@ -2392,6 +2397,12 @@ fn main() -> Result<()> { && row.operator_artifact_ref == service_smoke_runbook_path.display().to_string() && row.operator_artifact_status == "present" + && row.operator_artifact_execution_command + == elevated_powershell_runbook_command( + &service_smoke_runbook_path.display().to_string(), + ) + && row.operator_aftercare_command + == WRAPPER_CLUSTER_SERVICE_EXECUTION_AUDIT_COMMAND && row.completion_audit_wrapper_mode == "cluster-service-execution-audit" && row.completion_audit_wrapper_command == WRAPPER_CLUSTER_SERVICE_EXECUTION_AUDIT_COMMAND @@ -2494,6 +2505,8 @@ fn main() -> Result<()> { && row.wrapper_mode == "cluster-service-execution-runbook" && row.effect_class == "service-lifecycle-runbook-regeneration" && row.operator_artifact_status == "missing" + && row.operator_artifact_execution_command == "none" + && row.operator_aftercare_command == "none" && row.completion_audit_wrapper_mode == "cluster-service-execution-audit" && row.completion_audit_wrapper_command == WRAPPER_CLUSTER_SERVICE_EXECUTION_AUDIT_COMMAND @@ -2849,6 +2862,8 @@ struct SwarmActionRow { wrapper_command: String, operator_artifact_ref: String, operator_artifact_status: String, + operator_artifact_execution_command: String, + operator_aftercare_command: String, completion_audit_wrapper_mode: String, completion_audit_wrapper_command: String, authority_gate: String, @@ -3243,6 +3258,8 @@ fn swarm_action_rows( wrapper_command: WRAPPER_POKE_NON_READY_COMMAND.to_string(), operator_artifact_ref: "none".to_string(), operator_artifact_status: "none".to_string(), + operator_artifact_execution_command: "none".to_string(), + operator_aftercare_command: "none".to_string(), completion_audit_wrapper_mode: "none".to_string(), completion_audit_wrapper_command: "none".to_string(), authority_gate: "daemon.lifecycle_poke".to_string(), @@ -3268,6 +3285,8 @@ fn swarm_action_rows( wrapper_command: "tools/epiphany_local_run.ps1 -Mode tool-directory".to_string(), operator_artifact_ref: "none".to_string(), operator_artifact_status: "none".to_string(), + operator_artifact_execution_command: "none".to_string(), + operator_aftercare_command: "none".to_string(), completion_audit_wrapper_mode: "none".to_string(), completion_audit_wrapper_command: "none".to_string(), authority_gate: "daemon.tool_invocation_liveness_gate".to_string(), @@ -3292,6 +3311,8 @@ fn swarm_action_rows( wrapper_command: WRAPPER_SERVICE_POLICY_DIRECTORY_COMMAND.to_string(), operator_artifact_ref: "none".to_string(), operator_artifact_status: "none".to_string(), + operator_artifact_execution_command: "none".to_string(), + operator_aftercare_command: "none".to_string(), completion_audit_wrapper_mode: "none".to_string(), completion_audit_wrapper_command: "none".to_string(), authority_gate: "daemon.restart_policy".to_string(), @@ -3317,6 +3338,8 @@ fn swarm_action_rows( wrapper_command: service_lifecycle_recommended_wrapper_command.to_string(), operator_artifact_ref: "none".to_string(), operator_artifact_status: "none".to_string(), + operator_artifact_execution_command: "none".to_string(), + operator_aftercare_command: "none".to_string(), completion_audit_wrapper_mode: "none".to_string(), completion_audit_wrapper_command: "none".to_string(), authority_gate: "daemon.service_lifecycle".to_string(), @@ -3377,6 +3400,16 @@ fn swarm_action_rows( "A sealed service execution runbook exists; completing service readiness now requires explicit elevated operator execution and follow-up audit receipts.".to_string(), ) }; + let operator_artifact_execution_command = if artifact_status == "present" { + elevated_powershell_runbook_command(&runbook_row.artifact_ref) + } else { + "none".to_string() + }; + let operator_aftercare_command = if artifact_status == "present" { + service_lifecycle_recommended_wrapper_command.to_string() + } else { + "none".to_string() + }; rows.push(SwarmActionRow { priority: 50, family: "service-execution-authority".to_string(), @@ -3386,6 +3419,8 @@ fn swarm_action_rows( wrapper_command, operator_artifact_ref: runbook_row.artifact_ref.clone(), operator_artifact_status: artifact_status, + operator_artifact_execution_command, + operator_aftercare_command, completion_audit_wrapper_mode: service_lifecycle_recommended_wrapper_mode .to_string(), completion_audit_wrapper_command: service_lifecycle_recommended_wrapper_command @@ -3409,6 +3444,8 @@ fn swarm_action_rows( wrapper_command: "none".to_string(), operator_artifact_ref: "none".to_string(), operator_artifact_status: "none".to_string(), + operator_artifact_execution_command: "none".to_string(), + operator_aftercare_command: "none".to_string(), completion_audit_wrapper_mode: "none".to_string(), completion_audit_wrapper_command: "none".to_string(), authority_gate: "none".to_string(), @@ -3441,6 +3478,17 @@ fn swarm_action_tui_row(row: &SwarmActionRow) -> String { ) } +fn elevated_powershell_runbook_command(artifact_ref: &str) -> String { + format!( + "Start-Process PowerShell -Verb RunAs -Wait -ArgumentList @('-NoProfile','-ExecutionPolicy','Bypass','-File',{})", + quote_powershell_literal(artifact_ref) + ) +} + +fn quote_powershell_literal(value: &str) -> String { + format!("'{}'", value.replace('\'', "''")) +} + fn operator_artifact_status(artifact_ref: &str) -> &'static str { if artifact_ref.is_empty() || artifact_ref == "none" { "none" @@ -4978,6 +5026,7 @@ struct Args { command: String, store: PathBuf, runtime_id: String, + smoke_default_store: bool, agent_store: Option, daemon_id: Option, daemon_status: Option, @@ -5039,6 +5088,8 @@ impl Args { let command = values.next().unwrap_or_else(|| "query".to_string()); let mut store = PathBuf::from(".epiphany-run/cultmesh/local-verse.ccmp"); let mut runtime_id = "epiphany-local".to_string(); + let mut store_overridden = false; + let mut runtime_id_overridden = false; let mut agent_store = None; let mut daemon_id = None; let mut daemon_status = None; @@ -5097,9 +5148,11 @@ impl Args { match arg.as_str() { "--store" => { store = PathBuf::from(values.next().context("missing --store value")?); + store_overridden = true; } "--runtime-id" => { runtime_id = values.next().context("missing --runtime-id value")?; + runtime_id_overridden = true; } "--agent-store" => { agent_store = Some(PathBuf::from( @@ -5345,6 +5398,14 @@ impl Args { } } + let smoke_default_store = command == "smoke" && !store_overridden; + if smoke_default_store { + store = PathBuf::from(".epiphany-smoke/verse-query-default/local-verse.ccmp"); + if !runtime_id_overridden { + runtime_id = "verse-query-default-smoke".to_string(); + } + } + if let Some(parent) = store.parent() { std::fs::create_dir_all(parent)?; } @@ -5353,6 +5414,7 @@ impl Args { command, store, runtime_id, + smoke_default_store, agent_store, daemon_id, daemon_status, diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 1ce6f839..83b16d80 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -61,12 +61,12 @@ remembers doctrine; the branch remembers the blade. - Public doctrine source `https://gamecult.org/Blog/purge-the-heretek-from-our-daemonic-swarm` sharpens the current swarm audit: Odin sees but must not own, Gjallar-like surface publishers must produce their own witnesses, Idunn-like ledgers must advance instead of freezing old wounds, and Bifrost is the ledger gate for cross-repo purification receipts rather than transcript archaeology. - `tools/epiphany_local_run.ps1` now stamps local run ids as `local-YYYYMMDD-HHMMSS-fff-` instead of second-resolution ids, so concurrent operator rites get separate artifact roots and run receipts. Verified: `collaboration-feedback` and `bifrost-publication` launched in parallel in the same second and completed as `local-20260618-064814-171-dc0b8dd9` and `local-20260618-064814-149-2946d675`. - `epiphany-verse-query tool-directory` and `tools/epiphany_local_run.ps1 -Mode tool-directory` are the compact read-only daemon tool directory. The report reads the same local Verse capability records used by `invoke-tool`, annotates them with host daemon readiness, and returns TUI rows plus direct `invocationCommand` and wrapper `wrapperInvocationCommand=tools/epiphany_local_run.ps1 -Mode tool-invoke -ToolCapabilityId -ToolRequestingAgentId -ToolRequestingClusterId `. Verified: fresh proof store returned sixteen globally available, receipt-gated, private-state-sealed tools with `hostReadyCount=16`, `hostAttentionCount=0`, including `READY | Hands | repo-action | submitHandsActionIntent | epiphany.cluster.hands.tool.repo-action | eve://epiphany/hands`; smoke source-proves the compact Hands row and command hints; wrapper mode produced `tools=16`, `hostReady=16`, `hostAttention=0`, `privateStateExposed=False`. -- `epiphany-verse-query swarm-overview` and `tools/epiphany_local_run.ps1 -Mode swarm-overview` are the one-command compact global-agent sight rite. It composes narrow cluster topology, liveness, Odin/Eve surface, daemon tool, restart-policy coverage, receipt-directory service-lifecycle attention, and the shared core service-execution audit report; returns seven agents/daemons, seven clusters, seven private Verse ids, seven Eve surfaces, one public Persona discussion surface, sixteen globally invokable receipt-gated tools, command hints for topology/liveness/surfaces/tools/receipts/poke/connect/invoke/Bifrost-ledger/service-policy-directory/service-execution-audit, sealed `toolHostAttentionRows`/TUI rows for blocked daemon-hosted capabilities, sealed `serviceLifecycleAttentionRows`/TUI rows copied from the receipt directory, explicit `serviceLifecycleRecommended*` fields for service-manager follow-up, ordered `swarmActionRows`/TUI rows with authority/effect/mutation/elevation metadata plus sealed `operatorArtifactRef`, `operatorArtifactStatus`, and `completionAuditWrapper*` pointers for operator-runbook rows, `serviceExecutionFailedCheckRows`/TUI rows naming the failed sealed execution checks, and `privateStateExposed=false`; and avoids full local Verse serialization. `epiphany-verse-query` now defaults to `.epiphany-run\cultmesh\local-verse.ccmp`, matching the wrapper and daemon supervisor. Verified: live overview artifact `local-20260618-161718-889-7cebdcb1` returned `status=attention`, `liveness=ready`, `recovery=attention`, `agents=7`, `clusters=7`, `privateVerses=7`, `surfaces=7`, `tools=16`, `nonReady=0`, `toolHostAttentionCount=0`, `policyMissing=0`, `recommended=cluster-service-execution-audit`, `serviceRecommended=cluster-service-execution-audit`, `swarmActionCount=2`, readback row `40:service-lifecycle:cluster-service-execution-audit:attention:mutates=False:elevated=False:artifactStatus=none:audit=none:artifact=none`, elevated row `50:service-execution-authority:operator-elevated-runbook:operator-authority-required:mutates=True:elevated=True:artifactStatus=present:audit=cluster-service-execution-audit:artifact=E:\Projects\EpiphanyAgent\.epiphany-run\local-20260618-161632-376-436227d8\epiphany-cluster-daemon-services-execution-runbook.ps1`, lifecycle routes `epiphany-cluster-daemon-services::cluster-windows-service-execution-audit` and `epiphany-daemon-supervisor-service::windows-service-execution-audit`, and `serviceExecutionFailedChecks=cluster-windows-service-execution-readiness=not-elevated; cluster-windows-service-install=planned; cluster-windows-service-start=execution-refused-not-elevated; cluster-windows-service-execution-audit=incomplete; cluster-windows-service-stop=execution-refused-not-elevated` with `privateStateExposed=False`. Fresh source smoke `verse-query-service-execution-failed-checks-clean` passes, including present-artifact, missing-artifact, and failed-check anatomy branches. +- `epiphany-verse-query swarm-overview` and `tools/epiphany_local_run.ps1 -Mode swarm-overview` are the one-command compact global-agent sight rite. It composes narrow cluster topology, liveness, Odin/Eve surface, daemon tool, restart-policy coverage, receipt-directory service-lifecycle attention, and the shared core service-execution audit report; returns seven agents/daemons, seven clusters, seven private Verse ids, seven Eve surfaces, one public Persona discussion surface, sixteen globally invokable receipt-gated tools, command hints for topology/liveness/surfaces/tools/receipts/poke/connect/invoke/Bifrost-ledger/service-policy-directory/service-execution-audit, sealed `toolHostAttentionRows`/TUI rows for blocked daemon-hosted capabilities, sealed `serviceLifecycleAttentionRows`/TUI rows copied from the receipt directory, explicit `serviceLifecycleRecommended*` fields for service-manager follow-up, ordered `swarmActionRows`/TUI rows with authority/effect/mutation/elevation metadata plus sealed `operatorArtifactRef`, `operatorArtifactStatus`, `operatorArtifactExecutionCommand`, `operatorAftercareCommand`, and `completionAuditWrapper*` pointers for operator-runbook rows, `serviceExecutionFailedCheckRows`/TUI rows naming the failed sealed execution checks, and `privateStateExposed=false`; and avoids full local Verse serialization. Live `epiphany-verse-query` defaults to `.epiphany-run\cultmesh\local-verse.ccmp`, matching the wrapper and daemon supervisor; bare `epiphany-verse-query smoke` now uses disposable `.epiphany-smoke\verse-query-default\local-verse.ccmp` unless `--store` is explicit. Verified: live overview artifact `local-20260618-162841-275-6bc3ef3e` returned `status=attention`, `liveness=ready`, `recovery=attention`, `agents=7`, `clusters=7`, `privateVerses=7`, `surfaces=7`, `tools=16`, `nonReady=0`, `toolHostAttentionCount=0`, `policyMissing=0`, `recommended=cluster-service-execution-audit`, `serviceRecommended=cluster-service-execution-audit`, `swarmActionCount=2`, readback row `40:service-lifecycle:cluster-service-execution-audit:attention:mutates=False:elevated=False:artifactStatus=none:audit=none:aftercare=none:artifact=none`, elevated row `50:service-execution-authority:operator-elevated-runbook:operator-authority-required:mutates=True:elevated=True:artifactStatus=present:audit=cluster-service-execution-audit:aftercare=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit:artifact=E:\Projects\EpiphanyAgent\.epiphany-run\local-20260618-161632-376-436227d8\epiphany-cluster-daemon-services-execution-runbook.ps1`, JSON `operatorArtifactExecutionCommand=Start-Process PowerShell -Verb RunAs -Wait -ArgumentList @('-NoProfile','-ExecutionPolicy','Bypass','-File','...epiphany-cluster-daemon-services-execution-runbook.ps1')`, lifecycle routes `epiphany-cluster-daemon-services::cluster-windows-service-execution-audit` and `epiphany-daemon-supervisor-service::windows-service-execution-audit`, and `serviceExecutionFailedChecks=cluster-windows-service-execution-readiness=not-elevated; cluster-windows-service-install=planned; cluster-windows-service-start=execution-refused-not-elevated; cluster-windows-service-execution-audit=incomplete; cluster-windows-service-stop=execution-refused-not-elevated` with `privateStateExposed=False`. Fresh source smoke passes in both bare default-store mode and explicit clean-store mode, including present-artifact, missing-artifact, and failed-check anatomy branches. - `epiphany-verse-query swarm-triage` and `tools/epiphany_local_run.ps1 -Mode swarm-triage` are the compact "see the swarm, then poke only if liveness attention exists" rite. It reads the compact overview first, writes no poke receipt when liveness is ready, routes non-ready daemons through the existing brake-aware `poke-down-daemons` receipt writer, carries overview's sealed service lifecycle attention rows, failed service-execution check rows, explicit service lifecycle recommendation, and ordered/effect-classified action queue with sealed runbook artifact and audit pointers without treating service-manager wounds as daemon-poke authority, and carries sealed `toolHostAttentionRows`/TUI rows so agents can see which advertised tools are blocked by a sick host daemon. Verified: live wrapper artifact `local-20260618-150015-844-aba20563` produced `status=noop`, `overview=attention`, `liveness=ready`, `recovery=attention`, `clusters=7`, `privateVerses=7`, `recommended=cluster-service-execution-audit`, `serviceRecommended=cluster-service-execution-audit`, service readback row `artifactStatus=none`, elevated service authority row `artifactStatus=present`, `completionAuditWrapperCommand=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`, artifact `E:\Projects\EpiphanyAgent\.epiphany-run\local-20260618-132257-139-26213a29\epiphany-cluster-daemon-services-execution-runbook.ps1`, `attention=none`, `serviceLifecycleAttention=cluster-service-lifecycle:epiphany-cluster-daemon-services::cluster-windows-service-execution-audit:incomplete; service-lifecycle:epiphany-daemon-supervisor-service::windows-service-execution-audit:incomplete`, `serviceLifecycleAttentionCount=2`, `poked=0`, and `privateStateExposed=False`; degraded Hands proof routes through the topology-aware poke path and exposes blocked Hands tool-host rows plus liveness/tool-host action rows; source smoke `verse-query-completion-audit-row-smoke` proves the degraded single-poke triage path without a post-receipt full-context readback. - `swarmActionTuiRows` now carry the same audit visibility as JSON rows. Fresh source smoke `verse-query-action-tui-audit-smoke` and live artifacts `local-20260618-150449-420-0371c76a` / `local-20260618-150450-027-74d864da` prove the compact rows include `artifact=present | audit=cluster-service-execution-audit` on the `service-execution-authority` row and `artifact=none | audit=none` on the readback row, while triage remains `poked=0` and private state remains sealed. - Receipt directory rows now classify their artifact refs too. `ReceiptDirectoryRow` includes `artifactStatus`, and receipt TUI rows append `artifact=`. Fresh smoke `verse-query-receipt-artifact-status-smoke` plus live overview/triage artifacts `local-20260618-150837-267-7fbf22bb` / `local-20260618-150837-466-a6a55086` prove service-manager lifecycle attention refs report `artifactStatus=external-ref` and TUI `artifact=external-ref`, while local runbook action rows still report `artifactStatus=present`. - `epiphany-verse-query receipt-directory` now also derives compact artifact status counts: `artifactNoneCount`, `artifactExternalRefCount`, `artifactPresentCount`, and `artifactMissingCount`. Live direct readback against `.epiphany-run\cultmesh\local-verse.ccmp` and wrapper artifact `local-20260618-151656-688-a041afcc` both reported `artifactNone=13`, `artifactExternalRef=2`, `artifactPresent=2`, `artifactMissing=0`, and `privateStateExposed=false`. A clean direct empty-store readback reported all 17 rows as `artifactNone`. The earlier all-in-one `epiphany-verse-query smoke` Windows stack overflow was fixed by cutting full `query_epiphany_local_verse_context` out of `load_swarm_overview_report`; overview now reads daemon service lifecycle rows through narrow history/latest loaders. Fresh proof `verse-query-overview-slim-context-clean` passed the full smoke without stack overflow. -- Wrapper `swarm-overview` and `swarm-triage` one-line summaries now include service lifecycle receipt `artifactStatus` plus compact `serviceExecutionFailedChecks`. Live artifacts `local-20260618-151040-034-5a69face` and `local-20260618-151040-315-fea033ef` show both lifecycle attention rows as `artifactStatus=external-ref`; live artifact `local-20260618-155606-611-19701102` additionally names readiness/install/start/audit/stop failed checks, with private state sealed. +- Wrapper `swarm-overview` and `swarm-triage` one-line summaries now include service lifecycle receipt `artifactStatus`, operator aftercare, and compact `serviceExecutionFailedChecks`. Live artifacts `local-20260618-162841-275-6bc3ef3e` and `local-20260618-162629-280-1e132880` show both lifecycle attention rows, the operator-elevated runbook row with `aftercare=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`, and readiness/install/start/audit/stop failed checks, with private state sealed. - Full service lifecycle history now excludes the `epiphany-local/daemon-service-lifecycle-receipt/latest` mirror entry. Latest remains readable through the dedicated latest loader; history contains only real per-receipt events. Focused unit test `service_lifecycle_receipt_history_excludes_latest_mirror` proves two writes load as exactly two history receipts while latest points at the second. Fresh smoke `verse-query-lifecycle-history-filter-smoke` and live overview/triage artifacts `local-20260618-145632-497-efac6f0d` / `local-20260618-145632-321-867947af` prove the compact swarm sights still report service lifecycle attention and the present elevated runbook artifact without daemon pokes or service mutation. A broad unscoped `cargo test service_lifecycle_receipt_history_excludes_latest_mirror` was abandoned after the Windows test harness fanned out across bin targets and hit a broken pipe; use `cargo test --lib service_lifecycle_receipt_history_excludes_latest_mirror` for this check. - The operator snapshot distills typed fields such as thread id, state status, coordinator action, CRRC action, reorient action, available actions, and artifact refs; it does not preserve the raw JSON status blob as internal state. JSON remains display/evidence at the edge. - Local MVP Persona front-door bubbles now route their `epiphany.cultmesh.persona_speech_audit.v0` witness into the same `.epiphany-run/cultmesh/local-verse.ccmp` store and write a final `local-verse-context.json` for MVP mode too. `Persona-bubble.stdout.json` remains display; the local Verse carries the mouth-edge eligibility receipt. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 8775f1025df6c70bc3252e3f0cb93e48bc77fb9d..10902c3579b07c4e88543064e3162359f3f35c54 100644 GIT binary patch delta 495 zcmYjNyKdA_5XH7cLlKDrQAB7YDx~$wNg%*>OB9L}0TDz&cWsZeqqXliGxx5O3M7jB z04rDd0vZqnqCylxX1wzB>`M(c4L^-n(~mu{D& zj_jc)oq>3pGtWWr5G{&v#1<;y2C&A3aaaN#W8qi$q@R9H05u>jD+0GG0n1bzRi<#e ze~3HWG{%-tvA}^d;?n!V1*$^&2qlLH-cEJ&PhUBd!U+DS>yKU}&|i6%oWItPYKRNr z&tRi4M{FTyHv^+!+2R=P1bP4JZnFNwatB^RN@IbP>!HIKTWV*Q+-hZVVwRRTKuuJ=Nt1@?ZgjeDs$EMUBDdH(JvIcR)KMP09cc#80v)*-dk4B=76^@Z!~Wx6fETmy delta 45 zcmex%m;dNZ{tXh0+(rggrY2Fx7?@u#+N{i2$jCUSc`8%;R3=6sX4*cLiP_*40D#*M A!vFvP diff --git a/state/map.yaml b/state/map.yaml index eeb97d27..350e8ce7 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -617,11 +617,11 @@ current_status: - `tools/epiphany_local_run.ps1` now uses collision-resistant local run ids (`local-YYYYMMDD-HHMMSS-fff-`) for artifact roots and operator run receipts. Same-second parallel compact wrapper proofs for `collaboration-feedback` and `bifrost-publication` produce separate artifact drawers and both complete, so operator rites no longer collide on second-resolution run ids. - `epiphany-verse-query tool-directory` and `tools/epiphany_local_run.ps1 -Mode tool-directory` provide the compact daemon tool sight organ over the same local Verse capability records used by `invoke-tool`. It returns sixteen globally available daemon-hosted capabilities, host readiness counts, agent-friendly TUI rows such as `READY | Hands | repo-action | submitHandsActionIntent | epiphany.cluster.hands.tool.repo-action | eve://epiphany/hands`, direct `invocationCommand`, wrapper `wrapperInvocationCommand=tools/epiphany_local_run.ps1 -Mode tool-invoke -ToolCapabilityId -ToolRequestingAgentId -ToolRequestingClusterId `, and the invariants `availableToAllAgents=true`, `requiresReceipt=true`, `privateStateExposed=false`. - `epiphany-verse-query cluster-topology` and `tools/epiphany_local_run.ps1 -Mode cluster-topology` provide the compact cluster/body/private-Verse/daemon sight organ over local Verse topology rows through a narrow CultMesh loader. The report returns seven clusters, seven private Verse ids, seven daemon ids, one public Persona discussion cluster, agent-friendly TUI rows such as `PUBLIC | Persona | epiphany.cluster.persona.private | repo:E:/Projects/EpiphanyAgent | epiphany-daemon-persona | eve://epiphany/persona`, and `privateStateExposed=false`; `epiphany-verse-query smoke` now source-proves the compact topology invariants. - - `epiphany-verse-query swarm-overview` and `tools/epiphany_local_run.ps1 -Mode swarm-overview` provide the one-command compact global-agent sight rite. It composes narrow cluster topology, liveness, Odin/Eve surface, daemon tool, restart-policy coverage, receipt-directory service-lifecycle attention, and the shared core service-execution audit report without full local Verse serialization, returning seven agents/daemons, seven clusters, seven private Verse ids, seven Eve surfaces, one public Persona discussion surface, sixteen globally invokable receipt-gated tools, command hints for topology/liveness/surfaces/tools/receipts/poke/connect/invoke/Bifrost-ledger/restart-policy coverage, wrapper command hints for overview/receipts/poke/connect/tool-invoke/Bifrost-ledger/service-policy-directory/service-execution-audit, sealed `toolHostAttentionRows`/TUI rows for blocked daemon-hosted capabilities, sealed `serviceLifecycleAttentionRows`/TUI rows copied from the receipt directory, `serviceExecutionFailedCheckRows`/TUI rows naming failed sealed execution checks, explicit `serviceLifecycleRecommended*` fields so service-manager follow-up remains visible even when global `recommendedWrapperMode` is occupied by liveness or policy, and ordered `swarmActionRows`/TUI rows with authority gates, effect class, mutation flag, elevation flag, sealed `operatorArtifactRef`, `operatorArtifactStatus`, and `completionAuditWrapper*` for operator-runbook rows. Current live overview `local-20260618-161718-889-7cebdcb1` returns `status=attention`, `livenessStatus=ready`, `recoveryStatus=attention`, `recommendedWrapperMode=cluster-service-execution-audit`, `serviceLifecycleRecommendedWrapperMode=cluster-service-execution-audit`, `toolHostAttentionCount=0`, `serviceLifecycleAttentionCount=2`, `swarmActionCount=2`, a non-mutating/non-elevated `priority=40` service lifecycle readback row, and a mutating/elevated `priority=50`, `family=service-execution-authority`, `status=operator-authority-required`, `effectClass=elevated-service-control`, `wrapperMode=operator-elevated-runbook`, `authorityGate=operator.elevated_windows_service_control`, `operatorArtifactStatus=present`, `operatorArtifactRef=E:\Projects\EpiphanyAgent\.epiphany-run\local-20260618-161632-376-436227d8\epiphany-cluster-daemon-services-execution-runbook.ps1`, `completionAuditWrapperMode=cluster-service-execution-audit`, `completionAuditWrapperCommand=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`, `privateStateExposed=false`, and compact `serviceExecutionFailedChecks=cluster-windows-service-execution-readiness=not-elevated; cluster-windows-service-install=planned; cluster-windows-service-start=execution-refused-not-elevated; cluster-windows-service-execution-audit=incomplete; cluster-windows-service-stop=execution-refused-not-elevated`. If that local artifact is missing, source smoke proves the same row is demoted to `status=runbook-artifact-missing`, `wrapperMode=cluster-service-execution-runbook`, `effectClass=service-lifecycle-runbook-regeneration`, `mutatesState=false`, and `requiresElevatedAuthority=false` instead of pretending elevated service authority is actionable. Degraded daemon overview still routes global recommendation to `swarm-poke-down` first while independent action rows preserve the liveness/tool-host duties; liveness action rows are explicitly mutating typed lifecycle pokes but do not require elevation, while service execution authority rows make the operator grant boundary visible. `epiphany-verse-query` now defaults to the same shared `.epiphany-run\cultmesh\local-verse.ccmp` store as the wrapper and daemon supervisor, so direct and wrapper sights read the same body. + - `epiphany-verse-query swarm-overview` and `tools/epiphany_local_run.ps1 -Mode swarm-overview` provide the one-command compact global-agent sight rite. It composes narrow cluster topology, liveness, Odin/Eve surface, daemon tool, restart-policy coverage, receipt-directory service-lifecycle attention, and the shared core service-execution audit report without full local Verse serialization, returning seven agents/daemons, seven clusters, seven private Verse ids, seven Eve surfaces, one public Persona discussion surface, sixteen globally invokable receipt-gated tools, command hints for topology/liveness/surfaces/tools/receipts/poke/connect/invoke/Bifrost-ledger/restart-policy coverage, wrapper command hints for overview/receipts/poke/connect/tool-invoke/Bifrost-ledger/service-policy-directory/service-execution-audit, sealed `toolHostAttentionRows`/TUI rows for blocked daemon-hosted capabilities, sealed `serviceLifecycleAttentionRows`/TUI rows copied from the receipt directory, `serviceExecutionFailedCheckRows`/TUI rows naming failed sealed execution checks, explicit `serviceLifecycleRecommended*` fields so service-manager follow-up remains visible even when global `recommendedWrapperMode` is occupied by liveness or policy, and ordered `swarmActionRows`/TUI rows with authority gates, effect class, mutation flag, elevation flag, sealed `operatorArtifactRef`, `operatorArtifactStatus`, `operatorArtifactExecutionCommand`, `operatorAftercareCommand`, and `completionAuditWrapper*` for operator-runbook rows. Current live overview `local-20260618-162841-275-6bc3ef3e` returns `status=attention`, `livenessStatus=ready`, `recoveryStatus=attention`, `recommendedWrapperMode=cluster-service-execution-audit`, `serviceLifecycleRecommendedWrapperMode=cluster-service-execution-audit`, `toolHostAttentionCount=0`, `serviceLifecycleAttentionCount=2`, `swarmActionCount=2`, a non-mutating/non-elevated `priority=40` service lifecycle readback row, and a mutating/elevated `priority=50`, `family=service-execution-authority`, `status=operator-authority-required`, `effectClass=elevated-service-control`, `wrapperMode=operator-elevated-runbook`, `authorityGate=operator.elevated_windows_service_control`, `operatorArtifactStatus=present`, `operatorArtifactRef=E:\Projects\EpiphanyAgent\.epiphany-run\local-20260618-161632-376-436227d8\epiphany-cluster-daemon-services-execution-runbook.ps1`, `operatorArtifactExecutionCommand=Start-Process PowerShell -Verb RunAs -Wait -ArgumentList @('-NoProfile','-ExecutionPolicy','Bypass','-File','...epiphany-cluster-daemon-services-execution-runbook.ps1')`, `operatorAftercareCommand=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`, `completionAuditWrapperMode=cluster-service-execution-audit`, `completionAuditWrapperCommand=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`, `privateStateExposed=false`, and compact `serviceExecutionFailedChecks=cluster-windows-service-execution-readiness=not-elevated; cluster-windows-service-install=planned; cluster-windows-service-start=execution-refused-not-elevated; cluster-windows-service-execution-audit=incomplete; cluster-windows-service-stop=execution-refused-not-elevated`. If that local artifact is missing, source smoke proves the same row is demoted to `status=runbook-artifact-missing`, `wrapperMode=cluster-service-execution-runbook`, `effectClass=service-lifecycle-runbook-regeneration`, `operatorArtifactExecutionCommand=none`, `operatorAftercareCommand=none`, `mutatesState=false`, and `requiresElevatedAuthority=false` instead of pretending elevated service authority is actionable. Degraded daemon overview still routes global recommendation to `swarm-poke-down` first while independent action rows preserve the liveness/tool-host duties; liveness action rows are explicitly mutating typed lifecycle pokes but do not require elevation, while service execution authority rows make the operator grant boundary visible. `epiphany-verse-query` defaults to the shared `.epiphany-run\cultmesh\local-verse.ccmp` store for live query/readback, while bare `epiphany-verse-query smoke` now uses a disposable `.epiphany-smoke\verse-query-default\local-verse.ccmp` fixture unless an explicit `--store` is provided. - `epiphany-verse-query swarm-triage` and `tools/epiphany_local_run.ps1 -Mode swarm-triage` compose the compact swarm overview with the existing brake-aware daemon poke receipt writer. Triage pokes only daemon liveness attention; service-manager lifecycle wounds are reflected from overview as sealed `serviceLifecycleAttentionRows`/TUI rows, `serviceExecutionFailedCheckRows`/TUI rows, explicit `serviceLifecycleRecommended*` fields, and ordered `swarmActionRows`, but do not cause daemon poke receipts, while blocked daemon-hosted tools ride as sealed `toolHostAttentionRows`/TUI rows so agents can see which advertised capabilities are unavailable because their host body is sick. Current live triage `local-20260618-150015-844-aba20563` returns `status=noop`, `overviewStatus=attention`, `livenessStatus=ready`, `recoveryStatus=attention`, `clusterCount=7`, `privateVerseCount=7`, `pokedDaemonCount=0`, `recommendedWrapperMode=cluster-service-execution-audit`, `serviceLifecycleRecommendedWrapperMode=cluster-service-execution-audit`, `swarmActionCount=2`, the same sealed service readback plus operator-elevated runbook rows, including `operatorArtifactStatus=present`, `operatorArtifactRef=E:\Projects\EpiphanyAgent\.epiphany-run\local-20260618-132257-139-26213a29\epiphany-cluster-daemon-services-execution-runbook.ps1`, and `completionAuditWrapperCommand=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit` on the elevated row, empty daemon/tool-host attention arrays, `serviceLifecycleAttentionCount=2`, routes `epiphany-cluster-daemon-services::cluster-windows-service-execution-audit` and `epiphany-daemon-supervisor-service::windows-service-execution-audit`, direct and wrapper command hints including `wrapperInvokeTool` and `wrapperBifrostLedger=tools/epiphany_local_run.ps1 -Mode bifrost-ledger`, and `privateStateExposed=false`; degraded Hands proof returns `status=ok`, `overviewStatus=attention`, topology and daemon TUI rows, blocked Hands-hosted tool rows, one sealed topology-aware poke receipt for `epiphany-daemon-hands` with `bodyDomain=repo:E:/Projects/EpiphanyAgent`, `privateVerseId=epiphany.cluster.hands.private`, `eveSurfaceId=eve://epiphany/hands`, `observedStatus=degraded`, `attentionDaemonIds=[epiphany-daemon-hands]`, `attentionToolHostDaemonIds=[epiphany-daemon-hands]`, and liveness/tool-host action rows with no private-state exposure. Source smoke `verse-query-service-execution-failed-checks-clean` proves a physical synthetic written runbook plus incomplete service audit receipts expose both service lifecycle readback and failed-check anatomy with no Windows service mutation. - Compact `swarmActionTuiRows` now match the JSON service-execution queue: live artifacts `local-20260618-150449-420-0371c76a` and `local-20260618-150450-027-74d864da` show `050 | service-execution-authority | operator-authority-required | operator-elevated-runbook | operator.elevated_windows_service_control | mutates=true | elevated=true | artifact=present | audit=cluster-service-execution-audit`, while the readback row stays `artifact=none | audit=none`. Source smoke `verse-query-action-tui-audit-smoke` guards this agent-friendly TUI surface. - Receipt directory rows now carry `artifactStatus` beside `artifactRef`, using the same `none` / `external-ref` / `present` / `missing` vocabulary as action rows. Live overview/triage artifacts `local-20260618-150837-267-7fbf22bb` and `local-20260618-150837-466-a6a55086` prove service-manager lifecycle attention refs classify as `external-ref` in JSON and `artifact=external-ref` in service lifecycle TUI rows; source smoke `verse-query-receipt-artifact-status-smoke` guards the compact surface. `epiphany-verse-query receipt-directory` also derives compact artifact counts (`artifactNoneCount`, `artifactExternalRefCount`, `artifactPresentCount`, `artifactMissingCount`) from rows instead of storing a second truth. Live direct readback against `.epiphany-run\cultmesh\local-verse.ccmp` and wrapper artifact `local-20260618-151656-688-a041afcc` both reported `artifactNone=13`, `artifactExternalRef=2`, `artifactPresent=2`, `artifactMissing=0`, and `privateStateExposed=false`; a clean direct empty-store readback reported all 17 rows as `artifactNone`. The earlier all-in-one `epiphany-verse-query smoke` Windows stack overflow was fixed by cutting full `query_epiphany_local_verse_context` out of `load_swarm_overview_report`; overview now reads daemon service lifecycle rows through narrow history/latest loaders. Fresh proof `verse-query-overview-slim-context-clean` passed the full smoke without stack overflow. - - Wrapper `swarm-overview` and `swarm-triage` summaries now surface lifecycle receipt `artifactStatus` plus compact service execution failed-check anatomy instead of hiding either inside JSON. Live artifact `local-20260618-155606-611-19701102` shows both service lifecycle attention rows, the operator-elevated runbook row, and `serviceExecutionFailedChecks` naming readiness/install/start/audit/stop status, while private state stays sealed. + - Wrapper `swarm-overview` and `swarm-triage` summaries now surface lifecycle receipt `artifactStatus`, operator aftercare command, and compact service execution failed-check anatomy instead of hiding them inside JSON. Live artifacts `local-20260618-162841-275-6bc3ef3e` and `local-20260618-162629-280-1e132880` show both service lifecycle attention rows, the operator-elevated runbook row, `aftercare=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`, and `serviceExecutionFailedChecks` naming readiness/install/start/audit/stop status, while private state stays sealed. - 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 the swarm-readiness cuts toward elevated operator install/start execution and completed audit/readiness for the seven installed services. Run generated service execution/install/control runbooks only when the operator grants that authority. The current local Verse proves liveness readiness, scheduler-policy coverage, daemon-body invocation, per-organ launch artifact generation, per-organ install-plan generation, non-elevated install/start/stop execution refusal, read-only installed-service audit, cluster-wide service control planning, service-lifecycle attention surfacing, and cluster execution audit acceptance criteria: `swarm-overview` now reports `status=attention`, `livenessStatus=ready`, `recoveryStatus=attention`, and `recommendedWrapperMode=cluster-service-execution-audit`; `service-tick` can refresh all seven daemon heartbeats through sealed scheduler receipts; `cluster-service-runbook` writes seven explicit `epiphany-cluster-daemon serve` commands with `privateStateExposed=false`; `cluster-service-install-plan` writes seven distinct Windows service install commands with `privateStateExposed=false`; `cluster-service-install-execute`, `cluster-service-start-execute`, and `cluster-service-stop-execute` refuse as `execution-refused-not-elevated` with `executed=false` when the shell lacks service authority; `cluster-service-start-plan` and `cluster-service-stop-plan` emit seven non-mutating planned rows; `cluster-service-audit` currently reports `incomplete` with seven missing services in this non-installed environment; `service-execution-runbook` and `cluster-service-execution-runbook` write elevated wrapper sequences that continue after per-step failure, run final audits in `finally`, exit nonzero after audit when any step failed, and seal typed runbook receipts with aftercare args (`stepFailurePolicy`, `continueAfterStepFailure`, `nonzeroExitFailsStep`, `exitsNonzeroAfterFinalAudit`); and `service-execution-audit` plus `cluster-service-execution-audit` now require those runbook witnesses before considering elevated-ready/install/start/audit/status/reconcile/stop effect receipts. Preserve the existing typed local Verse surfaces: `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-execution-audit`, `service-tick`, `service-policy-directory`, `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`, `seed-compact`, service manager status/reconcile/readiness/control wrappers, compact daemon scheduler/policy receipt rows, daemon liveness-gated tool routing, Bifrost/Imagination chains, coordinator-run receipts, Hands gates, role review mirrors, and sealed agent-state SoA summary. Keep the seven-standing-faculty SoA, stale-turn repair, memory lifecycle, shared local Verse witnesses, and typed CultMesh Persona speech gate intact. diff --git a/tools/epiphany_local_run.ps1 b/tools/epiphany_local_run.ps1 index 5fe8c4d8..6625fa53 100644 --- a/tools/epiphany_local_run.ps1 +++ b/tools/epiphany_local_run.ps1 @@ -1652,7 +1652,11 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { if ($null -eq $audit -or $audit -eq "") { $audit = "none" } - "$($_.priority):$($_.family):$($_.wrapperMode):$($_.status):mutates=$($_.mutatesState):elevated=$($_.requiresElevatedAuthority):artifactStatus=${artifactStatus}:audit=${audit}:artifact=$artifact" + $aftercare = $_.operatorAftercareCommand + if ($null -eq $aftercare -or $aftercare -eq "") { + $aftercare = "none" + } + "$($_.priority):$($_.family):$($_.wrapperMode):$($_.status):mutates=$($_.mutatesState):elevated=$($_.requiresElevatedAuthority):artifactStatus=${artifactStatus}:audit=${audit}:aftercare=${aftercare}:artifact=$artifact" }) -join "; ") } $serviceExecutionFailedChecks = "none" @@ -1706,7 +1710,11 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { if ($null -eq $audit -or $audit -eq "") { $audit = "none" } - "$($_.priority):$($_.family):$($_.wrapperMode):$($_.status):mutates=$($_.mutatesState):elevated=$($_.requiresElevatedAuthority):artifactStatus=${artifactStatus}:audit=${audit}:artifact=$artifact" + $aftercare = $_.operatorAftercareCommand + if ($null -eq $aftercare -or $aftercare -eq "") { + $aftercare = "none" + } + "$($_.priority):$($_.family):$($_.wrapperMode):$($_.status):mutates=$($_.mutatesState):elevated=$($_.requiresElevatedAuthority):artifactStatus=${artifactStatus}:audit=${audit}:aftercare=${aftercare}:artifact=$artifact" }) -join "; ") } $serviceExecutionFailedChecks = "none"