import type { FraudAdapter, EarnCtx, FraudSignal, AdapterConfig } from '../types.js'

/**
 * Referral-graph adapter: invoked by the reconciliation cron scan (§7), not the hot path.
 * At EARN it is a no-op (graph scan happens nightly — see runReferralGraphScan).
 */
export const referralGraphAdapter: FraudAdapter<EarnCtx> = {
  key: 'referral-graph',
  points: ['EARN'],
  async evaluate(_ctx: EarnCtx, _cfg: AdapterConfig): Promise<FraudSignal | null> {
    // Hot-path no-op — graph ring detection runs in the nightly runReferralGraphScan
    // cron which writes fraud_events directly. Inline traversal deferred to avoid
    // full graph scan on every earn event (ticket: referral-graph-inline-detect).
    return null
  },
}
