tracebook 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +66 -27
- data/README.md +201 -754
- data/app/assets/javascripts/tracebook/application.js +92 -35
- data/app/assets/stylesheets/tracebook/application.css +1915 -50
- data/app/controllers/tracebook/application_controller.rb +25 -0
- data/app/controllers/tracebook/chats_controller.rb +229 -0
- data/app/controllers/tracebook/comments_controller.rb +25 -0
- data/app/helpers/tracebook/chats_helper.rb +29 -0
- data/app/models/tracebook/chat_review.rb +19 -0
- data/app/models/tracebook/comment.rb +14 -0
- data/app/models/tracebook/message_cost.rb +12 -0
- data/app/models/tracebook/pricing_rule.rb +6 -8
- data/app/views/tracebook/chats/index.html.erb +77 -0
- data/app/views/tracebook/chats/show.html.erb +94 -0
- data/config/routes.rb +7 -5
- data/db/migrate/20260325000100_create_tracebook_message_costs.rb +19 -0
- data/db/migrate/20260325000200_create_tracebook_chat_reviews.rb +19 -0
- data/db/migrate/{20241112000300_create_tracebook_pricing_rules.rb → 20260325000300_create_tracebook_pricing_rules.rb} +3 -3
- data/db/migrate/20260325000500_create_tracebook_comments.rb +15 -0
- data/lib/generators/tracebook/install/USAGE +10 -0
- data/lib/generators/tracebook/install/install_generator.rb +33 -0
- data/lib/generators/tracebook/install/templates/initializer.rb.tt +16 -0
- data/lib/tasks/tracebook_tasks.rake +14 -4
- data/lib/tracebook/adapters/ruby_llm.rb +19 -81
- data/lib/tracebook/adapters.rb +5 -4
- data/lib/tracebook/config.rb +85 -101
- data/lib/tracebook/engine.rb +6 -0
- data/lib/tracebook/errors.rb +0 -2
- data/lib/tracebook/pricing/calculator.rb +11 -6
- data/lib/tracebook/pricing.rb +0 -2
- data/lib/tracebook/redaction/pattern.rb +124 -0
- data/lib/tracebook/redaction/pipeline.rb +32 -0
- data/lib/tracebook/seeds/pricing_rules.rb +62 -0
- data/lib/tracebook/version.rb +1 -1
- data/lib/tracebook.rb +47 -152
- metadata +32 -43
- data/app/controllers/tracebook/exports_controller.rb +0 -25
- data/app/controllers/tracebook/interactions_controller.rb +0 -71
- data/app/helpers/tracebook/interactions_helper.rb +0 -35
- data/app/jobs/tracebook/daily_rollups_job.rb +0 -100
- data/app/jobs/tracebook/export_job.rb +0 -162
- data/app/jobs/tracebook/persist_interaction_job.rb +0 -160
- data/app/mailers/tracebook/application_mailer.rb +0 -6
- data/app/models/tracebook/interaction.rb +0 -100
- data/app/models/tracebook/redaction_rule.rb +0 -81
- data/app/models/tracebook/rollup_daily.rb +0 -73
- data/app/views/tracebook/interactions/index.html.erb +0 -105
- data/app/views/tracebook/interactions/show.html.erb +0 -44
- data/db/migrate/20241112000100_create_tracebook_interactions.rb +0 -55
- data/db/migrate/20241112000200_create_tracebook_rollups_dailies.rb +0 -24
- data/db/migrate/20241112000400_create_tracebook_redaction_rules.rb +0 -19
- data/lib/tracebook/adapters/active_agent.rb +0 -82
- data/lib/tracebook/mappers/anthropic.rb +0 -59
- data/lib/tracebook/mappers/base.rb +0 -38
- data/lib/tracebook/mappers/ollama.rb +0 -49
- data/lib/tracebook/mappers/openai.rb +0 -75
- data/lib/tracebook/mappers.rb +0 -283
- data/lib/tracebook/normalized_interaction.rb +0 -86
- data/lib/tracebook/redaction_pipeline.rb +0 -88
- data/lib/tracebook/redactors/base.rb +0 -29
- data/lib/tracebook/redactors/card_pan.rb +0 -15
- data/lib/tracebook/redactors/email.rb +0 -15
- data/lib/tracebook/redactors/phone.rb +0 -15
- data/lib/tracebook/redactors.rb +0 -8
- data/lib/tracebook/result.rb +0 -53
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e2f8a716313316fea53f5eb3b9b62f43a888853a8cfc3aac7118b1503581a511
|
|
4
|
+
data.tar.gz: c42e3fd3d3096deb1cddfaa70de758c8f27bb3ba0ab1366cda5836ab65a95f31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d93ee5f38109afcee853d0f4e8733a1c4244974dfdb265adcfe21efeaf4f8cd70c0409c3da57c743e16af164c5565e3aa282d1e3fc267746491ec57a5535f1f9
|
|
7
|
+
data.tar.gz: 7f0b592525f3f71f993dd8c3fb99f958e89c74a31baecd53aa89d8517c2581c88c5228224f03d9374b3228dc9e54ba8c55e6434f417e3928c1bef965badf9544
|
data/CHANGELOG.md
CHANGED
|
@@ -5,39 +5,78 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [
|
|
8
|
+
## [1.0.0] - 2026-03-26
|
|
9
|
+
|
|
10
|
+
### Breaking Changes
|
|
11
|
+
|
|
12
|
+
Tracebook is now a layer on top of **RubyLLM** instead of a standalone interaction recorder. It reads from the host app's Chat and Message models (provided by RubyLLM's `acts_as_chat` / `acts_as_message`) and adds cost tracking and review workflow.
|
|
13
|
+
|
|
14
|
+
**Removed tables:**
|
|
15
|
+
- `tracebook_interactions` — RubyLLM's Message model stores conversation data
|
|
16
|
+
- `tracebook_rollups_dailies` — aggregates computed live from messages
|
|
17
|
+
|
|
18
|
+
**New tables:**
|
|
19
|
+
- `tracebook_message_costs` — cost and latency per message (polymorphic join to host Message)
|
|
20
|
+
- `tracebook_chat_reviews` — review state per chat (polymorphic join to host Chat)
|
|
21
|
+
|
|
22
|
+
**Updated tables:**
|
|
23
|
+
- `tracebook_comments` — FK changed from `interaction_id` to `chat_review_id`
|
|
24
|
+
|
|
25
|
+
**Removed code:**
|
|
26
|
+
- `Interaction`, `LlmSession`, `RollupDaily` models
|
|
27
|
+
- `PersistInteractionJob`, `DailyRollupsJob`, `ExportJob`
|
|
28
|
+
- `TraceBook.record!` API — replaced by `Tracebook.calculate_cost!(message, provider:, model:)`
|
|
29
|
+
- `NormalizedInteraction`, `Mappers`, `RedactionPipeline`, `Result`
|
|
30
|
+
- `Adapters::RubyLLM`, `Adapters::ActiveAgent` notification subscribers
|
|
31
|
+
- `ActorsController`, `InteractionsController`, `ExportsController`
|
|
32
|
+
- `/tracebook/actors/*` and `/tracebook/interactions/*` routes
|
|
33
|
+
|
|
34
|
+
**New code:**
|
|
35
|
+
- `MessageCost` model — stores cost per message
|
|
36
|
+
- `ChatReview` model — stores review state per chat
|
|
37
|
+
- `ChatsController` — dashboard at `/tracebook/chats`
|
|
38
|
+
- `Tracebook.calculate_cost!` — calculates and stores cost for a message
|
|
39
|
+
- `config.chat_class` / `config.message_class` — configure host app model names
|
|
40
|
+
|
|
41
|
+
**Migration guide:**
|
|
42
|
+
1. Run `bin/rails tracebook:install:migrations && bin/rails db:migrate`
|
|
43
|
+
2. Replace `Tracebook.record!` calls with `Tracebook.calculate_cost!`
|
|
44
|
+
3. Update `config/initializers/tracebook.rb` to set `chat_class` and `message_class`
|
|
45
|
+
4. Mount the engine: `mount Tracebook::Engine => "/tracebook"`
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- **Pricing Calculator**: `matching_rule` now correctly prefers the most specific glob pattern and most recent `effective_from` date.
|
|
50
|
+
|
|
51
|
+
## [0.1.1] - 2025-12-16
|
|
52
|
+
|
|
53
|
+
### Added
|
|
54
|
+
|
|
55
|
+
- **Install Generator**: `bin/rails generate tracebook:install` for simplified setup
|
|
56
|
+
- **Pagination**: UI pagination for interactions list using Pagy
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
|
|
60
|
+
- **Root Route**: Added missing root route redirect to `/interactions`
|
|
61
|
+
- **Payload Keys**: Fixed `build_normalized_interaction` using wrong keys for payloads
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- **Documentation**: Clarified that encryption is optional, added setup instructions for users who want to enable it
|
|
9
66
|
|
|
10
67
|
## [0.1.0] - 2025-11-12
|
|
11
68
|
|
|
12
69
|
### Added
|
|
13
70
|
|
|
14
71
|
- **Core Engine**: Rails 8.1+ mountable engine with isolated namespace
|
|
15
|
-
- **Provider Support**: Mappers for OpenAI, Anthropic, and Ollama APIs
|
|
16
|
-
- **Adapters**: Integration adapters for ActiveAgent and RubyLLM libraries
|
|
17
72
|
- **Recording API**: `TraceBook.record!` for capturing LLM interactions
|
|
18
|
-
- **
|
|
19
|
-
- **Models**:
|
|
20
|
-
- `Interaction` - Core model for storing LLM call data
|
|
21
|
-
- `PricingRule` - Cost calculation rules per model
|
|
22
|
-
- `RedactionRule` - Custom PII pattern definitions
|
|
23
|
-
- `RollupDaily` - Aggregated daily metrics
|
|
24
|
-
- **PII Redaction**: Pre-persist redaction pipeline with built-in redactors:
|
|
25
|
-
- Email addresses
|
|
26
|
-
- Phone numbers
|
|
27
|
-
- Credit card PANs
|
|
73
|
+
- **Models**: Interaction, PricingRule, RollupDaily
|
|
28
74
|
- **Cost Tracking**: Pricing calculator with configurable rules per provider/model
|
|
29
|
-
- **Background Jobs**:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- Review workflow (pending → approved/flagged/rejected)
|
|
37
|
-
- KPI display (token counts, costs, latency)
|
|
38
|
-
- **Export**: CSV and NDJSON export capabilities
|
|
39
|
-
- **Normalized Schema**: Consistent data structure across all providers
|
|
40
|
-
- **Test Suite**: Full MiniTest coverage for models, controllers, jobs, and lib
|
|
41
|
-
|
|
42
|
-
[Unreleased]: https://github.com/dpaluy/tracebook/compare/v0.1.0...HEAD
|
|
75
|
+
- **Background Jobs**: PersistInteractionJob, DailyRollupsJob, ExportJob
|
|
76
|
+
- **Web UI**: Dashboard with filtering, review workflow, KPI display
|
|
77
|
+
- **Adapters**: Integration adapters for RubyLLM and ActiveAgent
|
|
78
|
+
- **PII Redaction**: Pre-persist redaction pipeline
|
|
79
|
+
|
|
80
|
+
[1.0.0]: https://github.com/dpaluy/tracebook/compare/v0.1.1...v1.0.0
|
|
81
|
+
[0.1.1]: https://github.com/dpaluy/tracebook/compare/v0.1.0...v0.1.1
|
|
43
82
|
[0.1.0]: https://github.com/dpaluy/tracebook/releases/tag/v0.1.0
|