github ilyakruchinin/SomnoTrace v4.0.0-beta8

pre-releaseone hour ago

SomnoTrace v4.0.0-beta8 ๐Ÿซ

A reliability-focused beta. The headline: imports and STR handling now refuse to guess.
If the evidence isn't there, sources are kept for a later pass instead of being merged,
rewritten, or thrown away.

๐Ÿ—‚๏ธ ResMed STR that rebuilds itself properly

  • Native STR rebuild that refreshes the cumulative STR.edf without touching DATALOG
    or your current settings.
  • Identity checks before writing โ€” the native marker, serial number and device family
    are verified first, so a foreign or mismatched card can't silently overwrite your data.
  • Atomic file operations throughout, so an interrupted rebuild leaves the old file
    intact rather than a half-written one.

๐Ÿ“ฅ Imports that don't invent data

  • Source fingerprinting โ€” every imported EDF is hashed (SHA-256) with size and record
    counts recorded in the session manifest. A re-dropped file is now recognised as the
    same file instead of being imported twice.
  • Growing and rewritten files are handled โ€” a source that keeps growing keeps its
    prefix hash, so a later, larger version is treated as a continuation rather than a
    conflict.
  • Late arrivals work โ€” annotation files (EVE/CSL) and waveforms that show up in a
    different order, or hours apart, are matched on evidence rather than arrival order.
  • Ambiguity is preserved, not resolved by guessing โ€” when evidence is missing or
    contradictory, sources stay staged and the reason is reported. Nothing is merged just
    because two files were close together.
  • Existing sessions are never retroactively modified. Historical imports keep their
    original manifests byte-for-byte; the new rules apply only to new imports.
  • Corruption is detected, not assumed โ€” truncated JSON, embedded NULs and short reads
    are now provably identified as corrupt instead of being parsed into something plausible.

๐Ÿง  Memory: fewer resets, more headroom

  • PSRAM-backed task stacks for the import, download, export and scoring workers, with
    heap and stack-watermark logging around each phase so memory pressure is visible in the
    console instead of showing up as a mystery reboot.
  • Bounded SomnoBridge transaction journal with rotation, reboot-safe IDs and torn-record
    recovery. Unfinished evidence is archived, never silently discarded.
  • Session downloads now run on one persistent PSRAM worker with a reusable buffer and
    proper range support, and report a clear retryable error instead of falling back to a
    large internal-RAM stack.
  • Scoring failures no longer publish partial output โ€” a failed allocation keeps the
    previous sleep-stage result rather than replacing it with something incomplete.

๐ŸŒ Web and status fixes

  • WebSocket lifecycle is now generation-safe. Failed receives, evicted clients and
    queued sends are tracked per connection, so a recycled socket can no longer close or
    pause the new connection that reused its descriptor.
  • Bridge catalog warm-up reads as warming, not as an error. NOT_SCANNED days are
    expected right after boot; they no longer look like a failed sync.
  • Dashboard knows whether sleep stages exist and picks them up when they appear,
    instead of repeatedly requesting files that aren't there. Missing stages are served
    uncached, so a newly finished night shows up without a hard refresh.

๐Ÿงช Testing and CI

  • Host suite hardened under ASan/UBSan, now covering import arrival permutations,
    interrupted publication, journal rotation and WebSocket descriptor reuse.
  • Mutation check timeout raised 20 โ†’ 30 min โ€” it was being cancelled by runner speed
    alone at ~20 minutes, with no failing mutant.
  • sb_ble_test now skips with an install hint when zlib headers are missing, matching how
    cJSON, mbedTLS and Node already behave.

โš ๏ธ Worth knowing

  • Without usable STR mask evidence, the existing 60-second pairing heuristic is still the
    fallback. Two genuinely separate sessions that start very close together may still be
    treated as one; stronger evidence is required to split them.
  • Sessions imported before this release are frozen by design. They are not repaired,
    migrated or merged automatically.
  • Unsupported or unverifiable source content is retained rather than claimed as lossless.

Full Changelog: v4.0.0-beta7...v4.0.0-beta8

Don't miss a new SomnoTrace release

NewReleases is sending notifications on new releases.