Make terminal acknowledgement kill resident grant

This commit is contained in:
Meta Vens 2026-08-09 21:40:34 +01:00
commit 61d061404b
4 changed files with 76 additions and 9 deletions

View file

@ -1380,6 +1380,15 @@ Heartbeat turn. Pressure arriving after that turn spent its grant stays pending
until Heartbeat consumes the exact terminal acknowledgement and schedules a
different coordinator turn.
Terminal acknowledgement is irreversible grant death. Pending-grant selection
loads all `ResidentSelfTerminalAck` rows first and excludes their exact grant IDs
before considering `consumed_at_millis`. Heartbeat applies the same exclusion
when deciding whether another unconsumed grant blocks issuance. The consumed
marker proves preparation consumed launch authority; it cannot reopen authority
after completion, cancellation, restart, stale-envelope resolution, or marker
regression. Lifecycle retention may delete this evidence only after Heartbeat has
consumed the acknowledgement and the owning turn is already closed.
Imagination candidate time is part of that causal contract. A candidate must
have a valid RFC3339 timestamp at or after its request timestamp. A
well-shaped candidate from before the request cannot close resident authority.

View file

@ -1315,3 +1315,25 @@ test that explicitly blessed same-turn retry was corrected. Twenty-four resident
eight swarm, and eleven heartbeat-state tests pass. Commit and push this cut,
package the exact commit, and replay from a fresh idle copy. Do not reuse the
invalid d303 body as bounded-turn evidence.
Exact `c77824ef` packaged as warning-free 24-binary release
`sha256-e0b7c5cf54c4fb62929d91326c4604e8ad486c59411d6b2509de9182e7a83482`
with witness
`sha256-f923a10c4a96b4301a952c3f874a913535f3165fee531034bbce077811a5629b`.
The fresh copied body under `.epiphany-run/active-cognition4-c77824ef`
matched all 7,668 accepted-idle files. One exact grant completed and persisted
`nextEligibleAtMillis=1786307607233`; Self restarted zero and slept through the
deadline. Heartbeat never issued another grant after the original pulse-48
grant, so schedule/action issuance cardinality is accepted.
After expiry, Self nevertheless launched again. The typed diagnostic proved the
active lease named the exact already-completed pulse-48 grant, not another
Heartbeat grant. This run is rejected and was stopped with receipts. The deeper
ownership rule is that `ResidentSelfTerminalAck`, not the mutable
`consumed_at_millis` marker, permanently kills its exact grant. Pending selection
and Heartbeat's unconsumed-grant fence now exclude every terminally acknowledged
grant. A focused test deliberately regresses a completed grant's consumed marker
to absent and proves it remains unselectable while a different Heartbeat turn may
still grant later pending pressure. Twenty-four resident, eight swarm, and eleven
heartbeat-state tests pass. Commit, push, package, and replay this terminal fence;
do not treat c778 as bounded endurance evidence.