From d54215890eb83dbe56638b79ff7e1bd476a6c91b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 18 Jun 2026 18:07:29 +0100 Subject: [PATCH] Expose poke receipt rows --- epiphany-core/src/bin/epiphany-verse-query.rs | 33 ++++++++++++++++++ notes/fresh-workspace-handoff.md | 2 +- state/ledgers.msgpack | Bin 263549 -> 264003 bytes state/map.yaml | 2 +- tools/epiphany_local_run.ps1 | 6 +++- 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index d56b5935..a0e39dc0 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -695,6 +695,7 @@ fn main() -> Result<()> { )?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; let pokes = write_poke_receipts_for_non_ready_daemons(&args, &context)?; + let poke_tui_rows = pokes.iter().map(poke_result_tui_row).collect::>(); let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; println!( "{}", @@ -705,6 +706,8 @@ fn main() -> Result<()> { "observedDaemonCount": context.daemon_statuses.len(), "pokedDaemonCount": pokes.len(), "pokes": pokes, + "pokeRows": poke_tui_rows, + "tuiRows": poke_tui_rows, "privateStateExposed": false, }))? ); @@ -1943,6 +1946,19 @@ fn main() -> Result<()> { "local Verse query smoke batch daemon poke had the wrong target/status/topology/private-state guard" ); } + let batch_poke_tui_row = poke_result_tui_row(&batch_pokes[0]); + if !batch_poke_tui_row.contains("POKE") + || !batch_poke_tui_row.contains("Hands") + || !batch_poke_tui_row.contains("epiphany-daemon-hands") + || !batch_poke_tui_row.contains("privateVerse=epiphany.cluster.hands.private") + || !batch_poke_tui_row.contains("surface=eve://epiphany/hands") + || !batch_poke_tui_row.contains("receipt=daemon-poke-receipt-") + || !batch_poke_tui_row.contains("private=false") + { + anyhow::bail!( + "local Verse query smoke batch daemon poke lost compact row topology/receipt/private-state fields" + ); + } let triage_overview = load_swarm_overview_report(&args)?; let triage_pokes = if triage_overview.liveness_status == "ready" { Vec::new() @@ -5194,6 +5210,23 @@ fn write_poke_receipts_for_non_ready_daemons( Ok(pokes) } +fn poke_result_tui_row(row: &serde_json::Value) -> String { + let target_display_name = row["targetDisplayName"].as_str().unwrap_or("unknown"); + let target_daemon_id = row["targetDaemonId"].as_str().unwrap_or("unknown"); + let observed_status = row["observedStatus"].as_str().unwrap_or("unknown"); + let body_domain = row["bodyDomain"].as_str().unwrap_or("unknown"); + let private_verse_id = row["privateVerseId"].as_str().unwrap_or("unknown"); + let eve_surface_id = row["eveSurfaceId"].as_str().unwrap_or("unknown"); + let intent_id = row["intentId"].as_str().unwrap_or("unknown"); + let receipt_id = row["receiptId"].as_str().unwrap_or("unknown"); + let receipt_status = row["receiptStatus"].as_str().unwrap_or("unknown"); + let resulting_status = row["resultingStatus"].as_str().unwrap_or("unknown"); + let private_state_exposed = row["privateStateExposed"].as_bool().unwrap_or(false); + format!( + "POKE | {target_display_name} | {target_daemon_id} | observed={observed_status} | body={body_domain} | privateVerse={private_verse_id} | surface={eve_surface_id} | intent={intent_id} | receipt={receipt_id} | receiptStatus={receipt_status} | result={resulting_status} | private={private_state_exposed}" + ) +} + fn sanitize_id(value: &str) -> String { value .chars() diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 1d64a8ae..577989d9 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -48,7 +48,7 @@ remembers doctrine; the branch remembers the blade. - `tools/epiphany_local_run.ps1 -Mode service-tick` is now the first-class local wrapper for one daemon-supervisor scheduler pulse. It runs through operator run intent/receipt, agent-state SoA refresh, local Verse brake preflight, and `epiphany-daemon-supervisor tick`, while restart authority remains in durable per-daemon policies. Proof seeded one disabled Persona policy as inert metadata, then wrapper artifact `local-20260618-075902-006-e2915574` wrote scheduler receipt `daemon-scheduler-receipt-epiphany-daemon-supervisor-0` with `tickComplete`, `outcomeCount=1`, `skippedCount=1`, `restartedCount=0`, `refusedCount=0`, and `privateStateExposed=false`. - `epiphany-cluster-daemon` is the first real per-cluster daemon heartbeat body. It runs as a narrow Rust binary parameterized by daemon id, publishes typed `epiphany.cultmesh.daemon_status.v0` heartbeats into `.epiphany-run\cultmesh\local-verse.ccmp`, can run once or loop, and exposes no private state. Durable restart policies for Self, Hands, Persona, Imagination, Eyes, Modeling, and Soul now invoke `epiphany-cluster-daemon heartbeat`, not the generic `epiphany-verse-query daemon-status` debug writer. A degraded proof via `service-tick` showed the supervisor invoking all seven daemon bodies and restoring ready liveness with sealed receipts; follow-up service tick no-ops when heartbeats are fresh. `epiphany-daemon-supervisor cluster-service-runbook` and `tools/epiphany_local_run.ps1 -Mode cluster-service-runbook` write a non-mutating service runbook plus `daemon_service_lifecycle` receipt for all seven organ daemon `epiphany-cluster-daemon serve` commands. `epiphany-daemon-supervisor cluster-service-install-plan` and `tools/epiphany_local_run.ps1 -Mode cluster-service-install-plan` write a non-mutating Windows install script plus lifecycle receipt for seven distinct per-organ Windows services. `tools/epiphany_local_run.ps1 -Mode cluster-service-install-execute` requests execution through the same typed path and, in non-elevated shells, writes `execution-refused-not-elevated` with `executed=false` instead of mutating services. `epiphany-daemon-supervisor cluster-service-audit` and wrapper `-Mode cluster-service-audit` read Windows service-manager state for those seven expected service names; current local proof reports seven missing services and `status=incomplete`. `epiphany-daemon-supervisor cluster-service-start`/`cluster-service-stop` and wrapper modes `cluster-service-start-plan`, `cluster-service-stop-plan`, `cluster-service-start-execute`, and `cluster-service-stop-execute` record lifecycle receipts for all seven expected services; plan modes emit seven planned rows, and execute modes refuse without elevation before mutation. `cluster-service-execution-runbook` writes the admin-gated elevated wrapper sequence starting with cluster-native readiness, then uses `Invoke-EpiphanyRunbookStep` so each install/start/audit/stop step resets `$LASTEXITCODE`, catches thrown/nonzero failures, keeps running to gather more lifecycle receipts, and always runs `cluster-service-execution-audit` from `finally`; the wrapper asks `epiphany-daemon-supervisor cluster-service-execution-runbook` to seal the generated artifact as a typed `daemon_service_lifecycle` receipt with action `cluster-windows-service-execution-runbook`, status `written`, final audit metadata, step-failure policy metadata, and `privateStateExposed=false`. Its JSON and typed receipt args expose `runbookTryModes`, `finalAuditMode`, `finalAuditRunsInFinally=true`, `stepFailurePolicy=continue-after-step-failure`, `continueAfterStepFailure=true`, `nonzeroExitFailsStep=true`, and `exitsNonzeroAfterFinalAudit=true`, and the compact operator line prints those same aftercare facts. Latest proof `local-20260618-161632-376-436227d8` generated and parsed the robust cluster artifact. Cluster execution audit now requires that runbook witness before considering the elevated readiness/install/start/audit/stop effect chain. Current live audit remains correctly `incomplete` until an elevated operator run produces successful effect receipts. `tools/epiphany_local_run.ps1` builds and requires `epiphany-cluster-daemon` for service modes. - `epiphany-verse-query restart-policy-directory` and `tools/epiphany_local_run.ps1 -Mode service-policy-directory` are the compact scheduler coverage sight rite. They report each daemon's durable restart-policy coverage as `ENABLED`, `DISABLED`, or `MISSING` through a narrow CultMesh restart-policy directory loader without writing policies or commands. Compact rows now include cooldown, reconcile interval, heartbeat stale threshold, failure count, last result, `followUp=`, and `private=false`; the wrapper summary prints all seven policy rows with the `service-tick` follow-up. Disabled policies count as recovery attention, not harmless coverage. Live wrapper artifact `local-20260618-175008-830-e470a387` returned `status=ok`, seven daemons, seven covered policies, seven enabled policies, zero disabled, zero missing, zero attention rows, `last=ready`, `reconcile=60s`, `stale=300s`, and `privateStateExposed=false`. This is real daemon heartbeat coverage, not yet an installed per-organ OS service. -- `epiphany-verse-query poke-down-daemons` and `tools/epiphany_local_run.ps1 -Mode swarm-poke-down` are the current typed "if a service is down, poke it" reflex. They inspect local Verse daemon status rows, write daemon poke intent/receipt documents for every non-ready daemon, respect the same `daemon.lifecycle_poke` swarm brake as single-daemon poke, include target display name/body domain/private Verse id/Eve surface metadata from cluster topology in the operator-safe poke summary, and expose no private state. Verified: live local Verse had seven ready daemons and produced a no-op operator receipt with `pokedDaemonCount=0`; a temp degraded Hands store produced one topology-aware poke receipt; a temp lifecycle brake refused the batch poke; and `epiphany-verse-query smoke` now source-proves the ready no-op plus degraded single-poke path. +- `epiphany-verse-query poke-down-daemons` and `tools/epiphany_local_run.ps1 -Mode swarm-poke-down` are the current typed "if a service is down, poke it" reflex. They inspect local Verse daemon status rows, write daemon poke intent/receipt documents for every non-ready daemon, respect the same `daemon.lifecycle_poke` swarm brake as single-daemon poke, include target display name/body domain/private Verse id/Eve surface metadata from cluster topology in the operator-safe poke summary, and expose no private state. Compact poke rows now print target, daemon id, observed status, body domain, private Verse, Eve surface, intent id, receipt id/status, resulting status, and `private=false`. Verified: live artifact `local-20260618-180548-293-ff73f9de` temporarily degraded Hands and printed one topology-aware compact poke row; live artifact `local-20260618-180618-002-06e77583` then proved the restored swarm had seven ready daemons and zero non-ready rows; a temp lifecycle brake refused the batch poke; and `epiphany-verse-query smoke` source-proves the ready no-op plus degraded single-poke compact row path. - CultMesh now carries the CultCache SoA ergonomic instead of forcing callers to bypass the mesh node. `CultMeshNode::soa()` returns typed SoA tables for registered documents; the CultMesh crate proves the generic path, and Epiphany's agent-state summary test proves local Verse can project sealed `epiphany.cultmesh.agent_state_soa_summary.v0` rows through SoA columns. The seven-row persisted agent-state SoA remains owned by the agent memory store and mirrored into local Verse only as a private-state-sealed summary. `epiphany-verse-query agent-state-report` and `tools/epiphany_local_run.ps1 -Mode agent-state-soa` now expose that mirrored summary as compact TUI/JSON rows from CultMesh SoA columns without full local Verse serialization; compact rows include role id, agent id, profile kind, portable contract, memory/goal/value counts, and `private=false`. Live wrapper proof `local-20260618-175913-074-b22ff01c` returned `agents=7`, `summaryRows=2`, printed all seven faculties in `agentRows`, and kept `privateStateExposed=False`. - `epiphany-verse-query swarm-status` and `tools/epiphany_local_run.ps1 -Mode swarm-status` are the compact read-only liveness surface for the daemon swarm. They use a narrow CultMesh daemon-liveness loader instead of serializing the full local Verse context, return agent-friendly `READY`/`POKE` TUI rows with daemon id, body domain, private Verse id, Eve surface, and `followUp=tools/epiphany_local_run.ps1 -Mode swarm-poke-down`, and expose no private state. Verified: live wrapper artifact `local-20260618-175408-868-81ad22c0` saw seven ready daemons and printed each daemon's private Verse plus Eve surface; a temp degraded Hands report returns `attention`, `nonReadyCount=1`, and a `POKE` row with `privateVerse=epiphany.cluster.hands.private`; `epiphany-verse-query smoke` source-proves ready and degraded report paths. - `epiphany-verse-query cluster-topology` and `tools/epiphany_local_run.ps1 -Mode cluster-topology` are the compact read-only topology surface for the standing swarm. They use a narrow CultMesh cluster-topology loader, return seven clusters, seven private Verse ids, seven daemon ids, one public Persona discussion cluster, and `privateStateExposed=false`. Verified: direct proof returned `PUBLIC | Persona | epiphany.cluster.persona.private | repo:E:/Projects/EpiphanyAgent | epiphany-daemon-persona | eve://epiphany/persona`; `epiphany-verse-query smoke` source-proves the compact topology invariants; wrapper proof produced `clusters=7`, `privateVerses=7`, `daemons=7`, `publicDiscussion=1`. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 035d83fdf309f3b150da07fe6d9996cf1b796f9f..009698310bd9fa07626fecb79704f374606a2b03 100644 GIT binary patch delta 424 zcmX|-F-yZh7=}$69Gr?E*rD)&;FQ>FVw+TO6xi`#roo>xcH|WBavZ?Sv;Jxc=I5w&Cr-np)P&-O9dS*_Ju= zY`w2+=f~cC`tXTA^vKZbN0)uG6jsx3tJ{9QSWsC&DQ?hXV!^AP?R0LD#uL!X5*aXx zh2Tv9G?gi8ck`Dq7sObhoSU4|RL_(PW5JfdL_ss|LMgL3)d*K86}oUXM^H1F(AYdO zu90h~ArfQE%KF}GFo%XCQO$Cl@${ceIokkF6Phcmh~?~6`MTA;jmY3Q^88WYB}o`0 zBZi={D21dl%S|6lC1s}Nxq&G7BbfpW1UFGpid>{ij~W>WQY>816XcMKnC4z>jtu*e gQP&JYd?OOWa1aG`Pc8OkZ2;$HMIx;QG}hG7FQ&YX5&!@I delta 48 zcmX@yC-ApRV1pzhmw}auVbn1O7M7^Z%8Z4KjBA>wGPO@-VgzCk&Afdo6Uz%G0C%zu A$^ZZW diff --git a/state/map.yaml b/state/map.yaml index 46651baf..59010dd7 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -602,7 +602,7 @@ current_status: rebuilds stale coordinator/app-server binaries before using them. - `tools/epiphany_local_run.ps1 -Mode service-execution-runbook` is the repeatable elevated Windows service proof artifact generator. It writes a non-mutating `#Requires -RunAsAdministrator` PowerShell runbook containing the exact `service-execution-readiness`, `service-install-execute`, `service-start-execute`, `service-status`, `service-reconcile`, `service-stop-execute`, final `service-status`, and `service-execution-audit` wrapper calls, so the remaining elevated service proof can run through typed operator and lifecycle receipts instead of improvised `sc.exe` rites. The artifact now uses `Invoke-EpiphanyRunbookStep` to reset `$LASTEXITCODE`, catch thrown/nonzero failures, continue gathering receipts after a failed step, run final `service-execution-audit` in `finally`, and exit nonzero only after audit if any step failed. Latest proof `local-20260618-160641-685-331af57c` generated and parsed the single-service artifact. - `epiphany-daemon-supervisor windows-service-execution-audit` and `tools/epiphany_local_run.ps1 -Mode service-execution-audit` are the post-run service proof verifier. The audit scans typed `epiphany.cultmesh.daemon_service_lifecycle_receipt.v0` documents for a service, first requires the sealed `windows-service-execution-runbook` receipt as the non-mutating preflight witness, then checks readiness/install/start/status/reconcile/stop receipt statuses, requires private-state sealing, writes its own `windows-service-execution-audit` lifecycle receipt, and returns `complete` only when the runbook plus elevated effect receipts prove the chain. Audit check rows now retain `operatorArtifactRef` from lifecycle receipts, so runbook witnesses can be identified without opening raw receipt payloads. `service-execution-audit-smoke` now writes synthetic sealed lifecycle receipts to prove the audit accepts a complete chain and then rejects a drifted reconcile receipt. Live wrapper proof `local-20260618-133559-466-6644f26f` reported the runbook witness as `written` and OK while six elevated effect receipts remained missing, preserving the elevated authority boundary. - - `epiphany-verse-query poke-down-daemons` and `tools/epiphany_local_run.ps1 -Mode swarm-poke-down` are the typed swarm responsibility reflex: inspect local Verse daemon status rows, write daemon poke intent/receipt documents for every non-ready daemon, respect the `daemon.lifecycle_poke` swarm brake, include target display name/body domain/private Verse id/Eve surface metadata from cluster topology in the operator-safe poke summary, and expose no private state. Live local Verse currently reports seven ready daemons, so the wrapper proof correctly produced a no-op operator receipt with `pokedDaemonCount=0`; temp degraded Hands proof produced one topology-aware poke receipt; and `epiphany-verse-query smoke` now source-proves both the ready no-op and degraded single-poke path. + - `epiphany-verse-query poke-down-daemons` and `tools/epiphany_local_run.ps1 -Mode swarm-poke-down` are the typed swarm responsibility reflex: inspect local Verse daemon status rows, write daemon poke intent/receipt documents for every non-ready daemon, respect the `daemon.lifecycle_poke` swarm brake, include target display name/body domain/private Verse id/Eve surface metadata from cluster topology in the operator-safe poke summary, and expose no private state. Compact poke rows now print each poke target, daemon id, observed status, body domain, private Verse, Eve surface, intent id, receipt id/status, resulting status, and `private=false`; live wrapper proof `local-20260618-180548-293-ff73f9de` temporarily degraded Hands, printed one topology-aware receipt row, and restored Hands to ready; follow-up swarm status proof `local-20260618-180618-002-06e77583` reported seven ready daemons and zero non-ready rows. `epiphany-verse-query smoke` source-proves both the ready no-op and degraded single-poke compact row path. - `epiphany-verse-query swarm-status` and `tools/epiphany_local_run.ps1 -Mode swarm-status` provide the compact read-only liveness sight organ over local Verse daemon rows. It uses a narrow CultMesh daemon-liveness loader instead of serializing the full local Verse context, returns seven agent-friendly TUI rows with `READY`/`POKE`, daemon id, body domain, private Verse id, Eve surface, `followUp=tools/epiphany_local_run.ps1 -Mode swarm-poke-down`, and `private=false`, and exposes no private state. Live wrapper proof `local-20260618-175408-868-81ad22c0` printed all seven ready daemon rows with private Verse ids, Eve surfaces, and the batch poke follow-up; source smoke also proves degraded Hands returns a `POKE` row with `privateVerse=epiphany.cluster.hands.private` plus the same follow-up command. - `epiphany-verse-query eve-surfaces` and `tools/epiphany_local_run.ps1 -Mode eve-surfaces` provide the compact read-only Odin/Eve surface directory over local Verse rows. Odin reads cluster topology, default advertisements, and daemon-owned Eve surface states through a narrow CultMesh loader; it returns seven agent-friendly TUI rows, one Persona public discussion surface, a `connect-eve` command hint, and `privateStateExposed=false` without serializing the full local Verse. The compact TUI rows now expose surface id, daemon id, body domain, private Verse id, public-discussion flag, supported actions, exposed document types, advertisement id, and `private=false`; wrapper proof `local-20260618-173318-552-420d6d66` prints `publicSurfaces=Persona=eve://epiphany/persona@epiphany.cluster.persona.private` plus the connection command in one line. - `epiphany-verse-query connect-eve` and `tools/epiphany_local_run.ps1 -Mode eve-connect` provide the compact Odin-to-Eve collaboration receipt. The command selects the daemon-published surface through the narrow Eve directory, writes connection intent/receipt documents, verifies latest receipt keys through narrow CultMesh loaders, defaults the wrapper target to `epiphany.cluster.persona`, and exposes no private state. diff --git a/tools/epiphany_local_run.ps1 b/tools/epiphany_local_run.ps1 index ca6c121b..29ffd322 100644 --- a/tools/epiphany_local_run.ps1 +++ b/tools/epiphany_local_run.ps1 @@ -1760,7 +1760,11 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { } 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), policyRows=$policyRows, privateStateExposed=$($result.privateStateExposed)" } elseif ($Mode -eq "swarm-poke-down") { - Write-Host "Swarm poke down: status=$($result.status), observed=$($result.observedDaemonCount), poked=$($result.pokedDaemonCount), privateStateExposed=$($result.privateStateExposed)" + $pokeRows = "none" + if ($null -ne $result.pokeRows -and $result.pokeRows.Count -gt 0) { + $pokeRows = ($result.pokeRows -join "; ") + } + Write-Host "Swarm poke down: status=$($result.status), observed=$($result.observedDaemonCount), poked=$($result.pokedDaemonCount), pokeRows=$pokeRows, privateStateExposed=$($result.privateStateExposed)" } elseif ($Mode -eq "swarm-triage") { $attention = "none" if ($null -ne $result.attentionDaemonIds -and $result.attentionDaemonIds.Count -gt 0) {