# Changelog

All notable changes to FideRail are documented in this file.

The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and releases adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- **Authoritative Release**: `v2.3.5` ([`spec/fiderail.manifest.json`](spec/fiderail.manifest.json))
- **Primary Source (GitLab, MIT)**: `https://gitlab.com/fiderail/fiderail`
- **Mirror Repository (GitHub, MIT)**: `https://github.com/fiderail/fiderail`

---

## [Unreleased]

---

## [2.3.5] - 2026-12-04

### Changed

- **Permanent Free Tier + Automatic HTTP 402 Overage Pricing Contract**: Removed the global 1,000,000-install metering countdown from `spec/fiderail.manifest.json`, `/pricing`, `/llms.txt`, and `README.md`. The public hosted node now provides a **Permanent Free Tier** within per-IP rate limits, automatic **HTTP 402** overage metering (`$0.002 USDC/call` on `GET /v1/trust/{chain}/{address}` when payout wallets are configured), and enterprise SLA options via `founder@fiderail.com`. Retained `apps/api/src/adoption.ts` strictly as a live verifiable registry download counter.
- **Local-First Guardrail Foregrounding**: Positioned `@fiderail/guard` / Python `fiderail` local-first payment guardrails and offline Ed25519 attenuated delegation as the primary developer entry point across the portal, `README.md`, and `/llms.txt`, backed by the 4-chain anti-sybil trust radar.
- **Reinstated GitHub Mirror**: Restored live GitHub mirror (`https://github.com/fiderail/fiderail`) across the SSOT manifest, portal navigation, `/llms.txt`, documentation pages, and package READMEs.

### Security & Fixed

- **Hard-Capped Deterministic Sybil Tiers Below Default Firewall Gate (`< 40`)**: Capped `RECIPROCAL_LOOP <= 10` (`FLAGGED_LOOP`), `ISOLATED_PAYER_FARM <= 25` (`FLAGGED_FARM`), and `SINGLE_PAYER_CONCENTRATED <= 29` (`FLAGGED_CONCENTRATED`) in `packages/core/src/scoring.ts` and `spec/fiderail.manifest.json` so direct `/v1/trust` consumers checking `creditScore >= 40` never inadvertently admit flagged sybil wallets.
- **Anti-Smear L2 Telemetry Quarantine (`POST /v1/telemetry/delivery`)**: Required valid cryptographic `fiderail-sar-v2` receipts with matching `chain`, `payTo`, `url`, and `delivered` metadata, and quarantined unverified anonymous `delivered: false` claims (`L2_UNVERIFIED_NEGATIVE_CLAIM`) in `delivery_attestations` so competitors cannot artificially depress public `deliverySuccessRate` metrics.
- **Strict 4-Tier Audit Report Monotonicity**: Fixed `scripts/generate-audit-report.mjs` so Tier 4 (`Organic HIGH_TRUST`) is strictly a subset of Tier 3 (`Verified x402`), reporting generic EIP-3009 organic `HIGH_TRUST` payees in a separate row outside Tier 3.
- **Outbound Secret Scrubber Threat Model Disclosure**: Added explicit documentation in `SECURITY.md`, `/llms.txt`, `docs/02-architecture.md`, and SDK READMEs clarifying that `scanOutboundSecrets()` is an accidental-leakage guardrail for plaintext credentials, not an adversarial exfiltration sandbox.

---

## [2.3.4] - 2026-12-04

### Fixed

- **Workspace Internal Dependency Pin Sync**: Synchronized all internal `@fiderail/*` dependency pins across `@fiderail/core`, `@fiderail/db`, `@fiderail/guard`, `@fiderail/seller`, `@fiderail/indexer`, `@fiderail/mcp`, and `@fiderail/api` to `2.3.4` so single-package installs (`npm install @fiderail/guard`) always resolve matching `2.3.4` sub-packages.
- **SSOT Anti-Drift Dependency Guard**: Extended `test/ssot-drift.test.mjs` to assert that every internal `@fiderail/*` dependency pin across all workspace manifests matches `currentRelease` strictly.

---

## [2.3.3] - 2026-12-04

### Added

- **Deterministic 1M Free-Cloud Pledge & Live Top-Level Install Tracker**:
  - Updated `/pricing`, portal copy, `/llms.txt`, and `spec/fiderail.manifest.json` with a clear three-tier contract: MIT Local Edge Guard SDKs stay **`$0 Forever`**, while the public hosted node (`api.fiderail.com`) commits to **`x402Enforce: false` (`$0` metering)** until cumulative top-level SDK downloads (`@fiderail/guard` + `@fiderail/mcp` + `@fiderail/seller` + PyPI `fiderail`, excluding transitive dependencies and PyPI mirrors) reach **1,000,000** (subject to fair-use per-IP rate limits, best-effort availability, and at least 30 days advance public notice before any future metering change).
  - Added same-origin adoption polling (`GET /healthz` `.adoption`) persisted monotonically in PostgreSQL 16 / SQLite `sync_state` (`adoption_stats_v1`) with inline portal pills (`#npm-install-stat`, `#pypi-install-stat`) and a live milestone tracker on `/pricing`.
