① Key Format Check → Must start with "us-", else 401
② Identity Resolution → SHA-256(key) → KV auth:hash:{hash} → User UID
miss: Supabase DB fallback + KV write-back (TTL=30d)
③ Profile Load → KV profile:{uid} → legacy key migration → DB fallback
contains: credits, tier, username (self-healing write-back)
④ Skill Lookup → Private KV → Official KV → Market KV
full miss: 400 "Skill not registered"
⑤ Rate Limit Check → Tier-based RPM quota, KV atomic counter, 429 on exceed
⑥ Credit Pre-check → currentCredits < creditsPerCall → 402 (no charge)
⑥.₅ Experience Inject → Vectorize input via Voyage AI → Supabase RPC similarity search
match ≥ 0.85: fetch preventionPatch, inject into request
⑦ Execute → isHardcoded? Native Handler : Generic Executor
Native fail: Tactic B — append patch to error text
LLM skill: Tactic C — inject into messages[-1].content
⑧ Bill + Telemetry → ctx.waitUntil (non-blocking):
a. deductCredit → KV write-back + Vercel Webhook → Supabase
b. recordSkillCall → Supabase RPC record_skill_usage
c. saveInvocationLog → POST /rest/v1/invocations