snipe/app/trust
pyr0ball e34c2b9982 feat(db): wire Postgres shared backend into main.py and extend protocol
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
2026-05-22 15:47:36 -07:00
..
__init__.py feat(db): wire Postgres shared backend into main.py and extend protocol 2026-05-22 15:47:36 -07:00
aggregator.py fix(trust): treat feedback_ratio=0.0 as missing data for buyer-only/returning sellers (#52) 2026-05-04 09:24:27 -07:00
metadata.py fix(trust): treat feedback_ratio=0.0 as missing data for buyer-only/returning sellers (#52) 2026-05-04 09:24:27 -07:00
photo.py feat: preferences store, community signals, a11y + API fixes 2026-04-14 16:15:09 -07:00