- **Single-Package TypeScript Install & Python SDK User-Agent**:
  - Re-exported `createRemoteTrustClient`, `createTrustEngine`, `DEFAULT_FIREWALL_POLICY`, `DEFAULT_TRUST_SCORER`, `validateMandateChain`, `serializeBody`, and core TypeScript types from `@fiderail/guard` so buyers can onboard with a single `npm install @fiderail/guard` command (fully backward compatible with `@fiderail/core`).
  - Added explicit `User-Agent: FideRail-Python-SDK/<SDK_VERSION>` headers to all outbound requests in `sdks/python/fiderail/client.py` to avoid CDN default-UA false positives.
- **Hardened 1M+ Audit Report Stratification**:
  - Extended `scripts/generate-audit-report.mjs` and `/reports/1m-audit` to report Payees, Indexed Txs (% of audited), and Volume USDC (% of audited) across Tiers 2–4 and Flagged Risk groups, plus a dedicated Solana Facilitator Attribution Verification section documenting SPL balance-delta ownership extraction and zero-delta router collapsing.

### Fixed

- **`BEHAVIOR_DRIFT` Tier Consistency (`trust-v2`)**: Added a `creditScore <= 69` cap and excluded `BEHAVIOR_DRIFT` from `HIGH_TRUST` in `packages/core/src/scoring.ts` so `BEHAVIOR_DRIFT` profiles consistently resolve to `MODERATE_TRUST` (`riskLevel: "HIGH"`, pre-flight `WARN`) rather than holding `HIGH_TRUST`.
- **Canonical Source Links**: Standardized repository links on GitLab (`https://gitlab.com/fiderail/fiderail`) across the portal, docs, `/llms.txt`, and package manifests.

---

## [2.3.2] - 2026-12-04

### Added

- **SDK Quote-Binding & Mandate Safety**:
  - Added optional `body` input support to `computeQuoteDigest` (`@fiderail/core`, `@fiderail/guard`) and `compute_quote_digest` (`sdks/python`), computing `sha256Hex(serializeBody(body))` automatically when `bodyHash` is omitted.
  - Updated `verifyEd25519MandateSignature` (`@fiderail/guard`) to support omitting `signingPayload` (auto-derived via `createMandateSigningPayload`) while strictly rejecting tampered explicit `signingPayload` arguments.
  - Added `QUOTE_TAMPERING_DETECTED` bound-quote and `quoteDigest` verification to Python `FideRailClient.guarded_x402_request` when `signer` returns a dictionary (`paymentHeader` / `boundQuote` / `quoteDigest`), matching TypeScript `guardedX402Fetch`.
- **Site Discovery & Documentation Clarity**:
  - Added `GET /sitemap.xml` and `Sitemap:` directive in `/robots.txt`.
  - Documented key integration semantics (`allowUnknownMaxUsdc: 0` for strict micro-payment blocking, `onOutage` scope vs `getAgentTrust`, and `RemoteTrustClient.getPayerActivity` remote `null` default vs `POST /v1/trust-provider/before-settle`) in `@fiderail/core`, `@fiderail/guard`, `sdks/python`, and `/llms.txt`.
  - Highlighted `@fiderail/spec` and `@fiderail/zk-types` in portal/docs SDK listings across the portal, docs, and package metadata.
- **MCP Tools & Limits Documentation**: Added [05 · MCP Tools, Usage & Rate Limits Reference](docs/05-mcp-tools-and-limits.md), self-hosted at `/docs/mcp` and `/docs/mcp.md`, with summary parameter/limit tables in [README.md](README.md) and [apps/mcp/README.md](apps/mcp/README.md).
- **Self-Hosted Portal Documentation, Status & Policy Pages**: Added self-hosted `/docs`, `/docs/scope`, `/docs/architecture`, `/docs/trust-model`, `/docs/operations`, `/status`, `/security`, `/about`, `/pricing`, `/terms`, `/privacy`, `/changelog`, `/CHANGELOG.md`, and `/reports/1m-audit`.
- **Solana Coinbase CDP x402 Target**: Added the Coinbase CDP x402 facilitator target (`solana_x402_cdp`) with independent cursor tracking.
- **Verifiability & Seller Screening Enhancements**: Added Merkle inclusion proofs in `GET /v1/history/{chain}/{address}`, unified `computeActiveModelHash()` / `X-FideRail-Model-Hash`, and pure-payer outgoing activity screening in `POST /v1/trust-provider/before-settle` (`x402#2299`).
- **Repository SSOT & Package Metadata**: Standardized canonical GitLab repository metadata across the manifest, portal UI, and SDKs, and added publishable package READMEs, LICENSE copies, explicit `files` lists, and PEP 561/639 assets.

