From cd136045d837c54048fadfa87fc43134ad374eac Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 18 Jun 2026 22:16:19 +0100 Subject: [PATCH] Scope service runbook authority rows --- epiphany-core/src/bin/epiphany-verse-query.rs | 375 +++++++++++------- notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 272946 -> 273411 bytes state/map.yaml | 2 +- 4 files changed, 242 insertions(+), 136 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index e14af957..7717b861 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -2329,6 +2329,9 @@ fn main() -> Result<()> { let service_smoke_runbook_path = args .store .with_file_name("epiphany-cluster-daemon-services-execution-runbook-smoke.ps1"); + let service_smoke_single_runbook_path = args + .store + .with_file_name("epiphany-daemon-supervisor-service-execution-runbook-smoke.ps1"); if let Some(parent) = service_smoke_runbook_path.parent() { fs::create_dir_all(parent).with_context(|| { format!( @@ -2347,6 +2350,16 @@ fn main() -> Result<()> { service_smoke_runbook_path.display() ) })?; + fs::write( + &service_smoke_single_runbook_path, + "# synthetic single-service execution runbook smoke artifact\n", + ) + .with_context(|| { + format!( + "failed to write single-service smoke runbook artifact {}", + service_smoke_single_runbook_path.display() + ) + })?; for (receipt_id, action, status) in [ ( "daemon-service-lifecycle-receipt-smoke-cluster-execution-runbook", @@ -2395,6 +2408,35 @@ fn main() -> Result<()> { }, )?; } + write_epiphany_cultmesh_daemon_service_lifecycle_receipt( + &args.store, + args.runtime_id.clone(), + EpiphanyCultMeshDaemonServiceLifecycleReceiptEntry { + schema_version: EPIPHANY_CULTMESH_DAEMON_SERVICE_LIFECYCLE_RECEIPT_SCHEMA_VERSION + .to_string(), + receipt_id: "daemon-service-lifecycle-receipt-smoke-service-execution-runbook" + .to_string(), + service_id: "epiphany-daemon-supervisor-service".to_string(), + scheduler_id: "epiphany-daemon-supervisor".to_string(), + runtime_id: args.runtime_id.clone(), + daemon_selector: "epiphany-daemon-supervisor".to_string(), + action: "windows-service-execution-runbook".to_string(), + status: "written".to_string(), + command: "smoke-service-lifecycle".to_string(), + args: vec!["windows-service-execution-runbook".to_string()], + cwd: Some("E:/Projects/EpiphanyAgent".to_string()), + process_id: None, + exit_code: Some(0), + started_at_utc: service_smoke_started_at.clone(), + completed_at_utc: Some(Utc::now().to_rfc3339()), + operator_artifact_ref: service_smoke_single_runbook_path.display().to_string(), + private_state_exposed: false, + notes: vec![ + "Synthetic verse-query smoke receipt for single-service execution runbook action row." + .to_string(), + ], + }, + )?; write_epiphany_cultmesh_daemon_service_lifecycle_receipt( &args.store, args.runtime_id.clone(), @@ -2438,7 +2480,7 @@ fn main() -> Result<()> { if service_overview.service_lifecycle_recommended_wrapper_mode != "cluster-service-execution-audit" || service_receipt_directory.artifact_external_ref_count < 1 - || service_receipt_directory.artifact_present_count < 1 + || service_receipt_directory.artifact_present_count < 2 || service_receipt_directory.artifact_missing_count != 0 || !service_receipt_directory .attention_route_rows @@ -2517,23 +2559,28 @@ fn main() -> Result<()> { == WRAPPER_CLUSTER_SERVICE_EXECUTION_AUDIT_COMMAND && row.mutates_state && row.requires_elevated_authority - && row.service_execution_failed_check_count - == service_overview.service_execution_failed_check_count - && row.service_execution_missing_check_count - == service_overview.service_execution_missing_check_count + && row.service_execution_failed_check_count == 5 + && row.service_execution_missing_check_count == 4 + && !row.private_state_exposed + }) + || !service_overview.swarm_action_rows.iter().any(|row| { + row.priority == 51 + && row.family == "service-execution-authority" + && row.effect_class == "elevated-service-control" + && row.operator_aftercare_command == WRAPPER_SERVICE_EXECUTION_AUDIT_COMMAND + && row.completion_audit_wrapper_mode == "service-execution-audit" + && row.completion_audit_wrapper_command == WRAPPER_SERVICE_EXECUTION_AUDIT_COMMAND + && row.mutates_state + && row.requires_elevated_authority + && row.service_execution_failed_check_count == 6 + && row.service_execution_missing_check_count == 6 && !row.private_state_exposed }) || !service_overview.swarm_action_tui_rows.iter().any(|row| { row.contains("service-execution-authority") && row.contains("command=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-runbook") - && row.contains(&format!( - "failedChecks={}", - service_overview.service_execution_failed_check_count - )) - && row.contains(&format!( - "missingChecks={}", - service_overview.service_execution_missing_check_count - )) + && row.contains("failedChecks=5") + && row.contains("missingChecks=4") && row.contains("artifact=present") && row.contains(&format!( "sha256={}", @@ -2544,6 +2591,14 @@ fn main() -> Result<()> { )) && row.contains("audit=cluster-service-execution-audit") }) + || !service_overview.swarm_action_tui_rows.iter().any(|row| { + row.contains("service-execution-authority") + && row.contains("command=tools/epiphany_local_run.ps1 -Mode service-execution-runbook") + && row.contains("failedChecks=6") + && row.contains("missingChecks=6") + && row.contains("artifact=present") + && row.contains("audit=service-execution-audit") + }) || !service_overview .service_lifecycle_attention_rows .iter() @@ -2649,16 +2704,24 @@ fn main() -> Result<()> { attention_count: 0, private_state_exposed: false, }; + let missing_artifact_action = ServiceExecutionRunbookAction { + route: missing_runbook_row.route.clone(), + family: missing_runbook_row.family.clone(), + follow_up_command: missing_runbook_row.follow_up_command.clone(), + artifact_ref: missing_runbook_row.artifact_ref.clone(), + private_state_exposed: missing_runbook_row.private_state_exposed, + failed_check_count: 0, + missing_check_count: 0, + completion_audit_wrapper_mode: "cluster-service-execution-audit".to_string(), + completion_audit_wrapper_command: WRAPPER_CLUSTER_SERVICE_EXECUTION_AUDIT_COMMAND + .to_string(), + }; let (missing_artifact_rows, _) = swarm_action_rows( "ready", &[], &ready_policy_report, &[], - "cluster-service-execution-audit", - WRAPPER_CLUSTER_SERVICE_EXECUTION_AUDIT_COMMAND, - Some(&missing_runbook_row), - 0, - 0, + &[missing_artifact_action], ); if !missing_artifact_rows.iter().any(|row| { row.priority == 50 @@ -3103,6 +3166,18 @@ struct SwarmActionRow { private_state_exposed: bool, } +struct ServiceExecutionRunbookAction { + route: String, + family: String, + follow_up_command: String, + artifact_ref: String, + private_state_exposed: bool, + failed_check_count: usize, + missing_check_count: usize, + completion_audit_wrapper_mode: String, + completion_audit_wrapper_command: String, +} + #[derive(Serialize)] #[serde(rename_all = "camelCase")] struct SwarmOverviewOutput { @@ -3489,11 +3564,7 @@ fn swarm_action_rows( tool_host_attention_rows: &[DaemonToolDirectoryRow], policy_report: &DaemonRestartPolicyDirectoryReport, service_lifecycle_attention_rows: &[ReceiptDirectoryRow], - service_lifecycle_recommended_wrapper_mode: &str, - service_lifecycle_recommended_wrapper_command: &str, - service_execution_runbook_row: Option<&ReceiptDirectoryRow>, - service_execution_failed_check_count: usize, - service_execution_missing_check_count: usize, + service_execution_runbook_actions: &[ServiceExecutionRunbookAction], ) -> (Vec, Vec) { let mut rows = Vec::new(); if liveness_status != "ready" { @@ -3613,94 +3684,92 @@ fn swarm_action_rows( private_state_exposed: row.private_state_exposed, }); } - if let Some(runbook_row) = service_execution_runbook_row { - if runbook_row.present && runbook_row.status == "written" { - let artifact_status = operator_artifact_status(&runbook_row.artifact_ref).to_string(); - let ( - status, - action, - wrapper_mode, - wrapper_command, - authority_gate, - effect_class, - mutates_state, - requires_elevated_authority, - reason, - ) = if artifact_status == "missing" { - ( - "runbook-artifact-missing".to_string(), - format!( - "Regenerate sealed service execution runbook for {}; then rerun service execution audit.", - runbook_row.route - ), - runbook_row.family.clone(), - format!( - "{} # refreshes the missing sealed runbook artifact; do not request elevated service control until artifactStatus=present", - runbook_row.follow_up_command - ), - "daemon.service_lifecycle_runbook".to_string(), - "service-lifecycle-runbook-regeneration".to_string(), - false, - false, - "A service execution runbook receipt exists, but its local artifact is missing; regenerate the sealed runbook witness before requesting elevated service authority.".to_string(), - ) - } else { - ( - "operator-authority-required".to_string(), - format!( - "Run latest generated service execution runbook for {}; then rerun service execution audit.", - runbook_row.route - ), - "operator-elevated-runbook".to_string(), - format!( - "{} # refreshes the sealed runbook; execute the generated artifact only with explicit elevated operator authority", - runbook_row.follow_up_command - ), - "operator.elevated_windows_service_control".to_string(), - "elevated-service-control".to_string(), - true, - true, - "A sealed service execution runbook exists; completing service readiness now requires explicit elevated operator execution and follow-up audit receipts.".to_string(), - ) - }; - let operator_artifact_execution_command = if artifact_status == "present" { - elevated_powershell_runbook_command(&runbook_row.artifact_ref) - } else { - "none".to_string() - }; - let operator_aftercare_command = if artifact_status == "present" { - service_lifecycle_recommended_wrapper_command.to_string() - } else { - "none".to_string() - }; - let operator_artifact_sha256 = - operator_artifact_sha256(&runbook_row.artifact_ref, &artifact_status); - rows.push(SwarmActionRow { - priority: 50, - family: "service-execution-authority".to_string(), - status, - action, - wrapper_mode, - wrapper_command, - operator_artifact_ref: runbook_row.artifact_ref.clone(), - operator_artifact_status: artifact_status, - operator_artifact_sha256, - operator_artifact_execution_command, - operator_aftercare_command, - completion_audit_wrapper_mode: service_lifecycle_recommended_wrapper_mode - .to_string(), - completion_audit_wrapper_command: service_lifecycle_recommended_wrapper_command - .to_string(), - authority_gate, - effect_class, - mutates_state, - requires_elevated_authority, - service_execution_failed_check_count, - service_execution_missing_check_count, - reason, - private_state_exposed: runbook_row.private_state_exposed, - }); - } + for (index, runbook_action) in service_execution_runbook_actions.iter().enumerate() { + let artifact_status = operator_artifact_status(&runbook_action.artifact_ref).to_string(); + let ( + status, + action, + wrapper_mode, + wrapper_command, + authority_gate, + effect_class, + mutates_state, + requires_elevated_authority, + reason, + ) = if artifact_status == "missing" { + ( + "runbook-artifact-missing".to_string(), + format!( + "Regenerate sealed service execution runbook for {}; then rerun service execution audit.", + runbook_action.route + ), + runbook_action.family.clone(), + format!( + "{} # refreshes the missing sealed runbook artifact; do not request elevated service control until artifactStatus=present", + runbook_action.follow_up_command + ), + "daemon.service_lifecycle_runbook".to_string(), + "service-lifecycle-runbook-regeneration".to_string(), + false, + false, + "A service execution runbook receipt exists, but its local artifact is missing; regenerate the sealed runbook witness before requesting elevated service authority.".to_string(), + ) + } else { + ( + "operator-authority-required".to_string(), + format!( + "Run latest generated service execution runbook for {}; then rerun service execution audit.", + runbook_action.route + ), + "operator-elevated-runbook".to_string(), + format!( + "{} # refreshes the sealed runbook; execute the generated artifact only with explicit elevated operator authority", + runbook_action.follow_up_command + ), + "operator.elevated_windows_service_control".to_string(), + "elevated-service-control".to_string(), + true, + true, + "A sealed service execution runbook exists; completing service readiness now requires explicit elevated operator execution and follow-up audit receipts.".to_string(), + ) + }; + let operator_artifact_execution_command = if artifact_status == "present" { + elevated_powershell_runbook_command(&runbook_action.artifact_ref) + } else { + "none".to_string() + }; + let operator_aftercare_command = if artifact_status == "present" { + runbook_action.completion_audit_wrapper_command.clone() + } else { + "none".to_string() + }; + let operator_artifact_sha256 = + operator_artifact_sha256(&runbook_action.artifact_ref, &artifact_status); + rows.push(SwarmActionRow { + priority: 50 + index as u32, + family: "service-execution-authority".to_string(), + status, + action, + wrapper_mode, + wrapper_command, + operator_artifact_ref: runbook_action.artifact_ref.clone(), + operator_artifact_status: artifact_status, + operator_artifact_sha256, + operator_artifact_execution_command, + operator_aftercare_command, + completion_audit_wrapper_mode: runbook_action.completion_audit_wrapper_mode.clone(), + completion_audit_wrapper_command: runbook_action + .completion_audit_wrapper_command + .clone(), + authority_gate, + effect_class, + mutates_state, + requires_elevated_authority, + service_execution_failed_check_count: runbook_action.failed_check_count, + service_execution_missing_check_count: runbook_action.missing_check_count, + reason, + private_state_exposed: runbook_action.private_state_exposed, + }); } if rows.is_empty() { rows.push(SwarmActionRow { @@ -3763,6 +3832,54 @@ fn service_lifecycle_wrapper_mode_for_row(row: &ReceiptDirectoryRow) -> &'static } } +fn service_execution_runbook_actions( + rows: &[ReceiptDirectoryRow], + cluster_report: &epiphany_core::EpiphanyServiceExecutionAuditReport, + single_service_reports: &[(String, epiphany_core::EpiphanyServiceExecutionAuditReport)], +) -> Vec { + rows.iter() + .filter(|row| { + row.present + && row.status == "written" + && (row.family == "cluster-service-execution-runbook" + || row.family == "service-execution-runbook") + }) + .filter_map(|row| { + if row.family == "cluster-service-execution-runbook" { + Some(ServiceExecutionRunbookAction { + route: row.route.clone(), + family: row.family.clone(), + follow_up_command: row.follow_up_command.clone(), + artifact_ref: row.artifact_ref.clone(), + private_state_exposed: row.private_state_exposed, + failed_check_count: cluster_report.failed_count, + missing_check_count: cluster_report.missing_count, + completion_audit_wrapper_mode: "cluster-service-execution-audit".to_string(), + completion_audit_wrapper_command: + WRAPPER_CLUSTER_SERVICE_EXECUTION_AUDIT_COMMAND.to_string(), + }) + } else { + let service_id = receipt_directory_row_service_id(row)?; + let (_, report) = single_service_reports + .iter() + .find(|(candidate_id, _)| candidate_id == &service_id)?; + Some(ServiceExecutionRunbookAction { + route: row.route.clone(), + family: row.family.clone(), + follow_up_command: row.follow_up_command.clone(), + artifact_ref: row.artifact_ref.clone(), + private_state_exposed: row.private_state_exposed, + failed_check_count: report.failed_count, + missing_check_count: report.missing_count, + completion_audit_wrapper_mode: "service-execution-audit".to_string(), + completion_audit_wrapper_command: WRAPPER_SERVICE_EXECUTION_AUDIT_COMMAND + .to_string(), + }) + } + }) + .collect() +} + fn elevated_powershell_runbook_command(artifact_ref: &str) -> String { format!( "Start-Process PowerShell -Verb RunAs -Wait -ArgumentList @('-NoProfile','-ExecutionPolicy','Bypass','-File',{})", @@ -3797,18 +3914,6 @@ fn operator_artifact_status(artifact_ref: &str) -> &'static str { } } -fn service_lifecycle_runbook_row_for_recommended_mode<'a>( - rows: &'a [ReceiptDirectoryRow], - recommended_wrapper_mode: &str, -) -> Option<&'a ReceiptDirectoryRow> { - let family = match recommended_wrapper_mode { - "cluster-service-execution-audit" => "cluster-service-execution-runbook", - "service-execution-audit" => "service-execution-runbook", - _ => return None, - }; - rows.iter().find(|row| row.family == family) -} - fn daemon_restart_policy_directory_report( context: &EpiphanyLocalVerseContext, ) -> DaemonRestartPolicyDirectoryReport { @@ -4067,31 +4172,34 @@ fn load_swarm_overview_report(args: &Args) -> Result { .filter(|receipt| receipt.service_id == *service_id) .cloned() .collect::>(); - epiphany_service_execution_audit_report(&scoped_receipts) + ( + service_id.clone(), + epiphany_service_execution_audit_report(&scoped_receipts), + ) }) .collect::>(); let service_execution_failed_check_count = cluster_service_execution_audit.failed_count + single_service_execution_audits .iter() - .map(|report| report.failed_count) + .map(|(_, report)| report.failed_count) .sum::(); let service_execution_missing_check_count = cluster_service_execution_audit.missing_count + single_service_execution_audits .iter() - .map(|report| report.missing_count) + .map(|(_, report)| report.missing_count) .sum::(); let service_execution_private_state_exposed = cluster_service_execution_audit .private_state_exposed || single_service_execution_audits .iter() - .any(|report| report.private_state_exposed); + .any(|(_, report)| report.private_state_exposed); let service_execution_failed_check_rows = cluster_service_execution_audit .checks .iter() .chain( single_service_execution_audits .iter() - .flat_map(|report| report.checks.iter()), + .flat_map(|(_, report)| report.checks.iter()), ) .filter(|check| !check.ok || !check.private_state_sealed) .cloned() @@ -4205,20 +4313,17 @@ fn load_swarm_overview_report(args: &Args) -> Result { .iter() .map(daemon_tool_directory_tui_row) .collect::>(); - let service_execution_runbook_row = service_lifecycle_runbook_row_for_recommended_mode( + let service_execution_runbook_actions = service_execution_runbook_actions( &service_lifecycle_rows, - &service_lifecycle_recommended_wrapper_mode, + &cluster_service_execution_audit, + &single_service_execution_audits, ); let (swarm_action_rows, swarm_action_tui_rows) = swarm_action_rows( &liveness_status, &tool_host_attention_rows, &policy_report, &service_lifecycle_attention_rows, - &service_lifecycle_recommended_wrapper_mode, - &service_lifecycle_recommended_wrapper_command, - service_execution_runbook_row, - service_execution_failed_check_count, - service_execution_missing_check_count, + &service_execution_runbook_actions, ); let private_state_exposed = daemon_report .rows diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index e396f8c0..f9a082ed 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -71,6 +71,7 @@ remembers doctrine; the branch remembers the blade. - 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. - 2026-06-18: Service execution failed-check rows now carry `serviceId` and the compact TUI/PowerShell summaries render `serviceId::action=status`. Single-service overview audits are scoped to service ids from current service-lifecycle attention rows instead of blending all non-cluster receipts, so old EventLog proof scars cannot masquerade as Epiphany supervisor service evidence. Live wrapper proof `local-20260618-215343-309-3f5dd519` printed cluster failures under `epiphany-cluster-daemon-services::...` and supervisor-service missing checks under `epiphany-daemon-supervisor-service::...`, with `privateStateExposed=false`; standalone `service-execution-audit` proof `local-20260618-215828-537-12b29ecf` printed the supervisor-service prefix on runbook witness and failed-check rows, and standalone `cluster-service-execution-audit` proof `local-20260618-215948-348-7be0110c` printed the cluster service prefix on runbook witness and failed-check rows. - 2026-06-18: The `swarm-overview`/`swarm-triage` action queue now carries aggregate sealed service-execution wound counts on the elevated service-control row as `serviceExecutionFailedCheckCount` and `serviceExecutionMissingCheckCount`, with compact wrapper/TUI rows rendering `failedChecks=` and `missingChecks=`. Non-mutating readback rows keep both counts at zero. Live proofs `local-20260618-220534-199-d8e90287` and `local-20260618-220534-205-59582da5` printed the priority-50 `service-execution-authority` row with `failedChecks=11`, `missingChecks=6`, `artifactStatus=present`, the sealed cluster runbook SHA-256, and `privateStateExposed=false`. +- 2026-06-18: The elevated service-control action queue now emits one `service-execution-authority` row per sealed runbook witness instead of attaching all failed checks to the recommended cluster artifact. Source smoke seeds both cluster and single-service runbook witnesses and proves separate scoped rows. Live overview proof `local-20260618-221339-826-b1981064` and triage proof `local-20260618-221340-099-4b4baba8` printed priority 50 for `cluster-service-execution-runbook` with `failedChecks=5`, `missingChecks=0`, SHA-256 `3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0`, and aftercare `cluster-service-execution-audit`; and priority 51 for `service-execution-runbook` with `failedChecks=6`, `missingChecks=6`, SHA-256 `b213a3c11a8f11a03061fcd743f507edaa59bc6767257b79cef63329596375e7`, and aftercare `service-execution-audit`, with no private state exposure. - 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 fac92b618117585734b1257ab3dd4188a8a59b90..8c15cc070f56521824faeb53a3ccb8bb77cb98fc 100644 GIT binary patch delta 437 zcmZXQu}Z{15Qfd&frScJSO|g+SO{|AHZg|ez)G+eJFO;rn`F5pd+u&7T3vC4tsuu$ z7QTUKVQu3RScsL6;;v|;#V|84|Ih!;<6C$3-hJ3`R=jXP$l2>sXYccA$GLEvm)X2^ zJ#RUtY;Ql$Tb;Yz#mz~3ZQ1t*_Wl+>HmCQe4ayS4gvkkKOj|cH}T@gBVhno4WSSe3)d%pNJ1}ieRCENm&CCf zBte1+Mxb)hm;lz-+M1k@A~%_iaz;n$@StCErFfP7?Bv^6)h7IeDHvZp B4$=Ss diff --git a/state/map.yaml b/state/map.yaml index 8dfbc114..60ffe5e2 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -622,7 +622,7 @@ current_status: - `epiphany-verse-query swarm-triage` and `tools/epiphany_local_run.ps1 -Mode swarm-triage` compose the compact swarm overview with the existing brake-aware daemon poke receipt writer. Triage pokes only daemon liveness attention; service-manager lifecycle wounds are reflected from overview as sealed `serviceLifecycleAttentionRows`/TUI rows, `serviceExecutionFailedCheckRows`/TUI rows, explicit `serviceLifecycleRecommended*` fields, and ordered `swarmActionRows`, but do not cause daemon poke receipts, while blocked daemon-hosted tools ride as sealed `toolHostAttentionRows`/TUI rows so agents can see which advertised capabilities are unavailable because their host body is sick. Current live triage `local-20260618-150015-844-aba20563` returns `status=noop`, `overviewStatus=attention`, `livenessStatus=ready`, `recoveryStatus=attention`, `clusterCount=7`, `privateVerseCount=7`, `pokedDaemonCount=0`, `recommendedWrapperMode=cluster-service-execution-audit`, `serviceLifecycleRecommendedWrapperMode=cluster-service-execution-audit`, `swarmActionCount=2`, the same sealed service readback plus operator-elevated runbook rows, including `operatorArtifactStatus=present`, `operatorArtifactRef=E:\Projects\EpiphanyAgent\.epiphany-run\local-20260618-132257-139-26213a29\epiphany-cluster-daemon-services-execution-runbook.ps1`, and `completionAuditWrapperCommand=tools/epiphany_local_run.ps1 -Mode cluster-service-execution-audit` on the elevated row, empty daemon/tool-host attention arrays, `serviceLifecycleAttentionCount=2`, routes `epiphany-cluster-daemon-services::cluster-windows-service-execution-audit` and `epiphany-daemon-supervisor-service::windows-service-execution-audit`, direct and wrapper command hints including `wrapperInvokeTool` and `wrapperBifrostLedger=tools/epiphany_local_run.ps1 -Mode bifrost-ledger`, and `privateStateExposed=false`; degraded Hands proof returns `status=ok`, `overviewStatus=attention`, topology and daemon TUI rows, blocked Hands-hosted tool rows, one sealed topology-aware poke receipt for `epiphany-daemon-hands` with `bodyDomain=repo:E:/Projects/EpiphanyAgent`, `privateVerseId=epiphany.cluster.hands.private`, `eveSurfaceId=eve://epiphany/hands`, `observedStatus=degraded`, `attentionDaemonIds=[epiphany-daemon-hands]`, `attentionToolHostDaemonIds=[epiphany-daemon-hands]`, and liveness/tool-host action rows with no private-state exposure. Source smoke `verse-query-service-execution-failed-checks-clean` proves a physical synthetic written runbook plus incomplete service audit receipts expose both service lifecycle readback and failed-check anatomy with no Windows service mutation. - Compact `swarmActionTuiRows` now match the JSON service-execution queue including local runbook SHA-256 provenance: live artifact `local-20260618-164403-238-dba797ce` shows `050 | service-execution-authority | operator-authority-required | operator-elevated-runbook | operator.elevated_windows_service_control | mutates=true | elevated=true | artifact=present | sha256=3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0 | audit=cluster-service-execution-audit`, while the readback row stays `artifact=none | sha256=none | audit=none`. Source smoke `verse-query-action-tui-audit-smoke` guards this agent-friendly TUI surface. - Receipt directory rows now carry `artifactStatus` and `artifactSha256` beside `artifactRef`, using the same `none` / `external-ref` / `present` / `missing` vocabulary as action rows and hashing present local artifacts at the receipt-directory layer. Live wrapper artifact `local-20260618-165005-139-6188fe30` proves the cluster service execution runbook row reports `artifactStatus=present`, `artifactSha256=3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0`, and TUI `artifact=present | sha256=3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0`; the per-service execution runbook row reports `artifactSha256=b213a3c11a8f11a03061fcd743f507edaa59bc6767257b79cef63329596375e7`; non-artifact rows report `artifactSha256=none`. Wrapper proof `local-20260618-165319-478-e929d2bd` also prints compact `artifactHashes=cluster-service-execution-runbook:3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0; service-execution-runbook:b213a3c11a8f11a03061fcd743f507edaa59bc6767257b79cef63329596375e7` in the one-line receipt-directory summary. Source smoke guards present-artifact SHA-256 in receipt-directory JSON/TUI, action-row SHA-256, missing-artifact demotion, and failed-check anatomy. `epiphany-verse-query receipt-directory` also derives compact artifact counts (`artifactNoneCount`, `artifactExternalRefCount`, `artifactPresentCount`, `artifactMissingCount`) from rows instead of storing a second truth. 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` 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`. The Rust-owned action queue now enumerates every sealed service-lifecycle attention receipt instead of only the selected global recommendation: live wrapper proof `local-20260618-214044-049-a63d008c` printed priority 40 `cluster-service-execution-audit` and priority 41 `service-execution-audit` non-mutating readback rows with `artifactStatus=external-ref`, `sha256=none`, service-manager artifact refs for cluster execution audit and single-service execution audit, and `privateStateExposed=false`, while leaving the priority-50 elevated runbook authority row unchanged. The failed-check anatomy now aggregates cluster and single-service execution audit reports too: live wrapper proof `local-20260618-214854-896-79b9190b` printed cluster readiness/install/start/audit/stop failures plus single-service readiness/install/start/reconcile/stop failures in the same sealed `serviceExecutionFailedChecks`/TUI surfaces without service mutation. The failed-check rows now carry service identity and overview scopes single-service audits to service ids from current service-lifecycle attention rows: live proof `local-20260618-215343-309-3f5dd519` printed `epiphany-cluster-daemon-services::...` cluster failures and `epiphany-daemon-supervisor-service::...=missing` supervisor-service failures, preventing old EventLog proof receipts from being mistaken for Epiphany supervisor service readiness; standalone `service-execution-audit` proof `local-20260618-215828-537-12b29ecf` and standalone `cluster-service-execution-audit` proof `local-20260618-215948-348-7be0110c` printed the same service-prefixed runbook witness and failed-check rows for their respective bodies. The action queue now carries aggregate service-execution wound counters on each row: non-mutating readbacks report zero, and the priority-50 elevated authority row reports the sealed failed/missing check counts it is meant to cure; live overview/triage proofs `local-20260618-220534-199-d8e90287` and `local-20260618-220534-205-59582da5` printed `failedChecks=11` and `missingChecks=6` with the present cluster runbook artifact 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`. The Rust-owned action queue now enumerates every sealed service-lifecycle attention receipt instead of only the selected global recommendation: live wrapper proof `local-20260618-214044-049-a63d008c` printed priority 40 `cluster-service-execution-audit` and priority 41 `service-execution-audit` non-mutating readback rows with `artifactStatus=external-ref`, `sha256=none`, service-manager artifact refs for cluster execution audit and single-service execution audit, and `privateStateExposed=false`, while leaving the elevated runbook authority rows unchanged. The failed-check anatomy now aggregates cluster and single-service execution audit reports too: live wrapper proof `local-20260618-214854-896-79b9190b` printed cluster readiness/install/start/audit/stop failures plus single-service readiness/install/start/reconcile/stop failures in the same sealed `serviceExecutionFailedChecks`/TUI surfaces without service mutation. The failed-check rows now carry service identity and overview scopes single-service audits to service ids from current service-lifecycle attention rows: live proof `local-20260618-215343-309-3f5dd519` printed `epiphany-cluster-daemon-services::...` cluster failures and `epiphany-daemon-supervisor-service::...=missing` supervisor-service failures, preventing old EventLog proof receipts from being mistaken for Epiphany supervisor service readiness; standalone `service-execution-audit` proof `local-20260618-215828-537-12b29ecf` and standalone `cluster-service-execution-audit` proof `local-20260618-215948-348-7be0110c` printed the same service-prefixed runbook witness and failed-check rows for their respective bodies. The action queue now carries service-execution wound counters on each row: non-mutating readbacks report zero, and elevated authority rows report only the sealed failed/missing checks their own runbook artifact can cure. Source smoke seeds both cluster and single-service runbook witnesses and proves distinct authority rows. Live overview/triage proofs `local-20260618-221339-826-b1981064` and `local-20260618-221340-099-4b4baba8` printed priority 50 `cluster-service-execution-runbook` with `failedChecks=5`, `missingChecks=0`, SHA-256 `3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0`, and aftercare `cluster-service-execution-audit`, plus priority 51 `service-execution-runbook` with `failedChecks=6`, `missingChecks=6`, SHA-256 `b213a3c11a8f11a03061fcd743f507edaa59bc6767257b79cef63329596375e7`, and aftercare `service-execution-audit`, with `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.