+118
dancer/CLAUDE.md
+118
dancer/CLAUDE.md
···+1. **Comprehensive Schema**: The SQLite schema captures everything that might be useful for Claude's analysis:+2. **Full-Text Search**: Using SQLite's FTS5 with porter stemming and unicode support for comprehensive search across all text fields.+1. **No Truncation**: Keep all data intact for Claude to analyze. Storage is cheap, context is valuable.+2. **Structured Everything**: The more structure we capture, the better Claude can understand patterns and correlations.+3. **Synchronous is Fine**: For now, synchronous SQLite operations are acceptable. Performance optimization can come later.+4. **Reporter Chaining**: Following Logs library conventions by supporting reporter chaining allows integration with existing logging infrastructure.+5. **Export for Claude**: Special export format that prepares context within token limits, focusing on recent errors and patterns.
+22
dancer/Makefile
+22
dancer/Makefile
···+opam install -y sqlite3 eio eio_main logs fmt ptime digestif yojson cmdliner ppx_deriving alcotest str
+72
dancer/README.md
+72
dancer/README.md
···+Dancer is an ambitious OCaml library that enables long-running services to automatically improve themselves through AI-assisted code generation, with comprehensive logging, pattern detection, and safe deployment mechanisms.
+352
dancer/bin/dancer_logs_cli.ml
+352
dancer/bin/dancer_logs_cli.ml
···+| [hash; error_type; error_code; count; sessions; users; last; first; sources; avg_dur; sample] ->
+5
dancer/bin/dune
+5
dancer/bin/dune
+34
dancer/dancer-logs-cli.opam
+34
dancer/dancer-logs-cli.opam
···
+44
dancer/dancer-logs.opam
+44
dancer/dancer-logs.opam
···
+45
dancer/dune-project
+45
dancer/dune-project
···
+545
dancer/lib/dancer_logs/dancer_logs.ml
+545
dancer/lib/dancer_logs/dancer_logs.ml
···+let msg = Str.global_replace (Str.regexp "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}") "UUID" msg in+let sql = "UPDATE patterns SET last_consultation = ?1, consultation_count = consultation_count + 1 WHERE pattern_hash = ?2" in
+235
dancer/lib/dancer_logs/dancer_logs.mli
+235
dancer/lib/dancer_logs/dancer_logs.mli
···
+5
dancer/lib/dancer_logs/dune
+5
dancer/lib/dancer_logs/dune
+316
dancer/lib/dancer_logs/schema.sql
+316
dancer/lib/dancer_logs/schema.sql
···+CREATE INDEX IF NOT EXISTS idx_logs_error_hash ON logs(error_hash) WHERE error_hash IS NOT NULL;+CREATE INDEX IF NOT EXISTS idx_logs_session_id ON logs(session_id) WHERE session_id IS NOT NULL;+CREATE INDEX IF NOT EXISTS idx_logs_request_id ON logs(request_id) WHERE request_id IS NOT NULL;+CREATE INDEX IF NOT EXISTS idx_logs_error_type ON logs(error_type) WHERE error_type IS NOT NULL;+CREATE INDEX IF NOT EXISTS idx_logs_duration ON logs(duration_ms) WHERE duration_ms IS NOT NULL;+CREATE INDEX IF NOT EXISTS idx_logs_status_code ON logs(status_code) WHERE status_code IS NOT NULL;+CREATE INDEX IF NOT EXISTS idx_patterns_severity ON patterns(severity_score DESC) WHERE severity_score IS NOT NULL;