# Changelog

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

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

## [0.1.0] — 2026-06-04

Initial public release.

### Core trust evaluation pipeline

- Fail-closed evaluation pipeline: normalize → profile compatibility → signature verification → identity document lifetime → revocation / nonce consumption → token lifetime → token binding → policy checks → audit.
- Ed25519 signature verification for both `AgentIdentityDocument` and `DelegationToken` using canonical JSON payloads.
- `TrustProfile` gating (Developer, Production, Strict) with configurable leeway for clock skew.
- Spec versioning: `SUPPORTED_SPEC_VERSIONS` membership check for forward-compatible version negotiation.

### Protocol adapters

- **HTTP adapter** (`handle_http_json_request*`) — returns `{allowed, stage, reason}` JSON with 200/403/400/429/500 status codes.
- **MCP adapter** (`handle_mcp_jsonrpc_request*`) — validates `params._trust` in JSON-RPC 2.0 requests; returns JSON-RPC errors on deny.
- **A2A adapter** (`handle_a2a_request*`) — validates `trust_claims` in `A2aProtocolRequest` messages.
- **Axum middleware layer** (`DelegatedLayer`, `DelegatedLayerBuilder`) — Tower `Layer`/`Service` that reads the request body, runs the async trust pipeline, and either passes the request through or returns 403. Feature flag: `axum`.

### Issuance builders

- `DelegationTokenBuilder` — fluent builder with auto-generated `token_id` and `nonce`, relative expiry via `expires_in`, and `build_and_sign`.
- `AgentIdentityDocumentBuilder` — fluent builder with 7-day default expiry; `additional_public_key(kid, &VerifyingKey)` for key rotation (registers extra public keys alongside the primary signing key).
- `RequestEnvelopeBuilder` — assembles a `RequestEnvelope` from a signed identity document and token.

### Trust state

- `TrustStateStore` / `TrustStateAdmin` traits now take `&self` (interior mutability) — implementations can be shared as `Arc<dyn TrustStateStore>`.
- `InMemoryTrustState` — uses `Mutex<InMemoryTrustInner>` + `AtomicBool`; thread-safe and `Clone`-free sharing.
- `FileBackedTrustState` — advisory file-lock backed state for CLI and single-process deployments.
- Bulk admin operations: `revoke_tokens` (default: loop), `clear_emergency_deny_list`, `flush_expired_nonces` (default: no-op).
- `AsyncTrustStateStore` / `AsyncTrustStateAdmin` for async runtimes; `InMemoryAsyncTrustState` wraps `InMemoryTrustState` directly.
- Redis store (`RedisTrustStateStore`) with `SET NX EXAT` for atomic nonce consumption, pipeline-based `revoke_tokens`, and SCAN+DEL `clear_emergency_deny_list`. Feature flag: `redis`.

### Policy engine

- Built-in policy checks: `allowed_actions`, `delegation_depth`, `max_spend`, `calendar_constraint`, `email_domain_allowlist`, `cognitive_gate`, `reputation_risk_multiplier`.
- Custom policy via `Policy` trait; `DefaultPolicy` composes all built-in checks.
- `simulate_request_policy*` — dry-run evaluation that returns individual `PolicyCheck` results without consuming nonces or writing audit events.

### Audit

- `AuditSink` trait (`Send + Sync`) with `JsonlFileAuditSink` implementation.
- `AuditReader` + `AuditQuery` for reading and filtering audit events.

### Control plane

- `revoke_token_with_receipt` — revokes a token and issues a `ConsentReceipt`.
- `emergency_deny_agent` — blocks an agent ID globally.
- `build_operational_report` — summarizes audit events by stage and allow/deny counts.
- `record_approval_decision` — records a grant approval or denial with a callback payload.

### Discovery

- `DiscoveryService` with `handle_discovery_http_request` for `/.well-known/delegated-issuer` and JWKS endpoints.

### Client SDK

- `DelegatedClient` with `evaluate_http`, `evaluate_mcp`, and `evaluate_a2a` methods for sending trust-validated requests to services running the server-side adapters. Feature flag: `client`.

### Observability

- `tracing` instrumentation on the evaluation hot path. Feature flag: `tracing`.
- `metrics` counters (`delegated_requests_total`) and histograms (`delegated_evaluation_duration_seconds`). Feature flag: `metrics`.

### OIDC bridge

- `IdentityVerifier` trait for plugging in OIDC-based identity verification as a replacement for offline Ed25519 signature checks. Feature flag: `oidc-bridge`.
