flybrain/infra/units/flyshadow-guard.timer
acamilo 2d8b529f42 infra: the shadow's live-impact guard (SHADOW-01 review N2, N1)
fly-shadow-run start records the live fly's baseline (fly_realtime_factor
over 10 s, fly_lag_seconds, uptime), waits for the shadow's heartbeat and
starts flyshadow-guard.timer. fly-shadow-run guard (every 60 s, root)
stops the shadow and the guard, removes the trace drop-in and restarts
flysim without the trace when fly_lag_seconds grew 1 s in the same
process or the mean realtime factor fell below min(0.97, baseline-0.03);
a paused fly is not judged, a restarted one rebaselines. check passes
--current /opt/fly/current --binary flysim-session. lint drives the
guard's rule on six cases. Runbook rewritten: the trace cannot outlive
the shadow (heartbeat, 8 GiB directory cap), not the old claim.
2026-09-30 01:39:52 +00:00

11 lines
448 B
SYSTEMD

# infra/units/flyshadow-guard.timer — SHADOW-01's live-impact guard, every 60 s while a shadow
# runs. Started by `fly-shadow-run start`, stopped by `fly-shadow-run stop` and by the guard
# itself when it trips. No [Install]: it is never enabled, so a reboot does not start it.
[Unit]
Description=Stop the shadow run if the live fly pays for it (SHADOW-01)
[Timer]
OnActiveSec=60s
OnUnitActiveSec=60s
AccuracySec=5s
Unit=flyshadow-guard.service