# Release v0.2.0 - 2026-05-20

## Summary

Foundation milestone delivered. The public API surface for `audit-trail` is
now defined: the `Record`, `Chain`, and three pluggable traits (`Hasher`,
`Sink`, `Clock`) plus a coarse-grained `Error` enum. The append hot path is
allocation-free and the crate remains `no_std` capable. An end-to-end smoke
test exercises the chain across genesis, linkage, monotonic-clock
enforcement, sink failure, and resume.

## Added

- **Records and identifiers**
  - `Record<'a>` — borrowed 5W tuple with chain links (`prev_hash`, `hash`).
  - `RecordId` — `u64` newtype with `GENESIS` constant.
  - `Actor<'a>`, `Action<'a>`, `Target<'a>` — `&str` newtypes for the
    "who / what / where" fields.
  - `Outcome` — `#[non_exhaustive]` enum (`Success`, `Failure`, `Denied`,
    `Error`) with stable `as_u8()` encoding.
- **Hashing**
  - `Digest` — 32-byte hash output with `ZERO`, `from_bytes`, `as_bytes`,
    `into_bytes`, and `LowerHex` rendering.
  - `Hasher` — pluggable, allocation-free hash trait
    (`reset` / `update` / `finalize`).
  - `HASH_LEN` constant.
- **Time**
  - `Timestamp` — `u64` newtype, nanoseconds since the Unix epoch, with
    `EPOCH` constant.
  - `Clock` — pluggable time-source trait.
- **Persistence**
  - `Sink` — pluggable persistence trait; receives borrowed `&Record`.
- **Chain**
  - `Chain<H, S, C>` — append-only, hash-linked log.
  - `Chain::new`, `Chain::resume`, `Chain::append`, `next_id`, `last_hash`,
    `last_timestamp`, `sink`, `sink_mut`, `into_parts`.
  - Stable field separator (`0x1f`) mixed between hashed fields to prevent
    concatenation-collision ambiguity.
- **Errors**
  - `Error` (`#[non_exhaustive]`): `Sink`, `ChainBroken`, `Capacity`,
    `NonMonotonicClock`.
  - `SinkError` (`#[non_exhaustive]`): `Io`, `Capacity`, `Closed`, `Other`.
  - `std::error::Error` impls behind the `std` feature.
- **Tests**
  - 5 integration tests covering genesis linkage, chain integrity,
    non-monotonic-clock rejection, sink-failure propagation with preserved
    state, and resume from a persisted tail.
  - 16 rustdoc doctests — one example per public item.

## Changed

- Bumped MSRV to **1.85** to align with `edition = "2024"`. README badge,
  README "Standards" section, and the CI matrix updated accordingly.
- README `Quick start` snippet now targets `audit-trail = "0.2"`.
- Crate version bumped to `0.2.0`.

## Verified

- `cargo build --all-features` — clean.
- `cargo build --no-default-features` — clean (no_std build verified).
- `cargo test --all-features` — 5 smoke tests + 16 doctests, all green.
- `cargo clippy --all-targets --all-features -- -D warnings` — clean.
- `cargo doc --no-deps --all-features` with `RUSTDOCFLAGS=-D warnings` —
  clean.

## Roadmap status

Phase 0.2.0 - Foundation: complete.

- [x] Public types defined
- [x] Public traits defined
- [x] Module structure laid out
- [x] Error type defined
- [x] First end-to-end smoke test passing
- [x] CHANGELOG updated
- [x] `.dev/release/v0.2.0.md` written

## Next

Phase 0.5.0 - Implementation. See `.dev/ROADMAP.md`.
