Every line AI generates becomes a queryable event. No more black boxes. No more "what did the AI actually do?" Type-safe, zero-cost, production-ready.
Before AI writes a single line, you define the events your system can emit. This becomes the contract—AI can only generate code that speaks your language.
AI writes code that emits well-defined events. Not console.log soup. Not undocumented side effects. Structured, typed, queryable events.
auth.user.login:1 @ 2026-01-23T14:32:01Z user_id=550e8400... ip=192.168.1.42 method="password" mfa=true auth.user.login:1 @ 2026-01-23T14:32:15Z user_id=7c9e6679... ip=10.0.0.55 method="oauth" mfa=false auth.user.locked:1 @ 2026-01-23T14:32:47Z user_id=a1b2c3d4... attempts=5 duration_mins=30 auth.user.logout:1 @ 2026-01-23T14:33:02Z user_id=550e8400... reason="user_initiated"
Once events are in your system, you can query them with SQL patterns. Find all failures. Count by domain. Debug AI behavior.
Events your system can emit
Code that emits typed events
Real-time, queryable data
See exactly what happened
The most powerful part: AI-generated code emits events that AI can learn from. Feedback loops become possible.
agent.code.generated:1 file="src/auth/login.rs" lines=47 model="claude-3.5-sonnet" confidence=0.94 agent.test.failed:1 test="generated_code_tests" reason="assertion failed at line 34" agent.code.generated:1 file="src/auth/login.rs" lines=52 model="claude-3.5-sonnet" confidence=0.91 agent.test.passed:1 test="generated_code_tests" // AI can query: "In the last 100 generations, I failed 23 times on auth modules" // AI can learn: "When confidence < 0.9 on auth code, add extra validation"
Every AI action is an event. You see exactly what it did, when, and why it might have failed.
Query %.failed:% and see every failure across your system. No more log diving.
Events are validated at compile time. AI can't emit undefined events—the catalog is the spec.
AI queries its own event history. "I fail 23% on auth" becomes actionable insight.
Here's the core EventId type and emit! macro. Copy this into your project or use as reference.
The specification is open. The implementation is here. Every event your AI generates becomes queryable, traceable, improvable.