Athena

Athena Client Pressure Crate

What belongs in crates/athena-client-pressure and what still stays in the server runtime.

crates/athena-client-pressure is the extraction seam for Athena's client pressure domain. The crate owns the scoring model, snapshot persistence helpers, admin-facing read models, and the reusable pressure worker loop without depending on Actix route types or the full server bootstrap.

What Lives Here Today

  • Client-pressure snapshot records and worker-domain DTOs.
  • Pressure scoring and placement-hint helpers.
  • SQLx persistence helpers for pressure snapshot runs, snapshots, history, and backfill requests.
  • Admin-oriented read helpers for pressure overview and per-client detail views.
  • The reusable worker loop that scans completed windows and persists pressure snapshots behind a runtime trait boundary.

What Still Stays In athena_rs

  • Actix route handlers for /admin/clients/pressure*.
  • Config file loading and environment overrides for worker intervals.
  • Connection-pool manager setup and client-target discovery from config plus athena_clients.
  • Runtime EXPLAIN execution against target Postgres databases.

Current Extraction Rule

Use athena-client-pressure when code is about client-pressure computation, window persistence, or worker orchestration that can run behind a narrow runtime trait.

Keep code in athena_rs when it needs:

  • Actix request or response types
  • AppState or bootstrap registries
  • config-file resolution
  • live connection-pool factories
  • server-specific route auth/logging

Near-Term Direction

The next client-pressure slices should keep the same boundary:

  1. Keep shrinking athena_rs around thin route and runtime wrappers.
  2. Move more reusable worker/runtime helpers only when they stop depending on server-local pool abstractions.
  3. Leave broader query-optimization and placement workflows to their dedicated crates instead of re-expanding this one.