From 7515071a3f992061f61da06efb31b32e489cb32a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 18 Jun 2026 21:08:02 +0100 Subject: [PATCH] Forward swarm overview rows in wrapper --- notes/fresh-workspace-handoff.md | 2 +- state/ledgers.msgpack | Bin 266515 -> 267083 bytes state/map.yaml | 2 +- tools/epiphany_local_run.ps1 | 27 +++++++++++++++++++++++++-- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 24a8b8b3..b2a3764c 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -66,7 +66,7 @@ remembers doctrine; the branch remembers the blade. - `swarmActionTuiRows` now carry the same audit and artifact-provenance visibility as JSON rows. Fresh source smoke `verse-query-action-tui-audit-smoke` and live artifact `local-20260618-164403-238-dba797ce` prove the compact rows include `artifact=present | sha256=3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0 | audit=cluster-service-execution-audit` on the `service-execution-authority` row and `artifact=none | sha256=none | audit=none` on the readback row, while service mutation still requires explicit elevated operator authority and private state remains sealed. - Receipt directory rows now classify and hash their artifact refs. `ReceiptDirectoryRow` includes `artifactStatus` plus `artifactSha256`, receipt TUI rows append `artifact= | sha256=`, and wrapper `receipt-directory` prints compact `artifactHashes=:; ...` for present local artifacts. Fresh smoke guards present-artifact SHA-256 in receipt-directory JSON/TUI; live wrapper artifacts `local-20260618-165005-139-6188fe30` and `local-20260618-165319-478-e929d2bd` prove the cluster execution runbook hash `3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0`, the per-service execution runbook hash `b213a3c11a8f11a03061fcd743f507edaa59bc6767257b79cef63329596375e7`, and non-artifact rows `artifactSha256=none`. - `epiphany-verse-query receipt-directory` still derives compact artifact status counts: `artifactNoneCount`, `artifactExternalRefCount`, `artifactPresentCount`, and `artifactMissingCount`. Live readback reports `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. -- Wrapper `swarm-overview` and `swarm-triage` one-line summaries now include service lifecycle receipt `artifactStatus`, local runbook `sha256`, operator aftercare, and compact `serviceExecutionFailedChecks`. Failed checks now include `artifact=` and `sha256=`, hashing local file artifacts while leaving service-manager refs as `sha256=none`. Live artifacts `local-20260618-171123-940-2eebc347` and `local-20260618-171124-038-6688a1e1` show both lifecycle attention rows, the operator-elevated runbook row with `sha256=3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0`, `aftercare=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`, service-manager refs for readiness/start/audit/stop, and the historical install script artifact hashed as `c6b697e173eb319073da341fc90c2963bcd6bee63d804349205b6309c88df764`, with private state sealed. +- Wrapper `swarm-overview` and `swarm-triage` one-line summaries now forward Rust-owned compact TUI row families as `actionRows`, `daemonRows`, `toolRows` where present, `policyRows` where present, `toolAttentionRows`, `serviceAttentionRows`, and `serviceFailedCheckRows` instead of rebuilding the global sight surface in PowerShell. The older compatibility summaries still include service lifecycle receipt `artifactStatus`, local runbook `sha256`, operator aftercare, and compact `serviceExecutionFailedChecks`. Live artifacts `local-20260618-210646-478-88b58f07` and `local-20260618-210646-474-2fb504ff` show seven READY daemon rows, sixteen globally invokable receipt-gated tool rows, seven enabled restart-policy rows, two ordered service action rows, two service lifecycle attention rows, five sealed failed service-execution check rows, and `privateStateExposed=false`. - 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 2940115523699cda0504db67c1fd30533a3e6cfc..8a537f1dccdcde7252c954d6f68f6cd8af423a41 100644 GIT binary patch delta 497 zcmZ`#F>ezw6y}nfBDIa!00}**ONSg>qDyjOi`pO|b*KUiu=&pKa#noyVLQ2IX@(B` z02JNcp>w4ovC*vye}aJ-F)($iO#&N(^`1X}e&6@LPZ#ZPm+h-ZUTgRw3g6#8@E;yr z?|UCS@ALV(@p0Yo>~XdEW!>=4cI&Ud8aws(9pCqc_0J#8Ctj--H_gYZN|CZe1$tf- zL^0GLWCfX26;Tu>b8P}y38aw9q9mz-H*a5oauiZ9?)Xe-gM@<2Kw&axoH8*5lOs&I zOb7?frn#{KDkCXcI-JM~)$1HNf3|{Swm>MAl$i!DQ^JE@*c*g{ZXEQw;UF3W(J&6; zIO)e(I0Pc-e`!(B%aVQ=Wf|z)YEZC-nG_RQ=?+kW#oyjY$sPK9RZ7m%rR$-}Q8_E9 zQJ4;BR122k$QXP5H)V^yB#a|H%rTv9rW0-##RUqOj7LZBwrW;Zvr~f>-h{!IHh_hk ik%Xg-E3JRuHQP^}nEQ&t;nY58LzIC(=2$)2^T+p+UaTSj delta 48 zcmX@TOknaNfen(3T*g*LMp4HYSol9|R%R?@WZc|5m8pFy6C)6VXy)xxnON%h0D*rF A` and `sha256=`, hashing present local artifacts while leaving service-manager refs as `sha256=none`. Live artifacts `local-20260618-171123-940-2eebc347` and `local-20260618-171124-038-6688a1e1` show readiness/install/start/audit/stop failed checks with service-manager refs for external service-manager witnesses, the historical install script ref `E:\Projects\EpiphanyAgent\.epiphany-run\local-20260618-131848-558-00b94b20\epiphany-cluster-daemon-services-install.ps1`, install script SHA-256 `c6b697e173eb319073da341fc90c2963bcd6bee63d804349205b6309c88df764`, the operator-elevated runbook row with SHA-256 `3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0`, and `privateStateExposed=false`. + - Wrapper `swarm-overview` and `swarm-triage` summaries now forward the Rust-owned compact TUI row families instead of rebuilding the global sight surface in PowerShell: `actionRows`, `daemonRows`, `toolRows` where present, `policyRows` where present, `toolAttentionRows`, `serviceAttentionRows`, and `serviceFailedCheckRows`. The older compatibility summaries still surface lifecycle receipt `artifactStatus`, local runbook `sha256`, operator aftercare command, and compact service execution failed-check anatomy. Live artifacts `local-20260618-210646-478-88b58f07` and `local-20260618-210646-474-2fb504ff` prove overview/triage print seven READY daemon rows, sixteen globally invokable receipt-gated tool rows, seven enabled restart-policy rows, two ordered service action rows, two service lifecycle attention rows, five sealed failed service-execution check rows, and `privateStateExposed=false`. - 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 d99432ce..221128b0 100644 --- a/tools/epiphany_local_run.ps1 +++ b/tools/epiphany_local_run.ps1 @@ -150,6 +150,17 @@ function Format-ServiceExecutionFailedChecks { }) -join "; ") } +function Format-TuiRows { + param([object]$Rows) + + $rowList = @($Rows) + if ($null -eq $Rows -or $rowList.Count -eq 0) { + return "none" + } + + return ($rowList -join "; ") +} + Set-Location -LiteralPath $Root $Root = (Resolve-Path ".").Path $env:CARGO_TARGET_DIR = $TargetDir @@ -1782,7 +1793,14 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { }) -join "; ") } $serviceExecutionFailedChecks = Format-ServiceExecutionFailedChecks $result.serviceExecutionFailedCheckRows - Write-Host "Swarm overview: 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), actionQueue=$actionQueue, attention=$attention, toolHostAttention=$toolHostAttention, serviceLifecycleAttention=$serviceLifecycleAttention, serviceExecutionFailedChecks=$serviceExecutionFailedChecks, privateStateExposed=$($result.privateStateExposed)" + $actionRows = Format-TuiRows $result.swarmActionTuiRows + $toolAttentionRows = Format-TuiRows $result.toolHostAttentionTuiRows + $serviceAttentionRows = Format-TuiRows $result.serviceLifecycleAttentionTuiRows + $serviceFailedCheckRows = Format-TuiRows $result.serviceExecutionFailedCheckTuiRows + $daemonRows = Format-TuiRows $result.daemonTuiRows + $toolRows = Format-TuiRows $result.toolTuiRows + $policyRows = Format-TuiRows $result.policyTuiRows + Write-Host "Swarm overview: 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), 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 "service-policy-directory") { $policyRows = "none" if ($null -ne $result.rows -and $result.rows.Count -gt 0) { @@ -1849,7 +1867,12 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { }) -join "; ") } $serviceExecutionFailedChecks = Format-ServiceExecutionFailedChecks $result.serviceExecutionFailedCheckRows - Write-Host "Swarm triage: status=$($result.status), overview=$($result.overviewStatus), liveness=$($result.livenessStatus), recovery=$($result.recoveryStatus), clusters=$($result.clusterCount), privateVerses=$($result.privateVerseCount), recommended=$($result.recommendedWrapperMode), serviceRecommended=$($result.serviceLifecycleRecommendedWrapperMode), actionQueue=$actionQueue, attention=$attention, toolHostAttention=$toolHostAttention, serviceLifecycleAttention=$serviceLifecycleAttention, serviceExecutionFailedChecks=$serviceExecutionFailedChecks, poked=$($result.pokedDaemonCount), privateStateExposed=$($result.privateStateExposed)" + $actionRows = Format-TuiRows $result.swarmActionTuiRows + $toolAttentionRows = Format-TuiRows $result.toolHostAttentionTuiRows + $serviceAttentionRows = Format-TuiRows $result.serviceLifecycleAttentionTuiRows + $serviceFailedCheckRows = Format-TuiRows $result.serviceExecutionFailedCheckTuiRows + $daemonRows = Format-TuiRows $result.daemonTuiRows + Write-Host "Swarm triage: status=$($result.status), overview=$($result.overviewStatus), liveness=$($result.livenessStatus), recovery=$($result.recoveryStatus), clusters=$($result.clusterCount), privateVerses=$($result.privateVerseCount), recommended=$($result.recommendedWrapperMode), serviceRecommended=$($result.serviceLifecycleRecommendedWrapperMode), actionQueue=$actionQueue, actionRows=$actionRows, attention=$attention, daemonRows=$daemonRows, toolHostAttention=$toolHostAttention, toolAttentionRows=$toolAttentionRows, serviceLifecycleAttention=$serviceLifecycleAttention, serviceAttentionRows=$serviceAttentionRows, serviceExecutionFailedChecks=$serviceExecutionFailedChecks, serviceFailedCheckRows=$serviceFailedCheckRows, poked=$($result.pokedDaemonCount), privateStateExposed=$($result.privateStateExposed)" } elseif ($Mode -eq "service-runbook") { Write-Host "Service runbook: service=$($result.serviceId), receipt=$($result.receiptId), path=$($result.runbookPath)" } elseif ($Mode -eq "cluster-service-runbook") {