diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 89efa54e..14b440a8 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -47,6 +47,7 @@ remembers doctrine; the branch remembers the blade. - `tools/epiphany_local_run.ps1 -Mode service-execution-runbook` writes a non-mutating `#Requires -RunAsAdministrator` PowerShell artifact that sequences `service-execution-readiness`, `service-install-execute`, `service-start-execute`, `service-status`, `service-reconcile`, `service-stop-execute`, final `service-status`, and `service-execution-audit` through the existing typed wrapper modes, then asks `epiphany-daemon-supervisor windows-service-execution-runbook` to seal the artifact as a `written` lifecycle receipt. The artifact now uses `Invoke-EpiphanyRunbookStep` so each step resets `$LASTEXITCODE`, catches thrown/nonzero failures, keeps running to gather more lifecycle receipts, runs `service-execution-audit` in `finally`, and exits nonzero only after the audit if any step failed. Latest proof `local-20260618-160641-685-331af57c` generated and parsed the artifact with `privateStateExposed=false`; the next elevated scar is to run it under explicit operator authority and preserve its effect receipts. - `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. The cluster install/audit/control wrapper summaries now print compact `serviceRows` for all seven daemon-owned Windows service names with daemon id, status or observed status, cluster id, executed flag, exit code, start type, and `private=false`; live proofs `local-20260618-211051-126-2a89d61c`, `local-20260618-211051-125-cd687ee2`, `local-20260618-211051-063-f0ff980d`, and `local-20260618-211118-108-df5cb8cd` show the missing audit, ready/demand install-plan, start-planned, and stop-planned row shapes without service 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. +- `tools/epiphany_local_run.ps1 -Mode cluster-service-execution-readiness` now prints compact `serviceRows` too. The readiness payload has identity-only per-service rows, so the wrapper uses the global readiness verdict as the default row status; proof `local-20260618-211524-363-5d85b3aa` showed seven `not-elevated` rows with service/daemon/cluster identity and `private=false`. Stop execution refusal remains row-visible as well: proof `local-20260618-211524-345-d580da5c` printed seven `execution-refused-not-elevated` rows without mutating Windows services. - `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. 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`. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index eae1ec69..fc3a23ef 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index dbb7a3db..abad1cf4 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -612,6 +612,7 @@ current_status: - `epiphany-verse-query receipt-directory` and `tools/epiphany_local_run.ps1 -Mode receipt-directory` provide the compact latest-witness directory over local Verse. It indexes operator run, daemon poke, daemon tool invocation, Eve connection, Bifrost publication, Imagination consensus, coordinator run, Hands gate, role review, work-loop, cluster service lifecycle, single-service lifecycle, cluster service execution runbook, single-service execution runbook, scheduler, Persona speech, and agent-state SoA witness families from typed local Verse projections; returns agent-friendly `OK`/`ABSENT`/`ATTN` TUI rows with owner, family, status, route, latest id, follow-up command, `presentRowCount`, and `absentRowCount`; preserves `missingRowCount` as compatibility for absent witnesses; flags sealed service lifecycle failure states such as `not-elevated`, `execution-refused-not-elevated`, and `incomplete` as attention without exposing receipt payloads; routes cluster service lifecycle receipts to `cluster-service-execution-audit`, single-service receipts to `service-execution-audit`, the cluster execution-runbook witness to `cluster-service-execution-runbook`, and the single-service execution-runbook witness to `service-execution-runbook`; and exposes no private state or receipt payload previews. The lifecycle projection now reads the typed receipt family, splits `cluster-service-lifecycle` from `service-lifecycle`, selects the latest attention receipt before falling back to latest overall, and exposes `service-id::action` route values such as `epiphany-cluster-daemon-services::cluster-windows-service-execution-audit`, so agents can see the owning lifecycle action without opening raw audit JSON. Compact receipt TUI rows append `followUp=`, artifact status, and SHA-256; wrapper proof `local-20260618-205920-451-383b0da7` now prints all seventeen compact rows in `receiptRows`, including missing Hands/role/work-loop gates, runbook hashes, scheduler follow-up, Bifrost/Imagination witnesses, and the active service lifecycle attention rows. It also exposes `cluster-service-execution-runbook` plus `service-execution-runbook` as display-only rows, so newer harmless planned/runbook lifecycle receipts cannot hide the active seven-service cluster wound. - `tools/epiphany_local_run.ps1 -Mode service-tick` is the wrapper-owned daemon scheduler pulse rite. It runs `epiphany-daemon-supervisor tick` through the same local Verse store, operator run intent/receipt, agent-state SoA refresh, and swarm-brake preflight as other service lifecycle modes, but leaves restart authority inside durable daemon restart policies. The receipt directory scheduler row now follows up with `tools/epiphany_local_run.ps1 -Mode service-tick` instead of passive service status. Proof seeded one disabled Persona restart policy as inert policy metadata, then the wrapper wrote `daemon-scheduler-receipt-epiphany-daemon-supervisor-0` with `status=tickComplete`, `outcomeCount=1`, `skippedCount=1`, `restartedCount=0`, `refusedCount=0`, and `privateStateExposed=false`; the follow-up receipt-directory proof reported the scheduler row as present with route `*`, follow-up command `service-tick`, and no private-state exposure. - `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 the shared local Verse, 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 query/debug writer. A degraded proof showed `service-tick` invoking all seven daemon bodies through the supervisor and restoring ready liveness with sealed scheduler/poke receipts; a fresh tick no-ops when all heartbeats are current. `epiphany-daemon-supervisor cluster-service-runbook` and wrapper `-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 wrapper `-Mode cluster-service-install-plan` write a non-mutating Windows install script plus lifecycle receipt for seven distinct per-organ Windows services. Wrapper `-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, writing an incomplete audit receipt when they are missing. `epiphany-daemon-supervisor cluster-service-start`/`cluster-service-stop` and wrapper `-Mode cluster-service-start-plan`, `cluster-service-stop-plan`, `cluster-service-start-execute`, and `cluster-service-stop-execute` record cluster lifecycle receipts for all seven services: plan modes emit seven `*-planned` rows without mutation, and explicit execute modes refuse as `execution-refused-not-elevated` with seven refused rows when the shell lacks service authority. The cluster install/audit/control wrapper summaries now print compact `serviceRows` for all seven daemon-owned Windows service names with daemon id, status or observed status, cluster id, executed flag, exit code, start type, and `private=false`; live proofs `local-20260618-211051-126-2a89d61c`, `local-20260618-211051-125-cd687ee2`, `local-20260618-211051-063-f0ff980d`, and `local-20260618-211118-108-df5cb8cd` show seven missing audit rows, seven ready/demand install-plan rows, seven start-planned rows, and seven stop-planned rows without service mutation. `cluster-service-execution-runbook` writes an admin-gated wrapper sequence for cluster-native readiness, cluster install, cluster start, cluster audit, cluster stop, and final cluster audit; the artifact now uses `Invoke-EpiphanyRunbookStep` to reset `$LASTEXITCODE`, catch thrown/nonzero failures, continue gathering receipts after a failed step, and always runs `cluster-service-execution-audit` from `finally`; the wrapper calls `epiphany-daemon-supervisor cluster-service-execution-runbook` after artifact generation, so the runbook itself has a typed `daemon_service_lifecycle` receipt with action `cluster-windows-service-execution-runbook`, status `written`, artifact path, final-audit metadata, step-failure policy metadata, and `privateStateExposed=false`. Its wrapper JSON and typed receipt args expose `runbookTryModes`, `finalAuditMode=cluster-service-execution-audit`, `finalAuditRunsInFinally=true`, `stepFailurePolicy=continue-after-step-failure`, `continueAfterStepFailure=true`, `nonzeroExitFailsStep=true`, and `exitsNonzeroAfterFinalAudit=true`, and the compact wrapper line prints those same aftercare facts. Latest proof `local-20260618-161632-376-436227d8` generated and parsed the robust cluster artifact; live overview `local-20260618-161718-889-7cebdcb1` points the elevated operator row at that artifact. `cluster-service-execution-audit` first requires the sealed `cluster-windows-service-execution-runbook` receipt, then checks the latest cluster-native readiness plus cluster install/start/audit/stop lifecycle receipts by receipt timestamp and reports `complete` only when the runbook and elevated effect receipts are sealed and successful. Audit check rows retain lifecycle `operatorArtifactRef`; wrapper summaries now print OK runbook witnesses with SHA-256 before compact failed-check anatomy. Live proof `local-20260618-170322-330-e6cb2117` printed `cluster-windows-service-execution-runbook=...\epiphany-cluster-daemon-services-execution-runbook.ps1:sha256=3239ac17008b1ce857970e40b17d37a1ecf1631a3a6636bb2b8678312fb604a0` and the expected five failed checks without mutating Windows services. + - Cluster service execution readiness now uses the same compact wrapper `serviceRows` mouth as install/audit/control. Identity-only readiness rows inherit the global readiness verdict, so the seven expected Windows service rows show `not-elevated` instead of `unknown` when the shell lacks service authority. Live proof `local-20260618-211524-363-5d85b3aa` printed seven readiness rows with service name, daemon id, cluster id, `executed=n/a`, `exit=none`, `startType=none`, and `private=false`; live proof `local-20260618-211524-345-d580da5c` printed seven `execution-refused-not-elevated` stop-execute rows without service mutation. - `epiphany-verse-query restart-policy-directory` and `tools/epiphany_local_run.ps1 -Mode service-policy-directory` provide the compact scheduler coverage sight organ. It reads daemon topology/status plus durable `epiphany.cultmesh.daemon_restart_policy.v0` rows through a narrow CultMesh restart-policy directory loader, reports each daemon as `ENABLED`, `DISABLED`, or `MISSING`, treats disabled and missing policies as recovery attention, returns covered/enabled/disabled/missing/attention counts, and publishes explicit policy-write plus scheduler-tick follow-up commands without creating or mutating policies. Compact TUI rows now expose cooldown, reconcile interval, heartbeat stale threshold, failure count, last result, `followUp=`, and `private=false`; wrapper proof `local-20260618-175008-830-e470a387` printed all seven faculties as `enabled` with `last=ready`, `reconcile=60s`, `stale=300s`, and `tools/epiphany_local_run.ps1 -Mode service-tick` follow-up. Direct and wrapper proof now report seven daemons, seven covered policies, seven enabled policies, zero disabled, zero missing, zero attention, `status=ok`, and `privateStateExposed=false`. This is a real daemon heartbeat body with non-mutating per-organ launch and install artifacts, but not yet executed installed per-organ OS services. - `https://gamecult.org/Blog/purge-the-heretek-from-our-daemonic-swarm` is a public doctrine receipt for the Perfect Machine audit pressure: organs must not borrow each other's crowns, witnesses need owning mouths, surfaces reflect rather than rule, and cross-repo purification needs Bifrost-shaped ledger evidence instead of relying on recoverable transcripts or commit trails alone. - `tools/epiphany_local_run.ps1` now uses collision-resistant local run ids (`local-YYYYMMDD-HHMMSS-fff-`) for artifact roots and operator run receipts. Same-second parallel compact wrapper proofs for `collaboration-feedback` and `bifrost-publication` produce separate artifact drawers and both complete, so operator rites no longer collide on second-resolution run ids. diff --git a/tools/epiphany_local_run.ps1 b/tools/epiphany_local_run.ps1 index 4f2a2ee4..2e177bab 100644 --- a/tools/epiphany_local_run.ps1 +++ b/tools/epiphany_local_run.ps1 @@ -162,7 +162,10 @@ function Format-TuiRows { } function Format-ClusterServiceRows { - param([object]$Rows) + param( + [object]$Rows, + [string]$DefaultStatus = "unknown" + ) $rowList = @($Rows) if ($null -eq $Rows -or $rowList.Count -eq 0) { @@ -175,7 +178,7 @@ function Format-ClusterServiceRows { $status = $_.observedStatus } if ($null -eq $status -or $status -eq "") { - $status = "unknown" + $status = $DefaultStatus } $executed = $_.executed if ($null -eq $executed -or $executed -eq "") { @@ -1919,7 +1922,8 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) { $serviceRows = Format-ClusterServiceRows $result.services Write-Host "Cluster daemon service control: service=$($result.serviceId), daemons=$($result.daemonCount), status=$($result.status), executeRequested=$($result.executeRequested), executed=$($result.executed), planned=$($result.plannedCount), requested=$($result.requestedCount), refused=$($result.refusedCount), failed=$($result.failedCount), receipt=$($result.receiptId), serviceRows=$serviceRows" } elseif ($Mode -eq "cluster-service-execution-readiness") { - Write-Host "Cluster daemon service execution readiness: service=$($result.serviceId), daemons=$($result.daemonCount), services=$($result.serviceCount), status=$($result.status), elevated=$($result.elevated), receipt=$($result.receiptId)" + $serviceRows = Format-ClusterServiceRows $result.services $result.status + Write-Host "Cluster daemon service execution readiness: service=$($result.serviceId), daemons=$($result.daemonCount), services=$($result.serviceCount), status=$($result.status), elevated=$($result.elevated), receipt=$($result.receiptId), serviceRows=$serviceRows" } elseif ($Mode -eq "cluster-service-execution-runbook") { Write-Host "Cluster daemon service execution runbook: service=$($result.serviceId), status=$($result.status), finalAuditInFinally=$($result.finalAuditRunsInFinally), continueAfterStepFailure=$($result.continueAfterStepFailure), nonzeroExitFailsStep=$($result.nonzeroExitFailsStep), exitsNonzeroAfterFinalAudit=$($result.exitsNonzeroAfterFinalAudit), path=$($result.runbookPath)" } elseif ($Mode -eq "cluster-service-execution-audit") {