Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ docs/plans/
screenshots/
.idea/
docs/superpowers/
.superpowers/
PROJECT_DESCRIPTION.md
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions crates/tracevault-server/migrations/002_model_pricing.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE TABLE model_pricing (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
model TEXT NOT NULL,
input_per_mtok DOUBLE PRECISION NOT NULL,
output_per_mtok DOUBLE PRECISION NOT NULL,
cache_read_per_mtok DOUBLE PRECISION NOT NULL,
cache_write_per_mtok DOUBLE PRECISION NOT NULL,
effective_from TIMESTAMPTZ NOT NULL,
effective_until TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE INDEX idx_model_pricing_lookup
ON model_pricing(model, effective_from);

-- Seed with current Anthropic rates
INSERT INTO model_pricing (model, input_per_mtok, output_per_mtok, cache_read_per_mtok, cache_write_per_mtok, effective_from)
VALUES
('opus', 15.00, 75.00, 1.50, 18.75, '2025-01-01T00:00:00Z'),
('sonnet', 3.00, 15.00, 0.30, 3.75, '2025-01-01T00:00:00Z'),
('haiku', 0.80, 4.00, 0.08, 1.00, '2025-01-01T00:00:00Z');
14 changes: 1 addition & 13 deletions crates/tracevault-server/src/api/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,7 @@ pub async fn login(
.await
.map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?;

// Audit with nil org_id since login is org-agnostic now
crate::audit::log(
&state.pool,
crate::audit::user_action(
Uuid::nil(),
user_id,
"user.login",
"user",
Some(user_id),
None,
),
)
.await;
// Login is org-agnostic — skip audit log (audit_log requires a valid org_id)

Ok(Json(LoginResponse {
token: raw_token,
Expand Down
1 change: 1 addition & 0 deletions crates/tracevault-server/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ pub mod github;
pub mod orgs;
pub mod policies;
pub mod repos;
pub mod session_detail;
pub mod traces;
Loading
Loading