From a7060a893e6e7ca251d7639647478363b7324754 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 18 Jun 2026 21:50:28 +0100 Subject: [PATCH] Aggregate service execution failed checks --- epiphany-core/src/bin/epiphany-verse-query.rs | 41 +++++++++++++++--- notes/fresh-workspace-handoff.md | 2 +- state/ledgers.msgpack | Bin 270686 -> 271208 bytes state/map.yaml | 2 +- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 5821a881..6d709099 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -38,6 +38,7 @@ use epiphany_core::epiphany_cultmesh_daemon_tool_invocation_receipt_for_intent; use epiphany_core::epiphany_cultmesh_eve_connection_intent_from_advertisement; use epiphany_core::epiphany_cultmesh_eve_connection_receipt_for_intent; use epiphany_core::epiphany_cultmesh_imagination_consensus_receipt_for_feedback; +use epiphany_core::epiphany_service_execution_audit_report; use epiphany_core::load_agent_state_soa_entry; use epiphany_core::load_epiphany_cultmesh_cluster_topology; use epiphany_core::load_epiphany_cultmesh_daemon_liveness; @@ -2567,13 +2568,26 @@ fn main() -> Result<()> { && !check.ok && check.private_state_sealed }) + || !service_overview + .service_execution_failed_check_rows + .iter() + .any(|check| { + check.action == "windows-service-execution-readiness" + && check.observed_status.is_none() + && !check.ok + && check.private_state_sealed + }) || !service_overview .service_execution_failed_check_tui_rows .iter() .any(|row| row.contains("cluster-windows-service-execution-audit=incomplete")) + || !service_overview + .service_execution_failed_check_tui_rows + .iter() + .any(|row| row.contains("windows-service-execution-readiness=missing")) { anyhow::bail!( - "local Verse query smoke did not expose sealed service lifecycle readback plus service execution failed-check anatomy" + "local Verse query smoke did not expose sealed service lifecycle readback plus cluster and service execution failed-check anatomy" ); } let missing_runbook_row = ReceiptDirectoryRow { @@ -3990,11 +4004,26 @@ fn load_swarm_overview_report(args: &Args) -> Result { .filter(|receipt| receipt.service_id == "epiphany-cluster-daemon-services") .cloned() .collect::>(); - let service_execution_audit = + let single_service_lifecycle_receipts = lifecycle_receipts + .iter() + .filter(|receipt| receipt.service_id != "epiphany-cluster-daemon-services") + .cloned() + .collect::>(); + let cluster_service_execution_audit = epiphany_cluster_service_execution_audit_report(&cluster_lifecycle_receipts); - let service_execution_failed_check_rows = service_execution_audit + let single_service_execution_audit = + epiphany_service_execution_audit_report(&single_service_lifecycle_receipts); + let service_execution_failed_check_count = + cluster_service_execution_audit.failed_count + single_service_execution_audit.failed_count; + let service_execution_missing_check_count = cluster_service_execution_audit.missing_count + + single_service_execution_audit.missing_count; + let service_execution_private_state_exposed = cluster_service_execution_audit + .private_state_exposed + || single_service_execution_audit.private_state_exposed; + let service_execution_failed_check_rows = cluster_service_execution_audit .checks .iter() + .chain(single_service_execution_audit.checks.iter()) .filter(|check| !check.ok || !check.private_state_sealed) .cloned() .collect::>(); @@ -4126,7 +4155,7 @@ fn load_swarm_overview_report(args: &Args) -> Result { .any(|row| row.private_state_exposed) || tool_report.rows.iter().any(|row| row.private_state_exposed) || policy_report.private_state_exposed - || service_execution_audit.private_state_exposed + || service_execution_private_state_exposed || service_lifecycle_rows .iter() .any(|row| row.private_state_exposed); @@ -4148,8 +4177,8 @@ fn load_swarm_overview_report(args: &Args) -> Result { tool_host_attention_tui_rows, service_lifecycle_attention_rows, service_lifecycle_attention_tui_rows, - service_execution_failed_check_count: service_execution_audit.failed_count, - service_execution_missing_check_count: service_execution_audit.missing_count, + service_execution_failed_check_count, + service_execution_missing_check_count, service_execution_failed_check_rows, service_execution_failed_check_tui_rows, topology_report, diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index fde4997f..be2efcfb 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -67,7 +67,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 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`. +- 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`. Live artifact `local-20260618-214854-896-79b9190b` proves the Rust overview now aggregates cluster and single-service execution audit failed-check anatomy together: cluster readiness/install/start/audit/stop plus single-service readiness/install/start/reconcile/stop rows are visible without service mutation or private-state exposure. - 2026-06-18: `swarm-overview` action rows now enumerate every sealed service-lifecycle attention receipt instead of only the selected global recommendation. Each non-mutating readback row carries the receipt's service-manager artifact ref/status/hash/private flag; live wrapper proof `local-20260618-214044-049-a63d008c` printed priority 40 `cluster-service-execution-audit` with `artifactStatus=external-ref`, `sha256=none`, and `artifact=service-manager://windows/epiphany-cluster-daemon-services/cluster-execution-audit`, priority 41 `service-execution-audit` with `artifactStatus=external-ref`, `sha256=none`, and `artifact=service-manager://windows/epiphany-daemon-supervisor-service/execution-audit`, and the priority-50 elevated runbook row unchanged. - 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. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 13593d7925ff5b624eb3b9a530e1c33b1bfe819d..4b344012125256ebba27df079feebd1091cfbded 100644 GIT binary patch delta 358 zcmYLEF;2rk5X3%H(L^EwEF`oc6f_P_LPDIL7lew=u{X{svCp|X$5b>Fe1PZ#6(}D- zP#`2EB#H>WfDm;GDqg^a0*alLMmsY*pD%^^tZ=(wtTf!VTR)yHS=)#AWn*L*PiGVJ zd}11U7MnawOzUl{c=1?sYfZ;(I@Q)u&22Aqs(NRx!@Kd($$cIJ8zUc6%pqYp_))|$ z@+AsYdL^r>Fek-j=y4V+8?4ffpM_Kc$CPm?D$rpW4-iDm2B_IlM!8l#UlLoDzDUtV zKcoo?0X?4%F?51H1_R(MSJz3 zv@xWb20@c(h>p6N5~y