Skip to content

feat: Luca Skills V1 + books integrity fixes + ERC-8004 Alchemy Free tier fix#129

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

feat: Luca Skills V1 + books integrity fixes + ERC-8004 Alchemy Free tier fix#129
danbuildss merged 1 commit into
mainfrom
claude/luca-aeon-skills-caYGZ

Conversation

@danbuildss

Copy link
Copy Markdown
Owner

What this ships

Luca Skills V1 — 6 callable financial intelligence endpoints

The first external-facing skill layer. Builders and agents can call these directly.

Endpoint What it does
GET /api/luca/skills Discovery manifest — lists all skills, schemas, data integrity rules
POST /api/luca/skills/wallet-audit Classify address type, report books-compatibility, stable balance
POST /api/luca/skills/agent-books Full financial statement for any agent slug
POST /api/luca/skills/treasury-monitor USDC+USDT balance per wallet, health signal (healthy/low/critical)
POST /api/luca/skills/revenue-analysis gross_inflow vs operating_revenue breakdown with recognition rate
POST /api/luca/skills/registry-check Look up agent by slug, name, or wallet address
POST /api/luca/skills/luca-report Full composite: registry + attribution + books + treasury + summary

All skills use v1Auth (Bearer/X-API-Key). Data integrity rules enforced at every layer.


ERC-8004 contract scan — Alchemy Free tier fix

eth_getLogs is capped at 10-block ranges on Free tier. All 655 planned chunks were failing, returning 0 agents.

Replaced with alchemy_getAssetTransfers — no block-range restriction, works on Free tier, paginated at 1000/page. Diagnostic panel updated to show method, transfers_found, pages_fetched.


Books eligibility integrity fixes

  • Single source of truth: isBooksEligibleWallet() in wallet-eligibility.ts — allowlist of eoa + treasury_contract only
  • Address Classification attribution_status now set by validForBooksCount > 0, not manifest wallet count
  • Attribution Health UI corrected (Books Eligible / Manifest Invalid / Discovered / Unattributed tiers)
  • AEON $3.4M suppressed via under_review confidence label + smarter cache stale detection (compares wallets.analyzed vs currentEligibleCount)
  • Admin cache purge endpoint: DELETE /api/admin/books/snapshot?slug=aeon
  • Profile UI shows "Under Review" badge when financials_under_review

SQL migrations (run in Supabase)

  1. migrations/2026-06-23_manifest-wallet-cleanup.sql — demotes manifest wallets with address_type NOT IN ('eoa', 'treasury_contract') to evidence_source='admin'
  2. migrations/2026-06-23_aeon-under-review.sql — deletes stale AEON books cache + sets under_review confidence label

Test plan

  • GET /api/luca/skills returns 6 skills with correct schemas
  • POST /api/luca/skills/wallet-audit with a known EOA returns books_compatible: true
  • POST /api/luca/skills/registry-check with query: "aeon" returns attribution_tier and wallets
  • POST /api/luca/skills/luca-report with slug: "luca" returns composite report
  • ERC-8004 contract scan: run with fromBlock: 0xE4E1C0, confirm pages_fetched >= 1, rpc_errors: 0
  • AEON profile shows "Under Review" (after running SQL migrations)
  • Attribution Health shows Books Eligible: 4

🤖 Generated with Claude Code

https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye


Generated by Claude Code

Adds GET /api/luca/skills (discovery manifest) and 6 POST skill routes:

- wallet-audit: classify an address, report books-compatibility, stable balance
- agent-books: full financial statement (revenue/expenses/net) for any agent slug
- treasury-monitor: USDC+USDT balance per wallet with health signal (healthy/low/critical)
- revenue-analysis: gross_inflow vs operating_revenue breakdown with recognition rate and quarantine detail
- registry-check: look up agent by slug, name, or wallet address; returns attribution tier and wallet eligibility
- luca-report: composite — registry + attribution + books + treasury + luca_summary in one call

All skills use v1Auth (Bearer/X-API-Key). Data integrity rules enforced:
ERC-8004 = identity only, manifest = attribution, eoa/treasury_contract = books-eligible types,
gross_inflow_usd ≠ revenue.

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

vercel Bot commented Jun 23, 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 23, 2026 5:22am

@danbuildss danbuildss merged commit 42b208a into main Jun 23, 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