π» Ouija Debugger
Debugging, from beyond the grave.
A crashed service "speaks" through a sΓ©ance board β logs (CloudWatch) + an LLM (simulated or Bedrock) + a haunted React UI β stitched into one eerie debugging experience.
Inspiration
I was fascinated by the idea of making debugging feel like a supernatural experience β where error logs are messages from a "haunted" service trying to communicate its problems. The sΓ©ance board aesthetic transforms the clinical process of debugging into something immersive and memorable.
The project also challenged me to think about serverless architecture in a unique way: how can we build a production-ready system that feels like a proof-of-concept experiment?
What it does
Ouija Debugger is a serverless incident-capture and diagnostic application that:
- Capture β CloudWatch Logs subscription triggers on error logs
- Group β Events are grouped by service and 60-second windows
- Diagnose β Simulated LLM analyzes patterns and returns diagnoses with confidence scores
- Visualize β React sΓ©ance board displays incidents and diagnosis results
Key Features:
- Pattern-based diagnosis (no Bedrock required)
- Automatic incident grouping
- Real-time UI updates via polling
- SΓ©ance board with animated planchette
How we built it
Tech Stack:
- Infra: AWS CDK v2 (TypeScript) β CloudFormation
- Backend: Lambda (Node.js 20.x) + API Gateway HTTP API + DynamoDB
- Frontend: React + Vite + TypeScript + Canvas 2D
- Testing: Vitest + fast-check (property-based)
Architecture:
[Browser] β [API Gateway] β [Lambda Functions]
ββ Hello: Health check
ββ Simulate: Inject test logs
ββ Ingest: Parse CloudWatch logs
ββ API: Serve incidents
ββ Diagnose: Generate diagnoses
CloudWatch Logs β Subscription Filter β Lambda (Ingest)
β
DynamoDB (ouija-incidents)
β
API Gateway β Browser
Key Design Decisions:
- Simulated LLM: Pattern-based diagnosis instead of Bedrock API calls
- Conditional Writes: Prevent data races with
attribute_not_exists(pk) - 60-Second Window Grouping: Group events by service and time
- Event Capping: 50 events/incident, 2000 char message limit
Challenges we ran into
| Challenge | Solution |
|---|---|
| Bedrock Cost | Replaced with pattern-based simulation (instant, free, predictable) |
| DynamoDB _version Attribute | Renamed to version (no underscore prefix allowed) |
| CORS Headers Missing | Added explicit CORS headers to all Lambda responses |
| Log Grouping Race Conditions | DynamoDB conditional writes with bounded retries |
| TypeScript Import Issues | Used @aws-sdk/lib-dynamodb's DynamoDBDocumentClient |
Accomplishments that we're proud of
- β Zero Bedrock dependency β Simulated LLM works offline
- β Complete CI/CD pipeline β GitHub Actions with OIDC authentication
- β Production-ready architecture β Conditional writes, bounded retries, CORS headers
- β Interactive UI β SΓ©ance board with animated planchette and diagnosis visualization
- β All tests passing β 17 tests across 4 services
- β Clean deployment β CDK synth/build passes, no manual console clicks
What we learned
Building Ouija Debugger taught me:
- AWS Serverless Patterns: How CloudWatch Logs subscriptions trigger Lambda functions, how API Gateway routes HTTP requests to Lambdas, and how DynamoDB conditional writes prevent data races
- LLM Integration Patterns: Even without a real LLM, you can simulate intelligent responses using pattern matching and heuristics
- CORS Configuration: HTTP API CORS settings differ from REST API, requiring explicit headers in Lambda responses
- CDK as Infrastructure-as-Code: Writing reusable stack constructs with proper resource sharing and permission grants
What's next for Ouija Debugger
Planned Improvements:
- Add property-based tests for log parsing with
fast-check - Implement real Bedrock integration as an optional feature flag
- Add CloudWatch Alarms for cost monitoring and error rates
- Implement retry logic for failed CloudWatch log deliveries
- Add log preview to the sΓ©ance board canvas
Future Features:
- Multiple diagnosis modes (simulated, Bedrock, custom models)
- Custom scenario creation via API
- Historical diagnosis trend analysis
- Export diagnoses as JSON/PDF reports
- Slack/Email notifications for new incidents
Built With
- amazon-web-services
- kiro
- llama
- typescript