{"content":"feat(me-relay-admission): ME-authoritative LLM relay admission in assist-base-service (branch feat/me-relay-admission, commit c70da3d).\n\nProblem: official ID.Bots relay requests were admitted by the legacy token pools only; ME balances (weekly grant + bonus/topup/earned packs) were invisible at admission and only burned post-settlement, so an exhausted weekly pool 429'd requests even with 7000+ incremental points available.\n\nFix: when ME + metering switches are on, chat/JEV/vision requests now freeze a conservative upper bound on the ME wallet BEFORE upstream spend (padded prompt estimate x2 + output clamp; per-kind media bounds for vision/audio), settle the measured usage afterwards via a new SettleRelayUsage that restores the hold and re-plans the actual charge in ONE transaction (exactly-once via freeze status + metering event probes), and release the hold on upstream failure or zero usage. Overshoot above the reserve caps at the reserved bound; the metering daily limit counts committed burns + open freezes so concurrent in-flight requests cannot overshoot the cap.\n\nAlso: tb_llm_relay_usage.billingSource ('legacy'|'me') records the per-request charging source (guarded idempotent migration); legacy pool sums exclude 'me' rows; bootstrap/quota responses report billingSource + meSpendableMilli; ME admission failures surface stable OpenAI codes insufficient_me / me_daily_limit / billing_unavailable. Legacy admission is unchanged when the gate is off; web-tools keeps its own daily-call quota.\n\nTests: go test ./... green; new unit tests for reserve estimators + error classifier; ME_TEST_DSN-gated integration tests cover settle-below-reserve, overshoot cap, insufficient, grant-only mode, release, daily limit, concurrent freezes.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}