# 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.1.10] - 2026-05-08

### Changed

- **Bumped `duroxide` dependency** — `0.1.28` → `0.1.29`. Pulls in replay-safe orchestration
  combinators (`PollAllJoin`, `PollAllJoin2`, `PollAllJoin3`, `Select2`, `Select3`) that fix a
  latent large-fan-in (≥ 1024 children) replay hang caused by `futures::join_all` switching to a
  waker-driven path the deterministic replay engine does not drive. Also removes the `futures`
  crate from the default dependency tree (now optional, enabled only by `provider-test`). No
  source code or behavior changes in this provider — `duroxide-cdb` does not use the affected
  combinators directly.

## [0.1.9] - 2026-04-23

### Changed

- **Bumped `duroxide` dependency** — `0.1.27` → `0.1.28`. This pulls in the
  upstream switch from `runtime-tokio-rustls` to `runtime-tokio-native-tls`
  for the optional `sqlite` feature, which drops the transitive `ring` crate
  (not FIPS compliant for our policy requirements). No source code or behavior
  changes in this provider — `duroxide-cdb` uses `reqwest` (native-tls by
  default) and was already `ring`-free.
- **Build hygiene** — Dropped the `path = "../../duroxide"` workspace-relative
  override on the `duroxide` dependency. The crate now resolves `duroxide`
  purely from crates.io.

## [0.1.8] - 2026-04-04

### Added
- Added `Provider::get_instance_stats()` with Rust-side on-demand history, queue, and KV usage
  reporting (no stored procedures — stats computed in Rust from CosmosDB document queries).
- Wired the 3 new management validation tests covering missing-instance, history, and KV stats.
- Ported the core `sample_kv_read_modify_write_counter` and `sample_orchestration_stats` e2e samples.
- New provider validation tests: 6 stats tests (`carry_forward`, `kv_delta_only`, `kv_merged`,
  `history`, `kv`, `nonexistent`).

### Fixed
- **get_instance_stats carry_forward parsing**: fixed error propagation in carry-forward event
  deserialization — errors now surface as `ProviderError::permanent` instead of being silently
  swallowed during stats computation.

### Changed
- Updated the `duroxide` dependency to 0.1.27.
- Bumped the provider package version to 0.1.8 for the 0.1.27 core compatibility update.

## [0.1.7] - 2026-03-15

### Added
- Added CosmosDB `kv_delta` documents for current-execution KV mutations with tombstone support.
- Registered the 9 new duroxide KV delta provider validation tests.

### Changed
- Updated the duroxide dependency to 0.1.26.
- `get_kv_value()` and `get_kv_all_values()` now merge `kv_store` and `kv_delta` with delta entries taking precedence.
- `fetch_orchestration_item()` now snapshots KV state from `kv_store` only.
- Terminal orchestration acknowledgements now merge KV delta state into `kv_store` and clear persisted delta documents.

### Fixed
- `clear_kv_values()` now tombstones both prior-store keys and in-flight delta keys.
- Instance deletion and execution pruning preserve the expected two-table KV semantics.

## [0.1.6] - 2026-03-14

### Breaking Changes
- **duroxide 0.1.25**: Updated duroxide dependency with KV timestamp support

### Added
- **KV timestamps**: `KeyValueDocument` now includes `last_updated_at_ms` field
- **Bulk KV reads**: Implemented `get_kv_all_values()` provider method
- **KV snapshot timestamps**: `fetch_orchestration_item` now returns `KvEntry` with value + timestamp
- **Instance-scoped KV**: Execution pruning no longer deletes KV entries

### Changed
- KV materialization now persists `last_updated_at_ms` from `KeyValueSet` events
- Provider validation test renamed: `test_kv_prune_removes_orphan_keys` → `test_kv_prune_preserves_all_keys`

## [0.1.5] - 2026-03-13

- **KV store support:** Durable key-value store for per-instance state. Orchestrations can store and retrieve key-value pairs via `ctx.set_value()` / `ctx.get_value()`. Client can read values via `client.get_value()` and poll with `client.wait_for_value()`. Cross-instance reads supported via `ctx.get_value_from_instance()`.
- Added `KeyValueDocument` type for CosmosDB KV storage (doc id = `<instanceId>:kv:<key>`)
- KV materialization in `ack_orchestration_item` (upsert/delete KV docs in transactional batch)
- KV snapshot loading in `fetch_orchestration_item` (query all KV docs for instance)
- Execution-aware KV pruning in `prune_executions`
- Instance deletion cascades to KV docs (already handled by partition-wide delete)
- Added 2 KV e2e sample tests (`sample_kv_request_response`, `sample_kv_cross_orchestration_read`)
- Bumped duroxide dependency to 0.1.24

## [0.1.3] - 2026-03-07

- Updated duroxide dependency from 0.1.21 to 0.1.22
- **Activity tag routing:** Added `tag_filter: &TagFilter` parameter to `fetch_work_item` for
  routing activities to specialized workers by tag (gpu, cpu, etc.)
- Added `tag` field to `QueueItemDocument` for CosmosDB query-level tag filtering
- Extracted `tag` from `WorkItem::ActivityExecute` in `enqueue_for_worker` for storage
- Tag filter SQL clauses: `DefaultOnly` (untagged), `Tags` (specific), `DefaultAnd` (both),
  `Any` (all), `None` (orchestrator-only)
- Added 9 tag_filtering provider validation tests
- Added 3 tag e2e samples: heterogeneous workers, starvation-safe fallback, dual-runtime cooperation

## [0.1.2] - 2026-03-06

- Fix `sample_config_hot_reload_persistent_events_cdb` test timing: increase per-cycle timer
  from 200ms to 1000ms and v3 sleep from 1000ms to 2000ms to handle CDB emulator latency
  under load. Preserves `pos_v3 > pos_cycle0` assertion.

## [0.1.1] - 2026-03-06

- Updated duroxide dependency from 0.1.20 to 0.1.21
- **Orphan queue message handling:** Drop `QueueMessage` items enqueued before orchestration
  starts (detected via empty `orchestration_name`, empty history, and all-QueueMessage batch).
  Non-QueueMessage items (e.g., `CancelInstance`) are kept for retry.
- Added `test_orphan_queue_messages_dropped` validation test
- Adapted `sample_config_hot_reload_persistent_events_cdb` e2e test to start orchestration
  before enqueuing events (matching corrected orphan message semantics)
- Added "Updating duroxide Dependency" section to copilot-instructions.md
- Added session e2e tests, stress tests, continue-as-new stress tests

## [0.1.0] - 2026-02-22

- Initial release: CosmosDB NoSQL provider for duroxide
- Single-container design with 6 document types (instance, queue, history, timer, lock, outbox)
- Partition-per-instance with transactional batch support
- Outbox pattern for cross-partition writes with background reconciler
- 256-slot lease-based dispatch for multi-node coordination
- Full Provider + ProviderAdmin trait implementation
