Skip to content

Luca + AEON skills: ERC-4337 classification, agent read-order, Surplus inference & buy/sell#169

Merged
danbuildss merged 1 commit into
mainfrom
claude/luca-aeon-skills-caYGZ
Jun 29, 2026
Merged

Luca + AEON skills: ERC-4337 classification, agent read-order, Surplus inference & buy/sell#169
danbuildss merged 1 commit into
mainfrom
claude/luca-aeon-skills-caYGZ

Conversation

@danbuildss

Copy link
Copy Markdown
Owner

Summary

  • ERC-4337 smart account classification: adds smart_account address type (detected via validateUserOp selector) so smart-account operator wallets are no longer misclassified as smart_contract and blocked from books. Adds an admin endpoint (/api/admin/registry/update-wallet-type) to override wallet types manually.
  • Stale-figure fix + global read-order doctrine: force-regenerates stored reports and adds a hard "AGENT READ-ORDER" rule to Luca's shared doctrine so financial figures for any of the 143 indexed agents are always read live from Zetta truth (/api/v1/luca/agent-read) instead of memory or stale stored report prose. Non-indexed agents get a clearly labeled observational fallback.
  • Surplus inference via Zetta proxy for Hermes: new POST /api/v1/luca/inference, authenticated with the same v1 API key Luca already uses for every other skill (previously the only proxy required ZETTA_INTERNAL_SECRET, which Hermes doesn't have). Spend is logged automatically to inference_events and agent_economic_events.
  • Surplus buy/sell interface (inference credits): Luca can now self-issue its own inf_ buyer key via SIWE so inference settles in USDC from its own wallet on Base, making spend attributable on-chain:
    • GET /api/v1/luca/surplus/challenge — fetch SIWE challenge to sign
    • POST /api/v1/luca/surplus/buyer-key — exchange signed message for inf_ key
    • GET /api/v1/luca/surplus/status — balance / allowance / active keys
    • GET /api/v1/luca/surplus/prices — per-token USDC pricing
    • GET /api/v1/luca/surplus/models — available models
    • /api/v1/luca/inference now prefers LUCA_SURPLUS_BUYER_KEY over the shared SURPLUS_API_KEY once set
  • Skills catalog (/api/luca/skills) updated with agent-read, surplus-inference, and all 5 Surplus buy/sell endpoints.

Test plan

  • Verify /api/admin/registry/update-wallet-type correctly overrides a wallet's address_type and that agent_books_cache invalidation/regeneration reflects it
  • Confirm Luca on Telegram answers agent financial questions using live /api/v1/luca/agent-read data, not stale stored report figures
  • Confirm /api/v1/luca/inference succeeds from Hermes using the standard v1 API key (no ZETTA_INTERNAL_SECRET needed)
  • Run the Surplus SIWE flow end-to-end (challenge → sign → buyer-key) and confirm the returned inf_ key works against /api/v1/luca/surplus/status
  • After setting LUCA_SURPLUS_BUYER_KEY, confirm inference spend settles from Luca's wallet on Base rather than the shared key

🤖 Generated with Claude Code


Generated by Claude Code

…account management

Adds the full Surplus buyer key flow so Luca can self-issue an inf_ key
and have inference costs settle from its own wallet on-chain via USDC on Base.

New endpoints (all v1Auth — same API key as all other Luca skills):
- GET  /api/v1/luca/surplus/challenge  — Step 1: fetch SIWE challenge to sign
- POST /api/v1/luca/surplus/buyer-key  — Step 2: exchange signed message for inf_ key
- GET  /api/v1/luca/surplus/status     — check USDC balance, allowance, active keys
- GET  /api/v1/luca/surplus/prices     — current per-token pricing in USDC
- GET  /api/v1/luca/surplus/models     — available Surplus models

Updates:
- /api/v1/luca/inference now prefers LUCA_SURPLUS_BUYER_KEY over SURPLUS_API_KEY
  so spend settles from Luca's wallet once the buyer key is set
- Skills catalog updated with all 5 new Surplus endpoints
- .env.example documents LUCA_SURPLUS_BUYER_KEY

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RjpGP3kYKnQuQAUoK6RZky
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zetta Ready Ready Preview, Comment Jun 29, 2026 10:55pm

@danbuildss danbuildss merged commit c23a281 into main Jun 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants