[P0-25] Prove target-lease crash recovery and stale-writer exclusion #140
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-server#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Objective
Prove the complete StarIntel target-lease system remains safe under expiry, crashes, ambiguous outcomes, restart/failover, revocation, and delayed stale execution.
Current source already implements the core lease primitives: backend-neutral typed outcomes, monotonic fencing, Valkey server-authoritative time, atomic renew/release/revoke, idempotent acquisition receipts, fail-closed corrupt/no-TTL handling, and a fenced authoritative-set seam. This issue therefore owns the recovery/race proof program, not a lease-store rewrite.
Canonical ARDR authority
lost-rob0t/starintel-auto-research/roam/research/star-server/STAR-RESEARCH-033-target-lease-recovery-race-matrix.orglost-rob0t/starintel-auto-research/roam/design/star-server/STAR-SERVER-045-target-lease-recovery-race-matrix.orglost-rob0t/starintel-auto-research/roam/indexes/star-server/STAR-LEASE-INDEX-030-backend-neutral-kv-leases.orglost-rob0t/starintel-server#32Required scenarios
Stable matrix identifiers are defined in
STAR-SERVER-045:Recovery invariants
runningor actor/process liveness never grants authority.Dependency order
The deterministic classifier/harness slices may proceed independently once operator-authorized. The final stale-writer production acceptance slice depends on #32's concrete fenced side-effect seam.
Proposed implementation slices — PENDING OPERATOR APPROVAL
Slice 1 — pure recovery classifier + deterministic RED fixtures
No network/process orchestration.
Mandatory RED-first target:
Persisted execution A carries lease/fence
N; current observed lease for the same identity carriesN+1. Untouched currentmasterhas no typed recovery classifier. The RED must fail for that missing boundary. GREEN must returnstale-generationand prove zero acquire/renew/effect callbacks occur.Sibling REDs:
outcome-unknown-> resolve original request identity, never fresh acquire;reacquire-requiredwithout mutating old execution authority;Slice 2 — shared LR-* deterministic scenario harness
Reuse the existing memory lease backend/contract. Add explicit barriers and controlled time; do not create a second fake lease algebra or sleep-driven semantic suite.
Slice 3 — real Valkey race/TTL/ambiguous-response evidence
Extend existing
t/valkey-lease-integration-test.lispwith LR-01/02/03/05/11 and controllable restart evidence. Preserve ValkeyTIMEas authority.Slice 4 — production stale-writer acceptance
After #32 exposes one real fenced side-effect boundary:
A renew/release
stale-tokentest alone does not satisfy this acceptance criterion.Slice 5 — restart/restore fencing-floor proof
Test normal restart with retained fence state and fail-closed recovery when restored/failover state cannot prove a fence greater than generations already accepted downstream. Do not claim stronger Valkey failover semantics than the actual tested durability configuration.
Acceptance criteria
Implementation authorization
PENDING / AWAITING_OPERATOR_APPROVALP0 priority, research readiness, completed design/adversarial review, issue state, or green tests do not authorize implementation. Only an explicit operator authorization recorded in the canonical approval workflow may expose a slice to RAGE.