### Security

- **Remote `POST /mcp` Plan A Hardening**: Restricted the public hosted Streamable HTTP `/mcp` endpoint to the 5 stateless tools and disabled `guarded_x402_fetch` remotely (returns `isError: true`, local `stdio` `@fiderail/mcp` or `@fiderail/guard` only).
- **Proxy-Enforced Diagnostics & Abuse Caps**: Wired fail-closed outbound probe proxy routing (`FIDERAIL_PROBE_PROXY_URL` / `FIDERAIL_PROBE_PROXY_TOKEN`), URL length/character validation (`<= 2048` chars, `GET` or `POST` only), shared `6 req/min/IP` rate limits and global concurrency cap `4` with `POST /v1/diagnose`, JSON-RPC batch caps (max `5` items per batch, max `1` `diagnose_x402_endpoint` call per batch returning `-32600`), and `Mcp-Session-Id` header sanitization.
- **HSTS Header Enforcement**: Added `Strict-Transport-Security: max-age=31536000; includeSubDomains` across HTML and JSON API responses.
- **API Boundary Hardening**: Enforced strict `HTTP 400` enum/numeric validation, CRLF/BiDi/null-byte and prototype-pollution stripping, SQL `LIKE` wildcard escaping, and fail-fast startup rejection of burn/zero `x402Enforce` payout addresses.

### Fixed

- **`@fiderail/mcp` CLI `bin` Packaging**: Fixed `apps/mcp/package.json` `bin.fiderail-mcp` (`dist/server.js`) and `prepublishOnly` executable mode (`0755`) so `npx @fiderail/mcp` preserves its binary entrypoint on npm publish.
- **Solana SPL Indexer Accuracy & Catchup**: Upgraded Solana parsing to instruction-first multi-transfer SPL extraction (`x402:batch`, delegated Token-2022, v0 loadedAddresses), guarded self-transfer fallback against non-stablecoin SPL tokens, and implemented gapless burst cursor pagination with bounded catchup.
- **Base58 Case-Sensitive Cache Keys**: Preserved Solana Base58 address casing across `RemoteTrustClient`, `SqliteSpendLedger`, and the Python SDK so distinct Solana keys never collide.
- **Portal Delivery & UI Responsiveness**: Switched to content-hashed `/assets/app.<hash>.{css,js}` static bundles with `no-store` HTML headers, fluid full-viewport container layouts, and cross-browser accessibility fixes.

---

## [2.3.1] - 2026-12-03

### Added

- **4-Chain x 2-Stablecoin Control Plane**: Locked scope across Base (`USDC`, `EURC`), Solana (`USDC`, `USDT`), Arbitrum (`USDC`, `USD₮0`), and Polygon (`USDC`, `USDT`) with constitutional red lines (`ZERO_CUSTODY`, `ZERO_TOKEN`, `ZERO_HUMAN_ARBITRATION`, `CRYPTOGRAPHIC_VERIFIABILITY`, `CODE_IS_LAW`).
- **Anti-Sybil `trust-v2` Scoring Engine**: Implemented 14-day half-life decay, cross-ecosystem weighted payer diversity, dual tx/volume HHI dispersion, maturity caps, `RECIPROCAL_LOOP`, `SINGLE_PAYER_CONCENTRATED`, `ISOLATED_PAYER_FARM`, `BEHAVIOR_DRIFT`, `MICRO_PING_ONLY`, and `NON_X402_WHALE_FLOW` penalties, plus isolated `associatedCredit`.
- **Cryptographic Primitives (`@fiderail/zk-types` & Ed25519)**: Implemented RFC 8785 JSON Canonicalization Scheme (JCS), salted `fiderail-sar-v2` delivery attestation receipts, Ed25519 Attenuated Capability Mandates, and Ed25519-signed Merkle `stateRoot` commitments (`/.well-known/fiderail-keys.json`).
- **Hybrid Option-C Edge Firewall (`@fiderail/guard`)**: Added SQLite WAL atomic spend ledger reservations, outbound secret/PII scrubbing, immutable `FIDERAIL_HOST_*` policy clamping, 3-tier HITL approval gates, Quote-to-Pay digest binding, 60s duplicate-payment idempotency, and HTTP 5xx circuit breakers.
- **Dual-Mode MCP, Open Bazaar Grader & Python SDK**: Shipped `@fiderail/mcp` (`stdio` + `POST /mcp`), `POST /v1/diagnose` A-F x402 endpoint grader (`x402#3803` 8 KB / 16 KB header checks), `POST /v1/trust-provider/before-settle` (`x402#2299`), PostgreSQL 16 + SQLite WAL repositories, and the zero-dependency Python SDK (`sdks/python`).
