Skip to content

.hyperaudio parity: filename rules, envelope preservation, byte caps, STORE enforcement (#403 Phase A) #447

Description

@maboa

Part of the #403/#404 Phase A push. The .hyperaudio reader/writer in #404 diverges from the format's reference behavior in ways that break cross-implementation round-trips. All fixes are contained and testable against the shared fixture suite (spec repo).

  1. Media path validation: reject /, \, and the exact segments ./.. — but permit .. as a substring (mix..final.mp3 is legal). The current any-substring rejection makes conforming containers written elsewhere unreadable; this exact bug class has already occurred in the wild once.
  2. Sanitize media filenames with one sanitizeMediaFilename() shared by descriptor construction, OPFS storage, and ZIP entry creation — writer and reader must share the rule.
  3. Envelope preservation: keep the parsed raw envelope in the session; on save, structuredClone it and overwrite only editor-owned fields (merge owned keys inside known nested objects). Unknown top-level and nested fields must survive an open→save round trip.
  4. Text caps in UTF-8 bytes: read entries as uint8array, enforce the 50 MB cap on bytes, decode with new TextDecoder('utf-8', {fatal: true}) so invalid UTF-8 is rejected consistently.
  5. Reject non-STORED media entries (or enforce a strict streaming size cap) — matching the format's requirement and avoiding JSZip private-field reliance.

Acceptance: the shared fixtures (legal .. names, unicode/hostile names, unknown fields, newer minors/majors, invalid UTF-8, compressed media, oversized text, link media, missing media, captions variants, original-transcript preservation) pass in both directions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions