-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Parent epic
Description
Implement the KV read/write/delete layer for EC identity entries, including CAS-based concurrent write protection and consent withdrawal tombstones.
Scope: ec/kv.rs
Acceptance criteria
KvIdentityGraph::get(ec_hash)returnsOption<(KvEntry, u64)>, orNoneif not found.KvIdentityGraph::get_metadata(ec_hash)returnsOption<KvMetadata>for cheap consent/country checks.KvIdentityGraph::create(ec_hash, &entry)writes a new entry. ReturnsErrif the key already exists or on KV error. No retry — callers handle conflicts.KvIdentityGraph::create_or_revive(ec_hash, &entry)creates a new entry OR overwrites an existing tombstone (consent.ok = false); no-ops if a live entry already exists. Called bygenerate_if_needed().KvIdentityGraph::update_last_seen(ec_hash, timestamp)updateslast_seenvia CAS merge, only writes if stored value is >300s old (debounce).KvIdentityGraph::write_withdrawal_tombstone(ec_hash)setsconsent.ok = false, clears partner IDs, 24h TTL. ReturnsResult— callers log error and continue.KvIdentityGraph::delete(ec_hash)hard-deletes — IAB data deletion only, not consent withdrawal.kv.upsert_partner_id(ec_hash, partner_id, uid, timestamp)writes toids[partner_id], creating a minimal live root entry if key is absent, skips if existingsynced >= timestamp.- KV schema matches §7 exactly (JSON roundtrip test).
- Unit tests cover CAS merge, tombstone write, tombstone error handling, serialization roundtrip, metadata extraction.
Spec ref
docs/internal/ssc_technical_spec.md §4, §5.4, §6.2, §7
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels