photocraft/crates/engine
Brandon Thomas 4218d07f40
Never crash: the engine is panic-free (Rule 9) (#54)
Every unwrap/expect/unreachable in non-test engine code now returns an
EngineError (or a predicate's Err string) or uses a real fallback:
- enabled predicates read the active layer through active_layer_of()
  instead of unwrap() after has_layer();
- new raster layers get their pixels through pixels_mut()? instead of
  surface_mut().expect("raster");
- layer paths use split_last().ok_or(..)? (Merge Down, Arrange, Ungroup,
  Release Clipping), Auto-Align/Auto-Blend/Photomerge carry placements
  instead of re-unwrapping them, and "next free name" searches are bounded;
- web export builds its options map directly, quantize_rows has a wasm
  tail, parse_script rejects non-array/object JSON, the shape-layer edit
  returns an error instead of unreachable!, and the gray composite
  profile falls back to sRGB.
The engine denies unwrap/expect/panic/unimplemented/todo/unreachable.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 13:26:26 -04:00
..
examples Format: adopt the craft-family rustfmt.toml and format the workspace 2026-10-04 11:31:17 -04:00
src Never crash: the engine is panic-free (Rule 9) (#54) 2026-10-04 13:26:26 -04:00
tests Format: adopt the craft-family rustfmt.toml and format the workspace 2026-10-04 11:31:17 -04:00
Cargo.toml Analysis, notes, proof views, workspaces (+ in-progress work of other agents) 2026-10-01 22:49:07 -04:00