fix(mission): terminated grant no longer revives to Active after expiry - #8
Merged
Conversation
…piry The registry evicted a terminated tombstone at its own expiry, and approve() had no expiry-in-the-future guard, so re-approving an identical grant after it lapsed returned Active (200) instead of a refusal — expiry laundered a termination. The proven kernel and the tamper-evident ledger were correct throughout (the terminate is recorded before it is reported); this was a registry-layer enforcement gap. Fix, both halves (one without the other leaves a window): - decern-identity: approve() rejects expiry <= now (a dead mission cannot be granted) - decern-store: terminated tombstones are retained for a horizon past expiry, so the store itself keeps refusing re-registration of a terminated s256 Failing regression tests landed first (store-level revival + identity-level expired-approve), then the fix. Closes #7 Signed-off-by: Anivar Aravind <anivar.aravind@gmail.com>
…view nits)
Adversarial review of the revival fix returned merge-safe with three non-blocking
nits; addressing them:
- decern-store: mission_register now refuses registering an already-expired entry
(expiry <= now), so the store is self-monotone for ALL callers, not only via
approve(). Closes the direct-register-after-tombstone-horizon path (unreachable
via HTTP, but the doc claimed more than the code guaranteed). + regression test.
- decern-store: soften the retention-const doc ('bounds how long a tombstone
lingers', not 'caps map growth').
- decern-identity: rename the identity-half test to
approve_refuses_reviving_an_expired_terminated_grant (it exercises approve()'s
guard, not the store half it was misleadingly named after).
Signed-off-by: Anivar Aravind <anivar.aravind@gmail.com>
anivar
added a commit
that referenced
this pull request
Aug 2, 2026
…#10) Bumps all 9 crates and both SDKs to 0.1.1. 0.1.1 is the recommended version: it includes the Mission terminated-grant revival fix and the pre-release honesty corrections; 0.1.0 has the revival bug. Signed-off-by: Anivar Aravind <anivar.aravind@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the terminated-grant revival found in the pre-release claim audit (#7).
The bug
A terminated Mission re-registered as Active once its own
expirylapsed: the registry evicted the terminated tombstone at expiry andapprove()had no expiry-in-the-future guard, so re-approving the identical grant returned 200 (Active) instead of a refusal. An already-expired mission also registered Active on first approval.The proven kernel (
decayand the eight other invariants) and the tamper-evident ledger were correct throughout — the terminate is recorded before it is reported (decern-server), so the audit trail stays honest and would in fact show the revival. The gap was purely in the registry enforcement layer above the kernel.The fix — both halves (one without the other leaves a window)
approve()rejectsexpiry <= now: a dead mission cannot be granted (closes the identity path).s256, independent ofapprove().Tests (failing-first)
decern-store::terminated_mission_does_not_revive_after_expiry— reproduced the revival (failed before, passes after).decern-identity::approve_refuses_an_already_expired_mission+no_post_expiry_revival_of_a_terminated_mission.mission_registry_gc_drops_expired_on_writestill passes — active-expired entries are still evicted; only terminated tombstones are retained.clippy
-D warnings+ fmt clean; workspace builds.Closes #7