# Changelog
All notable changes to this crate are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this crate adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.1.2] — 2026-04-27
## [0.1.1] — 2026-04-27
### Added
- `release.toml` configuration for [`cargo-release`](https://github.com/crate-ci/cargo-release). Run `cargo release patch --execute` (or `minor` / `major` / explicit `X.Y.Z`) to bump the version, refresh `Cargo.lock`, rewrite the `CHANGELOG.md` heading, run tests + `cargo publish --dry-run`, commit, tag `vX.Y.Z`, and push. The actual `cargo publish` to crates.io still runs from GitLab CI on tag push using the masked `CARGO_REGISTRY_TOKEN` variable — no local registry token required.
## [0.1.0] — 2026-04-24
### Rust version policy
This crate **tracks current stable Rust** and does not maintain a fixed MSRV. The dependency tree (notably `idna` → `icu_*` and the `tokio` / `reqwest` ecosystem) bumps minimum Rust versions in patch releases; pinning a fixed MSRV would either ship a claim we can't keep, or force us to lag dep upgrades and miss bug/security fixes. CI runs against `rust:slim` (the latest stable Rust image) on every push. If you need to consume this SDK from a non-current toolchain, open an issue with your specific constraint and we'll evaluate.
### Added
#### Phase 1 — core resources (fully typed DTOs)
- `ReasoningLayerClient` with [`ClientConfig`](src/config.rs) builder (`base_url` + `tenant_id` required; `user_id`, `namespace_id`, `authenticated_user`, `bearer_token`, `timeout`, `max_retries`, `retry_on_503` optional).
- 4 resource clients covering ~60 methods: `sorts` (28), `terms` (9), `inference` (20), `query` (8), plus friendly aliases `types`, `records`, `rules`.
- HTTP client over `reqwest` with auth header injection (`X-Tenant-Id`, `X-SDK-Version`, `X-SDK-Language: rust`, `X-User-Id`, `X-Namespace-Id`, `X-Authenticated-User`, `Authorization: Bearer`), exponential backoff with jitter on 429 / 503 / network errors (honours `Retry-After`), per-call `RequestOptions` overrides.
- Error hierarchy: `Error::{Api(Box<ApiError>), Timeout, Validation, Network, Serde, Url}` with `ApiErrorKind` (BadRequest, Authentication, Forbidden, NotFound, ConstraintViolation, RateLimit, InternalServer, Other) and structured accessors (`constraint_violation()`, `rate_limit()`).
- Two serialization formats wired correctly: tagged `ValueDto` for term CRUD/query, untagged `TermInputDto`/`FeatureInputValueDto` for inference (with newtype-wrapped struct variants using `deny_unknown_fields` for correct routing between `Variable` and `ConstrainedVariable`).
- Builders: `Value::{string/integer/real/boolean/uninstantiated/list/reference/fuzzy_scalar/fuzzy_number/set}`, `FuzzyShape::{triangular/trapezoidal/gaussian/cyclic_gaussian/sigmoid/bell/sigmoid_difference/gaussian_product/sigmoid_product/cosine/spike/cauchy/s_shape/z_shape/pi_shape/piecewise_linear}`, `psi()`, `psi_by_id()`, `var()`, `constrained()`, `term_ref()`, `guard()`. Plus `From<T>` impls for `ValueDto` and `FeatureInputValueDto` from `&str`, `String`, `i64`, `i32`, `f64`, `bool`, `Vec<T>`.
#### Phase 2 — remaining resources (wire-compatible, Value-typed where not Phase 3-upgraded)
- 45 additional resource clients accessible via `client.{resource}()`: `health`, `admin`, `osfql`, `context`, `rl_training`, `rag`, `generation`, `image_extraction`, `extract`, `preferences`, `discovery`, `functions`, `ontology`, `analysis`, `scenarios`, `spaces`, `row`, `sources`, `ui`, `optimize` (Phase 2a — typed DTOs) plus `fuzzy`, `causal`, `statistical`, `communities`, `visualization`, `constraints`, `namespaces`, `collections`, `reasoning`, `reviews`, `action_reviews`, `webhook_actions`, `control`, `ilp`, `cdl`, `synthetic`, `utilities`, `ingestion`, `execution`, `proof_engine`, `conversation`, `research`, `cognitive`/`agents`, `oversight`, `neuro_symbolic` (Phase 2b/c).
- Path resolver handles absolute prefixes (`/health`, `/ready`, `/live`, `/metrics`, `/ws/`, `/api-docs`, `/swagger-ui`) without `/api/v1` prefix.
- `PATCH` verb and `post_with_query` support for endpoints that need both body + query.
- WebSocket infrastructure (`reasoninglayer::ws`): `WebSocketConnection::connect(url)` with auto-reconnect (exponential backoff, 10 attempts, 30s cap), `next_message()`/`send()`/`close()`/`on_reconnect()`. URL builders via `client.cognitive().agent_events_url(agent_id)`, `cognitive_cycle_url(agent_id)`, `client.oversight().session_stream_url(session_id)`.
- SSE infrastructure (`reasoninglayer::sse`): `stream(&client, method, path, body, options)` returns `Stream<Item = Result<SseEvent, Error>>` with full auth headers.
#### Phase 3 — typed DTO upgrades
- `fuzzy`, `causal`, `statistical`, `communities`, `visualization`, `constraints`, `namespaces`, `collections`, `reasoning` resources now use strongly-typed request/response DTOs instead of `serde_json::Value`.
- Additional DTO modules shipped for `reviews`, `action_reviews`, `webhook_actions`, `control`, `ilp`, `cdl` — the corresponding resource clients continue to accept `serde_json::Value` for now; typed method signatures will land in 0.2.0 without breaking the wire contract.
#### Testing
- 41 tests passing: 18 unit tests (builders, errors, serialization round-trips for all tagged/untagged variants), 17 integration tests (wiremock — tenant headers, auth, retries, timeouts, path resolution, typed request/response round-trips), 6 doc tests.
- `cargo clippy --all-features --tests --examples -- -D warnings` clean.
- GitLab CI (`.gitlab-ci.yml`): on every push, runs `cargo build`, `cargo test` (default features and `native-tls`), `cargo clippy --all-features --tests --examples -- -D warnings`, `cargo fmt --all -- --check`, `cargo doc --all-features --no-deps` with `RUSTDOCFLAGS=-D warnings`, and `cargo publish --dry-run`. On `vX.Y.Z` tag push, verifies the tag matches `Cargo.toml`, re-runs tests, and publishes to crates.io using a masked `CARGO_REGISTRY_TOKEN` GitLab CI variable. All jobs run on `rust:slim` (latest stable).