Commit Graph

4 Commits

Author SHA1 Message Date
Hermes Agent 6f3f0b2ee2 Fix receiver: stale closure + add GIF file test mode
- Fix stale closure bug in camera capture loop (scanning state
  captured as false, preventing any frame capture)
- Add GIF File input mode to receiver — upload a QR-over-GIF
  directly to test the decode pipeline without camera
- Update decode worker to accept imageData or frameData
- Receiver now shows two input modes: Camera and GIF File
2026-05-02 22:22:42 +00:00
Hermes Agent 0241068994 Fix receiver stale closure bug — scanning never started
The rAF capture loop checked  where
 was a state variable captured in a stale closure.
The loop was created when scanning=false, so it immediately
exited on every frame and never captured any camera frames.

Fix: use scanningRef (useRef) instead of state for the loop
guard, so the rAF callback always reads the live value.
2026-05-02 22:17:04 +00:00
Hermes Agent efdf9d0e13 Fix robustness, white border, GIF size estimate
- Fix Robust profile: V20-Q (97 modules, 315px) instead of broken V31-Q
  — fewer modules = bigger squares = camera-friendly
  — K=16, R=16 (100% overhead for max robustness)
  — Actual max payload: 450 bytes (verified against QR library)
- Fix Balanced: V25-Q, K=20, R=12
- Fix Fast: V35-M, K=24, R=8
- Remove ugly white border: global CSS reset (margin:0, padding:0)
- Remove broken estimated GIF size (was off by orders of magnitude)
- Show actual GIF size after generation instead
- Add 8MB file size limit
- Remove warning banners
2026-05-02 22:08:36 +00:00
Hermes Agent b20e5c9c17 Initial implementation: QR-over-GIF Transfer System
- Protocol: packet format, CRC32C, CBOR manifest, fragmentation
- FEC: GF(256) arithmetic, xoshiro128** PRNG, systematic RLNC encoder/decoder
- QR: generation (qrcode-generator), rasterization (3px/module), decoding (jsQR)
- GIF: animated GIF generation (gifenc) with 2-colour palette
- Preprocessing: deflate compression, SHA-256 hashing
- Sender pipeline: packetizer, frame scheduler with interleaving
- Workers: encode, gif generation, decode/reconstruction in Web Workers
- UI: Preact SPA with Sender/Receiver tabs, dark theme
- Tests: 93 passing (unit, property-based, integration, E2E)
- Default profile: Robust (V31-Q, K=24, R=12)
- Deployed to /hermes-web-demos/qr-transfer/
2026-05-02 21:37:06 +00:00