Skip to content

Commit cfd466c

Browse files
committed
Prepare 0.8.0 core boundary
1 parent 1902289 commit cfd466c

10 files changed

Lines changed: 500 additions & 164 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 0.8.0
4+
5+
- Bumped the crate to `0.8.0`.
6+
- Added an internal render plan boundary shared by raster rendering, SVG
7+
rendering, and encoding entry points.
8+
- Changed public enum `ALL` lists to slices so variant lists no longer carry
9+
duplicated manual array lengths.
10+
- Added `from_byte` helpers for `AvatarHashAlgorithm`, `AvatarKind`,
11+
`AvatarBackground`, and `AvatarOutputFormat`.
12+
- Added tests that fail if public enum `ALL` lists drift from parser/display
13+
behavior.
14+
- Documented the future `no_std + alloc` core boundary and the dependencies
15+
that currently belong outside it.
16+
317
## 0.7.0
418

519
- Bumped the crate to `0.7.0`.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hashavatar"
3-
version = "0.7.0"
3+
version = "0.8.0"
44
edition = "2024"
55
rust-version = "1.95"
66
description = "Deterministic procedural avatars in Rust with configurable identity hashing and WebP, PNG, JPEG, GIF, and SVG export"

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ The crate starts conservative: validated avatar dimensions, bounded identity inp
66

77
## Current Status
88

9-
The current development version is `0.7.0`.
9+
The current development version is `0.8.0`.
1010

1111
Implemented now:
1212

1313
- Pure library crate; no bundled demo server and no CLI binary.
1414
- Deterministic avatars derived from SHA-512 identity hashes by default.
1515
- Optional BLAKE3 and XXH3-128 identity derivation behind explicit Cargo
1616
features.
17+
- Public enum variant lists use single-source `ALL` slices and byte-to-variant
18+
helpers for deterministic option derivation.
1719
- Namespace-aware identity derivation for tenant isolation and visual rollouts.
1820
- Length-prefixed hash components to avoid delimiter ambiguity.
1921
- Avatar families: `cat`, `dog`, `robot`, `fox`, `alien`, `monster`, `ghost`, `slime`, `bird`, `wizard`, `skull`, `paws`, `planet`, `rocket`, `mushroom`, `cactus`, `frog`, `panda`, `cupcake`, `pizza`, `icecream`, `octopus`, and `knight`.
@@ -41,7 +43,7 @@ Planned or intentionally external:
4143
| License | `MIT OR Apache-2.0` |
4244
| MSRV | Rust `1.95.0` |
4345
| Crate shape | Library only |
44-
| Runtime dependencies | `image`, `palette`, `rand`, `sha2`; optional `blake3`, `xxhash-rust` |
46+
| Runtime dependencies | `image`, `palette`, `rand`, `sha2`, `subtle`, `zeroize`; optional `blake3`, `xxhash-rust` |
4547
| Unsafe policy | `#![forbid(unsafe_code)]` |
4648
| Filesystem policy | No public path-writing APIs |
4749
| Dimension limits | `64..=2048` pixels per side |
@@ -53,22 +55,23 @@ Planned or intentionally external:
5355

5456
Security-control details live in [docs/SECURITY_CONTROLS.md](docs/SECURITY_CONTROLS.md). Dependency policy lives in [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md). Panic policy lives in [docs/PANIC_POLICY.md](docs/PANIC_POLICY.md).
5557

56-
Future version planning for core-boundary preparation, possible
57-
`no_std + alloc` support, visual layers, and 1.0 stabilization lives in
58-
[docs/VERSION_PLAN.md](docs/VERSION_PLAN.md).
58+
Future version planning for possible `no_std + alloc` support, visual layers,
59+
and 1.0 stabilization lives in [docs/VERSION_PLAN.md](docs/VERSION_PLAN.md).
60+
`0.8.0` prepares the internal boundary for a future core crate, but `no_std`
61+
is not a public support contract yet.
5962

6063
## Install
6164

6265
```toml
6366
[dependencies]
64-
hashavatar = "0.7.0"
67+
hashavatar = "0.8.0"
6568
```
6669

6770
Optional identity hash algorithms are disabled by default:
6871

6972
```toml
7073
[dependencies]
71-
hashavatar = { version = "0.7.0", features = ["blake3", "xxh3"] }
74+
hashavatar = { version = "0.8.0", features = ["blake3", "xxh3"] }
7275
```
7376

7477
For a local checkout:
@@ -167,6 +170,24 @@ assert!(!bytes.is_empty());
167170

168171
Use namespaces when the same user identifier must not collide visually across tenants, products, or style-version rollouts.
169172

173+
## Example: Deterministic Options From Bytes
174+
175+
```rust
176+
use hashavatar::{AvatarBackground, AvatarKind, AvatarOptions};
177+
178+
let digest_bytes = [42_u8, 199_u8];
179+
let options = AvatarOptions::new(
180+
AvatarKind::from_byte(digest_bytes[0]),
181+
AvatarBackground::from_byte(digest_bytes[1]),
182+
);
183+
184+
assert!(AvatarKind::ALL.contains(&options.kind));
185+
assert!(AvatarBackground::ALL.contains(&options.background));
186+
```
187+
188+
The `from_byte` helpers use each enum's `ALL` slice, so new public variants do
189+
not require duplicated modulo constants in caller code.
190+
170191
## Example: Optional Hash Algorithm
171192

