Record preparation-owned cooldown enforcement

This commit is contained in:
Meta Vens 2026-08-09 20:45:30 +01:00
commit d303dd1f90
3 changed files with 16 additions and 3 deletions

View file

@ -1364,6 +1364,9 @@ Terminal completion owns its cooldown in that same resident-state and
acknowledgement CAS. `next_eligible_at_millis` is persisted from the configured
cooldown before the active lease disappears. The serve loop's sleep is only a
process-efficiency detail; restart cannot become a second eligibility owner.
The shared preparation primitive reloads the persisted state and refuses every
grant before that deadline, so `serve`, `once`, and crash/restart do not need
separate cooldown opinions.
One Heartbeat coordinator turn owns at most one resident grant. Grant issuance
first refuses any prepared or active Self authority, then atomically advances

View file

@ -1278,3 +1278,13 @@ Twenty-four resident tests and eight swarm binary tests pass. Package exact
Require exactly one grant per Heartbeat turn, later pressure pending through the
persisted cooldown (including restart), typed fulfillment once, bounded return
to plateau, and clean zero exits. Active c005 remains untouched.
Pre-package source inspection caught one surviving obsolete path: production
`cycle()` called `prepare_resident_self_launch` without reading the persisted
deadline, and preparation itself did not enforce it. The in-flight de2e8ad5
package was stopped as invalid source; its build logs are preserved under
`.epiphany-run/linux-package-de2e8ad5/`. Pushed `ee05d9bb` moves the read into
the shared preparation primitive. A fresh post-completion call with a committed
later grant now refuses at deadline minus one and prepares exactly at the
deadline. Package latest source containing both `90648073` and `ee05d9bb`;
never resume or publish the stopped de2e8ad5 build.