Commit Graph

13 Commits

Author SHA1 Message Date
Hermes Agent 2017447e81 feat(receiver): informative frame stats, camera zoom, crop overlay, jsQR opts
- Frame count now shows: scanned / useful (linearly independent) / minimal needed
- Camera zoom via getUserMedia track.applyConstraints when supported
- Software crop fallback with visible dashed-square overlay on video
- Corner markers on scan region for visual feedback
- qr_decode accepts inversionAttempts option for faster GIF decoding
- Preserved attemptBoth for camera scanning (handles glare/reflections)
2026-05-03 13:10:08 +00:00
Hermes Agent bbe49ddee8 refactor: replace manifest with fixed header, single V10-M profile
- Remove CBOR manifest and manifest.ts entirely
- Fixed 18-byte packet header: sessionId, generationIndex, symbolIndex,
  packetType, totalGenerations, dataLength, flags, reserved
- Single hardcoded profile: QR V10, ECC M, K=16, R=8, payload=191 bytes
- Add isText flag (bit 0 of flags) for text vs binary routing
- Remove hash computation and profile selection UI
- Update all tests to match new protocol (33 tests passing)
- Fix generateCoefficients arg order bug in complete.test.ts
- Fix createQRGif dimension bug in tests
- Make prod_roundtrip frame loss deterministic

All 33 tests pass. Build succeeds.
2026-05-03 12:10:09 +00:00
Hermes Agent 2506ac317c Fix decode stalling: include packetType in dedup key to prevent manifest/data collision
The dedup key was `::`, which
caused manifest fragment 0 to collide with systematic symbol 0. The RLNC
decoder then never reached full rank, so generations never solved and the
receiver appeared to hang.

- Add packetType to dedup key so manifest/systematic/coded symbols are unique
- Add completed session flag to ignore late frames after reconstruction
- Prevent trailing progress message from overwriting complete status
- Add frame_decode and prod_roundtrip tests
2026-05-03 02:12:40 +00:00
Hermes Agent 98eaadfa87 Add debug logging to decode worker: track frame count, report QR null/error messages to UI. Error display now visible in GIF file mode. 2026-05-02 23:29:32 +00:00
Hermes Agent 91cdaec50d Cleanup test files 2026-05-02 23:20:00 +00:00
Hermes Agent 067c4abbc7 Fix GIF file mode: send transferable ArrayBuffer pixels instead of ImageData objects (structured clone can fail in some browsers). Worker reconstructs ImageData from received buffer. 2026-05-02 23:19:56 +00:00
Hermes Agent 1f406b5739 Fix GIF parser: gifFrameToRgba now fills all pixels with background color (was leaving unset pixels as (0,0,0,0) black). Add error display to GIF file mode section. 2026-05-02 23:14:52 +00:00
Hermes Agent cad1f91b92 Fix QR decode for binary data: use jsQR chunk.bytes instead of result.data (UTF-8 drops bytes>127). Fix GIF LZW decoder: don't reset bit buffer on clear code (discards valid bits). Fix receiver GIF file mode: use gif_parser instead of drawImage (only captured first frame). 2026-05-02 23:04:00 +00:00
Hermes Agent dc370f9bce Fix GIF roundtrip: rewrite LZW decoder, add GIF file test mode
- Rewrote GIF LZW decoder (gif_parser.ts) — old version produced
  wrong pixel indices for larger images (V20 QR frames), causing
  all QR decodes to fail after GIF roundtrip
- Added full end-to-end test: encode → QR → GIF → parse GIF →
  decode QR → RLNC decode → reconstruct (94 tests passing)
- Added GIF File input mode to receiver for debug/testing
- Fixed receiver stale closure bug (scanning state captured
  as false, preventing any frame capture)
- GIF parser handles: LZW, interlaced, local/global palettes,
  Graphics Control Extension, disposal methods
2026-05-02 22:43:58 +00:00
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