172193
```rust
@@ -205,7 +226,7 @@ cryptographic boundary.
205226

206227
```toml
207228
[dependencies]
208-
hashavatar = { version = "0.7.0", features = ["blake3"] }
229+
hashavatar = { version = "0.8.0", features = ["blake3"] }
209230
```
210231

211232
```rust
@@ -233,7 +254,7 @@ assert!(svg.contains("alien avatar"));
233254

234255
```toml
235256
[dependencies]
236-
hashavatar = { version = "0.7.0", features = ["xxh3"] }
257+
hashavatar = { version = "0.8.0", features = ["xxh3"] }
237258
```
238259

239260
```rust

RELEASE_NOTES_0.8.0.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# hashavatar 0.8.0
2+
3+
`hashavatar` 0.8.0 prepares the crate for future core-boundary work without
4+
adding new runtime dependencies or promising `no_std` support yet.
5+
6+
## Highlights
7+
8+
- Bumped the crate to `0.8.0`.
9+
- Added an internal render plan used by raster, SVG, and encode paths.
10+
- Changed public enum `ALL` lists from manually sized arrays to slices.
11+
- Added `from_byte` helpers for deterministic enum selection:
12+
- `AvatarHashAlgorithm::from_byte`
13+
- `AvatarKind::from_byte`
14+
- `AvatarBackground::from_byte`
15+
- `AvatarOutputFormat::from_byte`
16+
- Added tests that protect public enum parser/display behavior.
17+
- Documented which dependencies belong outside a future `no_std + alloc` core.
18+
19+
## Compatibility
20+
21+
- Avatar rendering output is intended to stay stable from `0.7.0`.
22+
- Public enum `ALL` associated constants now have slice type
23+
`&'static [Self]` instead of fixed-size array types.
24+
- Existing render, SVG, and encode entry points keep the same behavior.
25+
- `no_std` is still only a future direction, not a supported public contract.
26+
27+
## Security And Quality
28+
29+
- The dependency graph remains no larger than `0.7.0`.
30+
- Enum byte derivation uses `ALL.len()` rather than duplicated modulo counts.
31+
- Tests cover parser/display round trips, documented enum label order, and
32+
byte-to-enum derivation.
33+
- The internal render plan keeps deterministic avatar decisions separate from
34+
output encoding concerns.

docs/DEPENDENCIES.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,27 @@ Dependency changes should be reviewed for:
5454
--all-features` before release.
5555

5656
`scripts/validate-dependencies.sh` enforces the current direct dependency allowlist.
57+
58+
## Future Core Boundary
59+
60+
`0.8.0` starts preparing the code for a possible future `no_std + alloc`
61+
deterministic core, but the published crate still requires `std`.
62+
63+
Dependencies that belong outside a future core crate:
64+
65+
- `image`, because it provides raster buffers and encoders.
66+
- `palette`, unless color conversion is replaced or isolated behind a small
67+
core color type.
68+
- `rand`, unless procedural variation is moved to a deterministic byte-schedule
69+
that does not require an RNG dependency.
70+
71+
Dependencies that can plausibly remain in or behind a future core boundary:
72+
73+
- `sha2` for default identity hashing, subject to its active `no_std` support.
74+
- `zeroize` for clearing derived identity material.
75+
- `subtle` for constant-time identity digest comparison.
76+
- optional `blake3`, if the feature keeps its own platform acceleration and
77+
dependency policy acceptable.
78+
79+
`xxhash-rust` should stay optional and outside security-sensitive guidance
80+
because XXH3-128 is non-cryptographic.

docs/VERSION_PLAN.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ deterministic identity input.
9898

9999
## 0.8.0: Core Boundary Preparation
100100

101+
Status: implemented in `0.8.0`.
102+
101103
Goal: separate deterministic avatar decisions from encoding/integration
102104
concerns so a future `no_std + alloc` core is realistic.
103105

@@ -143,6 +145,17 @@ concerns so a future `no_std + alloc` core is realistic.
143145
- `scripts/stable_release_gate.sh check` passes.
144146
- crates.io publish dry run passes.
145147

148+
### Implementation Notes
149+
150+
- Public enum variant lists use `ALL` slices rather than array constants with
151+
duplicated lengths.
152+
- `from_byte` helpers derive variants from `ALL.len()` for hash algorithms,
153+
avatar kinds, backgrounds, and output formats.
154+
- Tests cover parser/display drift and byte-to-variant behavior for public
155+
enums.
156+
- Raster and SVG rendering now share an internal render plan before output
157+
encoding.
158+
146159
## 0.9.0: `hashavatar-core` Experiment
147160

148161
Goal: publish or prepare a constrained core API that can work in

fuzz/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish = false
88
cargo-fuzz = true
99

1010
[dependencies]
11-
hashavatar = { path = "..", version = "0.7.0" }
11+
hashavatar = { path = "..", version = "0.8.0" }
1212
libfuzzer-sys = "0.4"
1313

1414
[[bin]]

0 commit comments

Comments
 (0)