Skip to content

Luca analyst v1: system prompt, read-only skills, verifier, evals#214

Merged
danbuildss merged 11 commits into
mainfrom
feat/luca-analyst-v1
Jul 25, 2026
Merged

Luca analyst v1: system prompt, read-only skills, verifier, evals#214
danbuildss merged 11 commits into
mainfrom
feat/luca-analyst-v1

Conversation

@danbuildss

Copy link
Copy Markdown
Owner

What this is

Luca v1 — the financial analyst of Zetta, built to the spec we agreed: he reads Zetta's published data and explains it. The ledger decides what is true; Luca decides how to explain it. He runs on Hermes (GPT-5.4) with his own verified wallet.

What's in this PR

luca/
  prompts/luca-v1.md        # system prompt (constitution) — hard rules, terminology, answer structure, tone
  skills/*.skill.json       # 6 read-only skill specs wired to Zetta APIs
  src/verify-response.ts    # deterministic post-processor
  evals/luca-evals.jsonl    # 10 golden eval cases
  evals/run-evals.ts        # CI-blocking eval runner
  README.md                 # Hermes wiring guide

The five trust mechanisms

  1. Locked system prompt — every number must come from a skill response; volume ≠ revenue; unresolved ≠ earnings; "we don't know" preferred over guesses; no investment advice; citations always.
  2. Read-only skillsget_agent_snapshot, get_revenue_quality, get_unresolved_items, get_anomalies, compare_periods, get_leaderboard. Public skills hit the PR Build backend financial intelligence engine #202 public API; internal skills are operator-gated behind ZETTA_INTERNAL_SECRET. Luca never gets raw DB access and never computes his own deltas (server-computed only).
  3. Deterministic verifier (src/verify-response.ts) — post-processing hook that extracts every $ figure and % from Luca's draft and confirms each one traces to a skill response (with rounding + percent↔fraction tolerance). Uncited figure → draft rejected. Plus forbidden-phrase guardrails ("wallets received revenue", "you should buy", hype).
  4. Eval suite — 10 trap cases: $50k volume/$0 verified, no-snapshot ghost agent, 100% customer concentration, candidates-not-revenue, swaps≠revenue, deferred revenue, incomparable periods, no-advice refusal, anomaly framing ("flagged for review", never "fraud"). Runner exits 1 on any failure → wire into CI.
  5. Luca on Zetta — he's registered with his own manifest + verified wallet, so his own service revenue flows through the same pipeline he explains. The reference onboarding example.

Backend work this PR surfaces (follow-up, not included)

The skills expect 5 small read-only endpoints that don't exist yet — all are simple queries over PR #202 tables:

  • GET /api/v1/financial-intelligence/{slug}/compare (public)
  • GET /api/v1/financial-intelligence/leaderboard (public)
  • GET /api/admin/financial-intelligence/revenue-quality (internal)
  • GET /api/admin/financial-intelligence/unresolved (internal)
  • GET /api/admin/financial-intelligence/anomalies (internal)

Until those ship, Luca's public mode works against the existing GET /api/v1/financial-intelligence/{slug}.

Notes

  • No frontend changes. No changes to the financial core — this PR only adds the luca/ directory.
  • First commit batch hit a branch-head race (parallel writes); files were re-committed sequentially, all 9 files present on the branch.

@vercel

vercel Bot commented Jul 25, 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 Jul 25, 2026 11:10pm

@danbuildss
danbuildss merged commit 067a160 into main Jul 25, 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.

1 participant