From 5daa00ffa8321937774d0c55e419444e858e1a78 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 18 Jun 2026 17:12:52 +0100 Subject: [PATCH] Expose failed-check artifact refs in swarm summaries --- notes/fresh-workspace-handoff.md | 2 +- state/ledgers.msgpack | Bin 260085 -> 260515 bytes state/map.yaml | 2 +- tools/epiphany_local_run.ps1 | 47 ++++++++++++++++++------------- 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 13498186..58cac62c 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`. Live artifacts `local-20260618-163530-102-7d2c8969` and `local-20260618-163531-412-0ada43a3` show both lifecycle attention rows, the operator-elevated runbook row with `sha256=3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0`, `aftercare=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit`, and 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`, 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. - 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 377531284af10807afdf54ba2e7b2c0546826cb1..f22bec1b1fbf04d4a259c2403b7ec368333572a3 100644 GIT binary patch delta 408 zcmZ9HF-yZx5XVg;I0$wU1Q8D$oE|2xHH{SnH*xLe2lX2`YtUNeU7a8O1D0DY^pP z&vR6QG!(M3lS(imAdFHlx8->I!(AU@KNbe&{H_LRHPA=}sEn|*0YwR55d%W+` 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`. - 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 26376b60..8bb7c25f 100644 --- a/tools/epiphany_local_run.ps1 +++ b/tools/epiphany_local_run.ps1 @@ -125,6 +125,31 @@ function Invoke-Checked { } } +function Format-ServiceExecutionFailedChecks { + param([object]$Rows) + + $rowList = @($Rows) + if ($null -eq $Rows -or $rowList.Count -eq 0) { + return "none" + } + + return (($rowList | ForEach-Object { + $observed = $_.observedStatus + if ($null -eq $observed -or $observed -eq "") { + $observed = "missing" + } + $artifact = $_.operatorArtifactRef + if ($null -eq $artifact -or $artifact -eq "") { + $artifact = "none" + } + $artifactSha256 = "none" + if ($artifact -ne "none" -and (Test-Path -LiteralPath $artifact -PathType Leaf)) { + $artifactSha256 = (Get-FileHash -LiteralPath $artifact -Algorithm SHA256).Hash.ToLowerInvariant() + } + "$($_.action)=${observed}:artifact=${artifact}:sha256=${artifactSha256}" + }) -join "; ") +} + Set-Location -LiteralPath $Root $Root = (Resolve-Path ".").Path $env:CARGO_TARGET_DIR = $TargetDir @@ -1676,16 +1701,7 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { "$($_.priority):$($_.family):$($_.wrapperMode):$($_.status):mutates=$($_.mutatesState):elevated=$($_.requiresElevatedAuthority):artifactStatus=${artifactStatus}:sha256=${artifactSha256}:audit=${audit}:aftercare=${aftercare}:artifact=$artifact" }) -join "; ") } - $serviceExecutionFailedChecks = "none" - if ($null -ne $result.serviceExecutionFailedCheckRows -and $result.serviceExecutionFailedCheckRows.Count -gt 0) { - $serviceExecutionFailedChecks = (($result.serviceExecutionFailedCheckRows | ForEach-Object { - $observed = $_.observedStatus - if ($null -eq $observed -or $observed -eq "") { - $observed = "missing" - } - "$($_.action)=${observed}" - }) -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)" } elseif ($Mode -eq "service-policy-directory") { Write-Host "Service policy directory: status=$($result.status), daemons=$($result.daemonCount), covered=$($result.coveredCount), enabled=$($result.enabledCount), disabled=$($result.disabledCount), missing=$($result.missingCount), attention=$($result.attentionCount), privateStateExposed=$($result.privateStateExposed)" @@ -1738,16 +1754,7 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { "$($_.priority):$($_.family):$($_.wrapperMode):$($_.status):mutates=$($_.mutatesState):elevated=$($_.requiresElevatedAuthority):artifactStatus=${artifactStatus}:sha256=${artifactSha256}:audit=${audit}:aftercare=${aftercare}:artifact=$artifact" }) -join "; ") } - $serviceExecutionFailedChecks = "none" - if ($null -ne $result.serviceExecutionFailedCheckRows -and $result.serviceExecutionFailedCheckRows.Count -gt 0) { - $serviceExecutionFailedChecks = (($result.serviceExecutionFailedCheckRows | ForEach-Object { - $observed = $_.observedStatus - if ($null -eq $observed -or $observed -eq "") { - $observed = "missing" - } - "$($_.action)=${observed}" - }) -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)" } elseif ($Mode -eq "service-runbook") { Write-Host "Service runbook: service=$($result.serviceId), receipt=$($result.receiptId), path=$($result.runbookPath)"