Commit Graph

3 Commits

Author SHA1 Message Date
Leopere 0314c598fb
Polish: camera-only entropy, cleaner output, complete docs
- Remove CSPRNG fallback: pool now returns errors when camera entropy
  is insufficient instead of silently falling back to ChaCha20.
  Random data is only from camera input or not at all.
- Fix throughput display: show Mbps/KB/s for smaller frame sizes,
  Gbps/MB/s for larger ones (actual frame size varies by pixel format).
- Add RESEARCH.md note about pixel format impact on throughput.
- Complete README API table with all endpoints (dice, password, coin,
  8ball, cameras, docs, MCP).
- Add docker-compose device mapping for Linux camera access with
  explanatory comments about macOS limitation.
- Add macOS LaunchAgent scripts (install/uninstall/plist template).
- Polish run-mac.sh with build step and clearer output.
- Fix dead code warnings on library utility functions.
- Add /logs/ to .gitignore for LaunchAgent log output.
- Fix skill.md: remove stale CSPRNG fallback references.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 11:08:13 -05:00
Leopere 1bcdfb4023
Fix Dockerfile build and remove camera device requirement
- Simplify build process by removing dummy source step
- Fix binary name from camera-trng to camera-qrng
- Copy skill.md to fix include_str! error
- Remove /dev/video0 device requirement from docker-compose
- Allows container to run with CSPRNG fallback when no camera available

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 21:21:45 -05:00
Leopere 5b49685ae9
Harden resilience: auto-restart harvester, poison-safe mutexes, graceful shutdown
- Replace all Mutex::lock().unwrap() with lock_or_recover() that recovers
  from poisoned mutexes instead of panicking (cascading failure prevention)
- Wrap harvester loop in catch_unwind with a supervisor thread that
  automatically restarts on panic (requires panic=unwind in release profile)
- Add exponential backoff with jitter for camera reconnection (2s base,
  60s cap) instead of fixed 10s intervals
- Enforce frame deadline: frames exceeding FRAME_TIMEOUT are treated as
  errors rather than just logged
- Add graceful shutdown via SIGINT/SIGTERM with axum's
  with_graceful_shutdown
- Track harvester restart count via AtomicU64 for diagnostics
- Extract docs/MCP handlers into src/docs_handlers.rs to keep main.rs
  under 400 lines
- Change release profile from panic=abort to panic=unwind so
  catch_unwind actually works in production
- Add tokio signal feature for shutdown handling

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 13:47:23 -05:00