Skip to content

Commit 27c9824

Browse files
committed
Freeze pricing lineage at archived shared-core v1.3.0; refresh metadata wording; bump dashboard Next to 16.3.1 and vitest to 4 (audit clean)
1 parent 039a9a5 commit 27c9824

15 files changed

Lines changed: 2110 additions & 2282 deletions

AGENTS.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ llm-gateway/
4242
make install # npm ci
4343
make dev # tsx watch src/index.ts
4444
make build # tsc -> dist/
45-
make test # vitest run -> 150 passing (backend); dashboard has 27 more
45+
make test # vitest run -> 149 passing (backend); dashboard has 27 more
4646
make lint # tsc --noEmit + eslint
4747
make typecheck # tsc --noEmit
4848
make docker-up # redis + gateway
@@ -51,17 +51,17 @@ make demo # build + print a sample OpenAI-compatible request
5151

5252
## Current State
5353

54-
**Functional, migrated, green, hardened.** `tsc --noEmit` clean; **150 backend vitest tests
55-
pass** (19 files), plus **27 dashboard tests** (3 files); `eslint .` clean; `next build` green.
54+
**Functional, migrated, green, hardened.** `tsc --noEmit` clean; **149 backend vitest tests
55+
pass** (20 files), plus **27 dashboard tests** (3 files); `eslint .` clean; `next build` green.
5656
Storage degrades gracefully: when the native `better-sqlite3` binding is unavailable (e.g. no
5757
C++ build tools), the API-key/audit stores fall back to in-memory — the full test suite runs
5858
without compilation.
5959

6060
The root vitest suite is scoped to `tests/` via `vitest.config.ts`; the dashboard has its own
61-
jsdom vitest project under `dashboard/`. `src/shared/pricing.ts` now mirrors
62-
`shared_core.pricing` per-1M rates (`MODEL_PRICING_PER_1M`, single source of truth, sync
63-
documented in its header) and derives the per-token catalog from it; parity is enforced by
64-
`tests/pricing.test.ts`. The optional Next.js dashboard gained a demo-mode fallback, an
61+
jsdom vitest project under `dashboard/`. `src/shared/pricing.ts` carries the per-1M
62+
rates (`MODEL_PRICING_PER_1M`) mirrored from `shared_core.pricing` — the lineage is
63+
**frozen at the archived shared-core v1.3.0** (2026-08-13), the table is self-owned, and
64+
the frozen parity snapshot is pinned by `tests/pricing.test.ts`. The optional Next.js dashboard gained a demo-mode fallback, an
6565
`ErrorBoundary`, extracted testable helpers, component tests, and an optional Playwright smoke
6666
spec.
6767

@@ -70,9 +70,9 @@ spec.
7070
- ✅ Audit-log column schema and Prometheus label keys (`llm_gateway_*`) documented as a
7171
superset of the Python `llm-cost-latency-monitor` `LLMCall` cost-record and pinned by
7272
`tests/monitorAlignment.test.ts` so one dashboard reads both.
73-
- ✅ Pricing table mirrors `shared_core.pricing` (data parity, `MODEL_PRICING_PER_1M`); sync
74-
procedure documented and parity-tested.
75-
- ⏭️ `claude-3-5-haiku` rate diverges from shared_core (1.0/5.0 vs 0.8/4.0); deferred because
73+
- ✅ Pricing table mirrors `shared_core.pricing` (data parity, `MODEL_PRICING_PER_1M`)
74+
lineage frozen at the archived v1.3.0; the table is self-owned and parity-tested.
75+
- ⏭️ `claude-3-5-haiku` rate diverges from the frozen shared-core snapshot (1.0/5.0 vs 0.8/4.0); deferred because
7676
changing it would move existing cost outputs (golden-gated). Pinned + tracked in roadmap.md.
7777
- ✅ Canonical-gateway question settled 2026-08-12: `knowledgeops` (incl. `services/llm-gateway`) was consolidated into groundtruth and archived on GitHub — this standalone gateway is the canonical one.
7878

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Tests](https://img.shields.io/badge/tests-passing-brightgreen)]() [![Coverage](https://img.shields.io/badge/coverage-88%25-brightgreen)]() [![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript)]() [![Express](https://img.shields.io/badge/Express-000?logo=express)]() [![Redis](https://img.shields.io/badge/Redis-DC382D?logo=redis)]()
44

5-
**Enterprise LLM proxy with fallback, caching, rate limiting, and budget enforcement.**
5+
**LLM proxy with routing, guardrails, cost control, and fallback.**
66

77
Route requests across multiple providers (OpenAI, Anthropic, Gemini, Ollama) with automatic failover, response caching, and per-API-key cost control.
88

@@ -154,7 +154,7 @@ curl -X POST http://localhost:3000/v1/chat/completions \
154154

155155
## 9. Testing Strategy
156156

157-
The backend suite has **150 vitest tests** across 19 files; the optional dashboard has **27**
157+
The backend suite has **149 vitest tests** across 20 files; the optional dashboard has **27**
158158
component/unit tests across 3 files. Run `npx vitest run` at the repo root and
159159
`cd dashboard && npx vitest run` for the UI.
160160

@@ -167,7 +167,7 @@ tests/
167167
├── proxy.test.ts # Full request pipeline, error handling, streaming
168168
├── rateLimit.test.ts # Sliding-window limiting, per-key config, 429 path
169169
├── logging.test.ts # Structured audit logging + API-key redaction
170-
├── pricing.test.ts # Pricing parity with shared_core.pricing (golden-gated)
170+
├── pricing.test.ts # Frozen pricing parity snapshot (archived shared_core v1.3.0, golden-gated)
171171
├── costService.test.ts # Cost calc + model-pricing normalization
172172
└── monitorAlignment.test.ts # Audit + Prometheus key parity with the Python monitor
173173
```
@@ -176,8 +176,9 @@ tests/
176176
- **Integration tests**: full pipeline with the mock provider (no real API calls).
177177
- **Error path tests**: provider failures, budget exceeded, policy denied, rate limited.
178178
- **Golden-output tests**: pricing/cost values are pinned so refactors can't silently move them.
179-
- **Cross-language tests**: pin the pricing rates, audit cost-record columns, and Prometheus
180-
key names shared with `shared_core.pricing` and the Python `llm-cost-latency-monitor`.
179+
- **Cross-language tests**: pin the frozen pricing lineage (archived `shared_core.pricing`
180+
v1.3.0) plus the audit cost-record columns and Prometheus key names shared with the
181+
Python `llm-cost-latency-monitor` (now consolidated into agenttrace).
181182
- **Dashboard tests** (`dashboard/`): pure data helpers, the `ErrorBoundary`, and the
182183
console in demo / live / empty states.
183184

dashboard/next-env.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
import "./.next/types/routes.d.ts";
4+
import "./.next/types/root-params.d.ts";
35

46
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
7+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

0 commit comments

Comments
 (0)