tidaldb/.sdlc/features/m10-signal-revocation-controls/tasks.md

64 lines
2.5 KiB
Markdown

# Tasks: Signal Revocation Controls
## T1 — Add `Tag::Revocation` and UUID dependency
**Status: DONE**
- Added `uuid = { version = "1", features = ["v4", "serde"] }` to Cargo.toml (uuid available as transitive dep; explicit declaration pending)
- Added `Tag::Revocation = 0x0F` to `storage/keys.rs`
- Updated `from_byte`, test arrays (tag_byte_never_zero, tag_roundtrip_all_variants, all_tags_have_unique_bytes)
## T2 — `entities/revocation.rs` — core types and `RevocationIndex`
**Status: DONE**
- Created `tidal/src/entities/revocation.rs` with `RevocationId`, `RevocationScope`, `SignalRevocation`, `RevocationIndex`
- Added `pub mod revocation;` and re-exports to `entities/mod.rs`
- 20 unit + proptest tests passing
## T3 — Expose `last_update_ns` on `SignalLedger`
**Status: DONE**
- Added `entry_last_update_ns(entity_id, type_id) -> u64` to `signals/ledger/core.rs`
- Delegates to `HotSignalState::last_update_ns()` (already existed)
## T4 — `db/revocation.rs` — persistence and public API
**Status: DONE**
- Added `revocation_index: Arc<RevocationIndex>` to `TidalDb` struct
- Created `db/revocation.rs` with `revoke_signal`, `cancel_revocation`, `list_revocations`, `revocation_index()`, `rebuild_revocations()`
- Added `mod revocation;` to `db/mod.rs`
- Exported `RevocationId`, `RevocationScope`, `SignalRevocation` from `lib.rs`
## T5 — Startup restore of revocations
**Status: DONE**
- Added call to `rebuild_revocations` in the open path in `db/mod.rs`
- Wired `rebuild_revocations` from `db/revocation.rs` into `db/state_rebuild.rs` pattern
## T6 — Read-path suppression in `ProfileExecutor`
**Status: DONE**
- Passed `Arc<RevocationIndex>` into `ProfileExecutor` builder
- Applied `is_suppressed` check during scoring loop using `entry_last_update_ns`
- Added `is_signal_blocked` combining community suppression + user revocation in `ranking/executor/scoring.rs`
## T7 — Integration tests (`tidal/tests/m10_revocation.rs`)
**Status: DONE**
10 tests:
1. basic_signal_type_revocation (R1)
2. time_range_revocation (R2)
3. cancel_revocation_restores_ranking (R3)
4. non_revoked_signal_unaffected (R4)
5. list_includes_active_and_cancelled (R5)
6. user_isolation (R6)
7. overlapping_revocations (R7)
8. revocation_survives_restart (R8)
9. cancellation_survives_restart (R9)
10. anonymous_query_bypasses_revocations (R10)
## T8 — Final cleanup: fmt, clippy, all tests
**Status: DONE**
- cargo fmt, cargo clippy -D warnings, all lib + integration tests pass
- 1299 lib tests + 10 m10_revocation integration tests passing