Agents Builders

Fix geo-blocked USDC funding

Archived
fix-geo-blocked-usdc-funding

Created

Jun 25, 21:45

Started

Jun 25, 21:46

Completed

Jun 25, 22:58

DevOps handoff

Type

Bug

Shape

backend

Worktree Slug

fix-geo-blocked-usdc-funding

Repositories

turf-monster

Release Train

Branch

feat/fix-geo-blocked-usdc-funding

Local URL

QA URL

Production URL

payments,geo,funding

Acceptance Criteria

  • Transient geo lookup failure retries not stuck 24h
  • ipinfo API token wired via env var
  • Colorado user can start Coinbase USDC buy
  • Regression tests cover blank-state retry behavior

Expected Test Plan

  • unit
  • integration

Checks Run

  • [unit] geo_stale?: blank uses short retry TTL, resolved trusted 24h (4 cases)
  • [unit] geocoder initializer wires IPINFO_API_TOKEN; absent = safe no-op
  • [integration] transient blank geo self-heals within minutes on gated entry path
  • [integration] CDP ramp/wallet/onramp suite unaffected — 101 runs, 430 assertions, 0 failures
  • [full-suite@2d9e7a81da3f6711c6fd660bf246a577eb798015] bin/rails test green
  • [rubocop@2d9e7a81da3f6711c6fd660bf246a577eb798015] bin/rubocop clean

Agent Context

Prod bug: turfmonster.media Buy USDC button disabled with 'isn't available in your state' (no state code shown => geo_state blank). Root cause in app/controllers/application_controller.rb#detect_geo_state: on a transient ipinfo failure/blank-region the rescue (and success path) stamp session[:geo_detected_at]=now while geo_state stays blank, so the 24h staleness check won't re-attempt for 24h on the same IP. geo_blocked? then fails closed (GeoSetting.enforcing? && country==US && state.blank?). Confirmed user IP 174.29.98.236 resolves server-side to Colorado (allowed, not in DEFAULT_BANNED_STATES WA ID MT LA AZ HI NV CA) -> only the cached blank blocks them. STRIPE_CHECKOUT_DISABLED is set so Coinbase is the ONLY funding rail; a geo hiccup hard-locks funding 24h. ipinfo is anonymous tier (readme: missingauth) -> rate-limited, returns region NAME only (state_code='' region_code=nil). Fixes: (1) config/initializers/geocoder.rb add ipinfo_io api_key from ENV[IPINFO_API_TOKEN] (nil-safe, no-op when unset); (2) detect_geo_state: use a short retry TTL (~minutes) when resolved state is blank instead of 24h, so a transient failure self-heals on next request; keep 24h TTL only when a state actually resolved. Name->code map (app/helpers/geo_helper.rb US_STATES) is complete, keep it. Operator follow-ups: provision ipinfo token into 1Password + set IPINFO_API_TOKEN on turf-monster-mainnet; deploy. Immediate user unblock today = clear site data for turfmonster.media (forces fresh detection -> CO).

Stage Timeline

Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. means the agent didn't report that metric.

Sizing Avi · PO Dev Actual LARGE
  1. Created Designed
    M Meowth
    Meowth
    Model
    Duration
    Tokens
    Cost
    Completed Jun 25, 21:45 · 1 day ago
    api
  2. Designed Building
    M Meowth
    Meowth
    Model
    claude-opus-4-8
    Duration
    under a minute
    Tokens
    Cost
    Started Jun 25, 21:45
    Completed Jun 25, 21:46 · 1 day ago
    cli
  3. Building Submitted
    M Meowth
    Meowth
    Model
    claude-opus-4-8
    Duration
    13 minutes
    Tokens
    14,568,345
    Cost
    ~$11.74
    Started Jun 25, 21:46
    Completed Jun 25, 21:58 · 1 day ago
    cli
  4. Submitted Reviewed
    C Carl
    Carl primary
    J Jasper
    Jasper light
    Model
    claude-opus-4-8
    Duration
    43 minutes
    Tokens
    Cost
    Started Jun 25, 21:58
    Completed Jun 25, 22:41 · 1 day ago
    cli
  5. Reviewed Assembled
    S Steffon
    Steffon
    Model
    Duration
    2 minutes
    Tokens
    Cost
    Started Jun 25, 22:41
    Completed Jun 25, 22:43 · 1 day ago
  6. Assembled Shipped
    A Avi
    Avi
    Model
    Duration
    15 minutes
    Tokens
    Cost
    Started Jun 25, 22:43
    Completed Jun 25, 22:58 · 1 day ago
  7. Shipped Archived
    Model
    Duration
    about 3 hours
    Tokens
    Cost
    Started Jun 25, 22:58
    Completed Jun 26, 01:51 · 1 day ago

Conversation

QA review feedback, agent handoffs, and follow-up notes for this task.

No task feedback has been recorded yet.

Sealed-bid sizing

Edit →

Alex (PM)

Avi (PO)

Dev

Actual

LARGE