Expose poke receipt rows

This commit is contained in:
Meta Vens 2026-06-18 18:07:29 +01:00
commit d54215890e
5 changed files with 40 additions and 3 deletions

View file

@ -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::<Vec<_>>();
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()