SharedTableProtocol now covers the full shared-table surface:
- sellers, market_comps, reported_sellers (already in SnipeSharedStore)
- scammer_blocklist (new — is_blocklisted, add/remove/list_blocklist)
- refresh_seller_categories (reads per-user SQLite, writes to Postgres)
TrustScorer updated to accept SharedTableProtocol (was Store).
api/main.py:
- _pg_shared_store global + _make_shared_store(path) helper
- Lifespan init: SNIPE_SHARED_DB_URL → SnipeSharedDB + SnipeSharedStore
- All Store(shared_db) calls for shared tables replaced with
_make_shared_store(shared_db) or shared_store.clone()
- Blocklist endpoints use _make_shared_store (Postgres when configured)
- Community signals stay SQLite-only (low-write, not in protocol)
Postgres migration 001: scammer_blocklist table added.
8 blocklist tests added (gated behind SNIPE_SHARED_DB_URL / @pytest.mark.postgres).
.env.example: SNIPE_SHARED_DB_URL documented.
compose.cloud.yml: GPU_SERVER_URL + SNIPE_SHARED_DB_URL comment added.
248 passed, 8 skipped (postgres-gated).
Closes: #45
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_pg_shared.py | ||
| test_protocol.py | ||
| test_store.py | ||