Reconcile Idunn managed services

This commit is contained in:
Meta Vens 2026-07-12 13:12:46 +01:00
commit eeb1dce363
8 changed files with 215 additions and 13 deletions

View file

@ -376,6 +376,17 @@ witness; `managed-service-read` projects desired state plus
`latestLifecycle`. It deliberately reports process observation as unknown
until a real reconcile probe exists, so an old launch receipt cannot claim the
service is alive.
That probe now exists. `managed-service-reconcile` reads only the service policy
and lifecycle history, observes the latest PID through the native platform
process API, applies enabled/restart-mode/cooldown decisions, and delegates a
restart to `service_launch`. Launch receipt ids now carry attempt time, so
restarts preserve history. Live root
`C:\Users\Meta\AppData\Local\Temp\epiphany-managed-reconcile-8e3d7cc5fe0b4c5fa38b18b3d00cea0c`
proved restart receipt
`daemon-service-lifecycle-receipt-idunn-managed-heartbeat-launch-1783858125893`
and PID `19736` were observed alive after the prior process was killed. Next
fold this reconcile into Idunn's own serve loop and cut the full-context Verse
load from service launch.
This map must change when ownership changes. Historical scars belong in git,
evidence, or an explicitly archived note—not in the machine's proprioception.

View file

@ -2217,6 +2217,18 @@ showing desired command/args/cwd/restart mode/log refs without routine payloads.
Readback calls the historical evidence `latestLifecycle`, not `actual`, and
reports `processObservation=unknown-until-managed-service-reconcile`. Next add
that reconcile probe and delegate restarts to the existing lifecycle primitive.
The probe/reconcile path is now landed. It uses native platform process
observation, refuses duplicate launch while alive, honors policy disable/
restart/cooldown, and restarts dead or missing services only through the typed
`service_launch` owner. Launch receipt ids now include attempt timestamps and
therefore remain immutable across restarts. Live heartbeat restart root
`C:\Users\Meta\AppData\Local\Temp\epiphany-managed-reconcile-8e3d7cc5fe0b4c5fa38b18b3d00cea0c`
proved the replacement PID `19736` alive under receipt
`daemon-service-lifecycle-receipt-idunn-managed-heartbeat-launch-1783858125893`;
the test harness then killed it deliberately. The first combined smoke exceeded
its harness window because `service_launch` loads the entire local Verse merely
to inspect the swarm brake. Next use the narrow brake loader and integrate
managed-service reconcile into Idunn's native serve scheduler.
## Immediate Re-entry Instruction

View file

@ -114,6 +114,14 @@ service command/args/cwd and sealed log refs used by lifecycle launch, and can
read it beside the latest lifecycle receipt. Readback explicitly reports
process observation as unknown until reconciliation probes reality; a past
`launched` receipt is not allowed to impersonate a living process.
Managed-service reconciliation is now implemented with a native platform PID
probe (`OpenProcess`/`GetExitCodeProcess` on Windows and `kill(pid, 0)` on
Unix). It honors enabled/restart mode/cooldown, observes alive services without
duplicating them, and delegates dead/missing restarts to `service-launch`.
Launch receipts now include an attempt timestamp so restart history is
immutable instead of overwriting one service/action key. Live heartbeat proof
launched, observed alive, simulated a crash, relaunched with a distinct PID and
receipt, then observed the replacement alive on the same heartbeat store.
### Owner
@ -150,6 +158,10 @@ The persistence/publication half is complete. Next add reconciliation that
probes the policy's last PID or an equivalent platform process witness, applies
enabled/restart-mode/cooldown intent, and delegates any restart to the existing
service lifecycle launch primitive.
Reconciliation is complete as an explicit Idunn command. The remaining
unattended boundary is to include managed-service reconciliation in Idunn's
native `serve` scheduler and replace `service-launch`'s full local-Verse context
load with the narrow swarm-brake query it actually needs.
### Forbidden writers