# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.2] - 2026-04-19

### Added
- Root endpoint (`GET /`) returning API info with docs link
- Live cloud API URL in OpenAPI spec servers
- Landing page now points to live Railway deployment
- README updated with live API examples

### Changed
- Cloud API live at `https://trustmesh-production-27d1.up.railway.app`
- Stripe price IDs wired into billing tiers (test mode)

## [0.3.0] - 2026-04-19

### Added
- **Stripe billing integration** — full subscription management with checkout sessions, customer portal, and webhook handling
- **Usage metering** — per-account rate limiting with daily call and agent count tracking per tier
- **Cloud billing API endpoints**: `/billing/signup`, `/billing/account`, `/billing/usage`, `/billing/tiers`, `/billing/upgrade`, `/billing/portal`, `/billing/webhook`
- **Billing service** (`src/billing.ts`) — account creation, tier management, Stripe customer/subscription lifecycle
- **Freemium pricing tiers**: Free (1K/day), Pro ($29/mo, 50K/day), Scale ($199/mo, 500K/day), Enterprise (custom)
- **Updated landing page** with interactive signup modal and tier-based upgrade buttons
- **Stripe setup script** (`scripts/stripe-setup.js`) — creates products, prices, and portal config
- `STRIPE_SECRET_KEY` and `STRIPE_WEBHOOK_SECRET` environment variables for cloud mode
- Cloud mode auto-detects Stripe key and switches from simple API key auth to per-account billing
- Health endpoint now includes `cloud: boolean` field

### Changed
- Server auth now has two modes: simple (single API key) and cloud (per-account billing with Stripe)
- Version bumped to 0.3.0
- Landing page version badge updated

## [0.2.0] - 2026-04-19

### Added
- Full CLI: `rate`, `score`, `graph`, `dispute`, `peers` commands (not just `serve`)
- API key authentication (`TRUSTMESH_API_KEY` env, `Authorization: Bearer <key>` or `X-API-Key` header)
- CORS support via `@fastify/cors`
- Batch trust score endpoint (`POST /score`)
- Single rating endpoint (`GET /rate/:ratingId`)
- Delete rating endpoint (`DELETE /rate/:ratingId`)
- Resolve dispute endpoint (`POST /dispute/:disputeId/resolve`)
- OpenAPI spec endpoint (`GET /openapi.json`)
- Health endpoint now includes version and uptime
- `resolveDispute()` SDK method
- `getTrustScores()` batch SDK method
- `getConfig()` SDK method
- Configurable `halfLifeDays` and `minConfidenceSamples` in scoring config
- Standard claim types list (`CLAIM_TYPES` export)
- Dockerfile and docker-compose.yml
- 23 comprehensive tests (up from 7)
- CONTRIBUTING.md

### Changed
- Server logs reduced to `warn` level by default
- Improved composite score calculation when signals are missing (properly redistributes weights)
- Better CLI help text with all commands and options
- Package name corrected to `trustmesh-ai` throughout docs

### Fixed
- Confidence calculation now properly uses `minConfidenceSamples` config
- Edge case handling for expired ratings, zero/perfect scores, self-ratings

## [0.1.0] - 2026-04-19

### Added
- Core trust scoring engine (direct + transitive + base reputation)
- SQLite and in-memory storage backends
- REST API server (Fastify)
- CLI with `serve` command
- Basic dispute creation
- 7 initial tests
- MIT License
- GitHub repo and npm package