arena-lib 1.0.0

Typed memory arena and slab allocator library. Generational indices, typed arenas (one allocation per type), interned strings, and bump allocation. Zero unsafe leakage into user code.
Documentation
# Release v0.2.0 — Foundation

**Date:** 2026-05-21
**Compare:** [`v0.1.0...v0.2.0`](https://github.com/jamesgober/arena-lib/compare/v0.1.0...v0.2.0)

## Summary

`arena-lib` `0.2.0` lands the **Foundation** milestone: the four allocator primitives — generational arena, string interner, bump arena, and the shared error type — are live, tested, and shaped to the 1.0 contract. Every public path is safe Rust; `unsafe` is internal-only, concentrated in the bump arena, and carries `// SAFETY:` documentation at each call site. The 0.5 milestone now takes over to tune hot paths, swap the interner's backing map for a hash table, and grow the bump arena to multi-chunk.

## Added

- **Generational arena** (`arena_lib::arena`):
  - `Arena<T>` with `new` (const), `with_capacity`, `reserve`, `len`, `is_empty`, `capacity`, `contains`, `get`, `get_mut`, `insert`, `try_insert`, `remove`, `clear`, `iter`, `iter_mut`.
  - `Index` (8-byte `Copy` handle) exposing `slot()` and `generation()` for diagnostics.
  - `Iter` and `IterMut` yielding `(Index, &T)` / `(Index, &mut T)` pairs in slot order, skipping vacant slots.
  - Slot recycling with per-slot generation counters: a removed handle is permanently stale even after its slot is reused.
- **String interner** (`arena_lib::intern`):
  - `Interner` with `new` (const), `with_capacity`, `len`, `is_empty`, `intern`, `try_intern`, `resolve`, `lookup`, `contains`, `iter`.
  - `Symbol` (4-byte `Copy` handle) exposing `id()` for diagnostics.
  - Idempotent interning: equal inputs return equal symbols. Non-inserting `lookup` for cheap presence checks.
- **Bump arena** (`arena_lib::bump`):
  - `Bump` with `new`, `with_capacity`, `chunk_capacity`, `allocated_bytes`, `alloc`, `try_alloc`, `reset`.
  - Interior mutability via `UnsafeCell` lets `alloc(&self, value) -> &mut T` hand out multiple non-overlapping references from a single shared borrow — the established `bumpalo` pattern.
  - Alignment-aware allocation; ZST allocations take no chunk space.
  - `Bump` is `Send` but **not** `Sync` (one arena per thread).
- **Error surface** (`arena_lib::error`):
  - Single `#[non_exhaustive]` `Error` enum (`StaleIndex`, `CapacityExceeded`, `CounterOverflow`) with `Display`.
  - `Result<T>` alias used by every fallible entry point in the crate.
  - `std::error::Error` impl under the default `std` feature.
- **Prelude** (`arena_lib::prelude`) re-exporting `Arena`, `Index`, `Interner`, `Symbol`, `Bump`, `Error`, `Result`.
- **End-to-end smoke test** in `tests/smoke.rs` wiring all four primitives together (session table keyed by arena handles, identifiers deduped through the interner, scratch buffers cited from the bump arena).
- **API reference** `docs/API.md` expanded to cover the full 0.2 surface: nested table of contents, per-type cost summaries, worked examples per method group, alignment and threading notes for the bump arena.

## Changed

- **CI restructured.** Single monolithic `check` job replaced with separate `fmt` / `clippy` / `docs` jobs on `ubuntu-latest` plus a `test` job on the full `[ubuntu, macos, windows] × [stable, 1.85.0]` matrix. Avoids the Windows CRLF-versus-LF mismatch that breaks `cargo fmt --check` under `newline_style = "Unix"`.
- **GitHub Actions hygiene.** `actions/cache` bumped from `v4` to `v5`; the unused `actions/setup-node` step removed; the workflow opts every JS action into Node 24 via `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24` to silence the Node 20 deprecation warning.
- **README Quick Start** updated from the `VERSION`-only scaffolding example to an end-to-end prelude-based example exercising every 0.2 primitive.
- **Crate root doc** rewritten with a Quick Tour, module index, and `no_std` note; `VERSION` carries an example block.

## Compatibility

- **MSRV:** Rust `1.85` (unchanged).
- **Edition:** `2024` (unchanged).
- **Platforms:** Linux, macOS, Windows (Tier-1 targets; CI green on all three).
- **`no_std`:** supported. The crate pulls in `alloc` unconditionally; `default-features = false` disables `std`. Public surface is identical between the two modes today (only `std::error::Error` is gated).
- **Semver:** every public item listed in `docs/API.md` is part of the semver-tracked surface from this release. `Error` is `#[non_exhaustive]` so future variants are additive.

## Verified

- `cargo fmt --all -- --check` — clean.
- `cargo clippy --all-targets --all-features -- -D warnings` — clean.
- `cargo test --all-features` — 19 unit + 2 integration + 8 doctests passing.
- `cargo doc --no-deps --all-features` with `RUSTDOCFLAGS=-D warnings` — clean.
- `cargo doc --no-deps` (default features only) — clean.

## Next

Phase `0.5.0` — **Implementation**. Replace the interner's `BTreeMap` lookup with a hash table for O(1) intern / lookup. Grow the bump arena to a linked list of chunks so `alloc` becomes effectively infallible. Add a typed drop-arena variant for `Drop` payloads. Land property tests for the arena and bump invariants. Commit hot-path Criterion benchmarks under `benches/`. Document each public item with at least one rustdoc example.