lilith-platform.live/codebase/@features/score-refresh
2026-05-18 03:01:15 -07:00
..
bin feat(score-refresh): Implement scheduled score refresh system with HTTP clients, 4 data source adapters (Henley, NSWP, Spartacus, Tryst), CLI tooling, and systemd nightly scheduling 2026-05-18 01:30:06 -07:00
src feat(score-refresh): Implement score refresh logic in refresh.ts to support recalculating or updating user scores 2026-05-18 03:01:15 -07:00
systemd infra(score-refresh): 🧱 Add systemd service file for automated nightly score refresh scheduling 2026-05-18 02:41:07 -07:00
bun.lock feat(score-refresh): Implement scheduled score refresh system with HTTP clients, 4 data source adapters (Henley, NSWP, Spartacus, Tryst), CLI tooling, and systemd nightly scheduling 2026-05-18 01:30:06 -07:00
package.json
README.md feat(score-refresh): Implement scheduled score refresh system with HTTP clients, 4 data source adapters (Henley, NSWP, Spartacus, Tryst), CLI tooling, and systemd nightly scheduling 2026-05-18 01:30:06 -07:00
tsconfig.json chore(score-refresh): 🔧 Update TypeScript compiler options in score-refresh feature for improved type checking and module resolution 2026-05-18 01:30:06 -07:00

@lilith/score-refresh

Nightly aggregator that refreshes destinations scoring columns from public sources:

Source Column populated Notes
Henley & Partners HNWI Cities Report wealth_score (percentile) per-city HNWI count
Spartacus Gay Travel Index lgbtq_score country-level, mapped to destination by ISO-2
NSWP Sex Work Laws Map sw_legal_tier country-level, baseline overlay
Tryst.link in-{city} listing density market_saturation_score provider count percentile per destination slug

Composite sex_positive_score is the mean of LGBTQ and the SW-legality contribution. All sources record provenance + per-source success into destinations.score_sources JSONB. Partial failures are allowed; the row still updates with the sources that did succeed.

Run

QUINN_DB_URL=postgres://... bun run bin/refresh.ts

The systemd unit at systemd/score-refresh-nightly.{service,timer} runs nightly at 10:00 UTC (03:00 PT).

Politeness

The HTTP wrapper enforces 1 req/sec per origin, a 30-second total timeout, and identifies the user-agent as a research tool with contact info.