Skip to content

feat: audio and the Form family's file types, with location-safe exports and full licence notices - #19

Merged
nodemode-ai merged 36 commits into
mainfrom
feat/audio-assets
Nov 30, 2026
Merged

nodemode-ai merged 36 commits into
mainfrom
feat/audio-assets

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Audio becomes a third media kind, and FormDAM learns the Form family's other file types. Closes #17.

Audio

  • Import MP3, M4A/AAC, WAV, AIFF, FLAC, OGG/Opus, CAF and WMA, plus MP4 or MOV files that hold only sound. Duplicate checks are unchanged.
  • Duration, sample rate, channels, bit depth, codec, bitrate and tags (title, artist, album, genre, cover art) are read with the ffprobe FormDAM already uses, and are searchable. Smart albums can filter on them; duration sorts were added.
  • Tiles show cover art or a waveform with a duration badge. The viewer has a scrubbable waveform player with loop, volume and the video player's shortcuts.
  • Ratings, labels, keywords, albums, XMP sidecars, trash, the vault, export, share packages and web galleries all handle audio. Non-destructive trim with an optional loudness pass saves a new clip.
  • Exports without location always strip audio metadata, and cover art is re-encoded so its own metadata goes too. Listen copies and waveforms of protected items are never written to disk.

Form family file types

  • Form project files, listed from a copy of the family registry and FormPortal's catalogue. Each shows its own preview and manifest when it carries one, or a drawn app tile when it does not, and has "Open in ".
  • More photo and video formats: PSD and PSB, TGA, ICO, JP2, EXR and HDR (tone mapped), DPX, SVG (sanitised, external references refused), MXF, MPEG, WMV, FLV and OGV, with R3D and BRAW catalogued. A folder of numbered frames becomes one image sequence.
  • Design resources: font specimens, colour LUTs with a before and after, captions with full-text search, ASE palettes, and Lottie playback from sanitised data.
  • Documents: PDF page images and text, plus text, counts and thumbnails for DOCX, PPTX, XLSX, CSV, Markdown, TXT, RTF and IDML.
  • 3D: GLB and glTF, OBJ, STL, PLY and text USD give a still, a turntable and counts. STEP and IGES show as point clouds; FBX, binary USD and Alembic are catalogued.
  • Every new kind gets ratings, labels, keywords, albums, sidecars, trash, the vault, export, share, filters, counts and smart albums. Previews come from a background worker and never block import. Every reader has size and count limits, and XML is parsed with DTDs refused.

Location, vault and licences

  • Exports that leave out location are checked and fail closed for every kind. A PDF leaves as a clean copy rebuilt with pypdf (BSD-3-Clause) from only what its pages use, with images re-encoded and attachments, metadata and unknown streams dropped. Anything that cannot be rebuilt safely is refused with a plain message.

  • A referenced original (catalogued in place) moves into the vault when its item is protected. It is encrypted, checked and only then removed from its folder; restore puts it back. The Disk browser and its thumbnails leave protected items out.

  • A generated THIRD-PARTY-NOTICES.txt carries the full licence text of every bundled Python package, npm package and Rust crate, plus the FFmpeg reference. It ships with the app and engine and is shown in Settings > App > Licences and notices. CI checks it stays current.

  • PDFs that cannot be rebuilt safely can be flattened to images on request: the person sees which PDFs, and that their text will no longer be selectable or searchable, and confirms. The API and agents flatten only with an explicit flatten_pdfs flag.

  • A one-time scan (and Scan Again in Settings > Vault & Keychain) finds plain copies that older vault seals left in known folders, matched by size and SHA-256, and moves each into the vault only after the person confirms.

  • Sealed WAV waveforms decode without ffmpeg.

Tests

  • Backend: 340 passed, 1 skipped (322 passed, 19 skipped with no ffmpeg, as on CI). Window smoke: 3 passed. Frontend: 36 passed, tsc and build clean, npm audit 0 vulnerabilities. ruff and the notices check pass.
  • New tests cover each reader, every location and vault path, the PDF rebuild (attachments, inline images, JPX, spoofed markers) and the size limits.
  • Not run locally: the desktop app and src-tauri tests. Please rely on this PR's CI.

For the owner

  • More PDFs are refused when location must be removed (scans, inline images, shaded art); the person can flatten them to images instead.
  • A few Form file extensions in backend/app/data/form_apps.json are marked proposed and need confirming per app.
  • JPEG XL decodes only when the ffmpeg in use has libjxl; a decoder for it is parked.
  • Other items need an owner decision and are listed separately.

How to ship

Classify and import mp3, m4a, aac, wav, aiff, flac, ogg, opus, caf and wma
(and sound-only mp4/mov) as kind audio with the same hashing and duplicate
checks. Read codec, sample rate, channels, bit depth, bitrate, tags, cover
art and location through ffprobe, with a WAV fallback. Draw waveform or
cover-art thumbs, serve peaks and a FLAC listen copy, list, count, filter,
search and sort audio by duration, keep audio out of face, CLIP, OCR,
visual duplicate and memory jobs, and purge plain audio caches when an item
becomes protected.
Trim and trim export accept audio, with optional loudness normalising that
falls back to FLAC when the encoder is missing. Export, share packages and
web galleries strip audio metadata whenever location or metadata is left
out, keeping cover art.
Adds the Audio section, counts, filters and duration sorts, tile badges with
duration, an info panel audio block, a waveform player with scrub, play,
loop, volume and keys, and audio trimming with loudness normalising. The
trim screen moves out of editor.ts into trim.ts.
… are dropped

Stripping location with a stream copy kept the embedded cover and its
EXIF. The cover is now re-encoded to PNG, or left out when the container
cannot hold it. Listen copies, waveforms and audio thumbs written while
an item became protected are deleted right after they land.
Recognises each family app's project files from a registry copy that
FormPortal's catalogue extends, reads the proposed preview and manifest
convention from zip and JSON projects, falls back to a drawn app icon,
and opens a project in its app through FormPortal or the app's own
handler. File kinds get ratings, labels, keywords, albums, sidecars,
trash, the vault and its cache purge, export, share, filters, counts and
smart-album rules; a worker thread makes previews after import.
PSD, TGA, ICO and JPEG 2000 through Pillow; EXR and HDR tone mapped from
ffmpeg floats; DPX, PSB and JPEG XL through ffmpeg; sanitised SVG through
resvg. MXF, MPEG, WMV, FLV and OGV are videos with a playable WebM copy
on demand; R3D and BRAW are catalogued without probing. A folder of
numbered EXR, DPX, PNG or TIFF frames imports as one sequence with its
frame range, rate and size. Non-media originals are served sandboxed.
…led out

Bound the EXR header reader and read every part of a multipart file.
Archives are rebuilt from an allowlist of member types, each verified:
EXR and DPX location data is wiped, rasters and text are scrubbed and
checked for GPS values in any XMP form, nested archives are walked, and
anything that cannot be checked is refused.
Archive members are read in chunks against per-member and running caps
across nesting, with member and depth limits. Single files go through
the same verifiers as members, PDFs with their streams inflated, fonts
after unpacking; anything unverifiable is refused, and a refused share
is remembered.
…be checked

A top-level file whose row holds a location leaves only as a raster that
reads back clean. Encrypted PDFs, streams with filters other than Flate
or a lone DCT, and Flate streams that do not inflate completely are
refused.
…ources

Fonts get a specimen and their name-table facts, LUTs a before and after
on a drawn test image, captions a cue list and full-text search, ASE
palettes named swatches, and Lottie files their canvas, rate and frames
with playback in the viewer from sanitised data. All are one resource
kind with a filter, count and smart-album flags per subkind.
Scanning PDF bytes for location missed escaped filter names, indirect
filters and other encryption forms. Without a PDF writer to make a clean
copy, a PDF leaves only with its location kept.
PDF through pypdfium2 with page images in the viewer; DOCX, PPTX, XLSX,
CSV, Markdown, TXT, RTF and IDML read for their text, counts and saved
thumbnails or a drawn page. Text goes into the searched text column, and
lists carry only its first 2000 characters. Plain text is now a document
kind, so the upload test skips an unknown extension instead.
…search

Sheet and shared-string parts are read up to 2 MiB with the stdlib pull
parser, refusing documents with a DTD, and stop after the shown rows and
the strings they need. Cell text is cut to 200 characters and fitted to
its column by binary search.
GLB and glTF, OBJ, STL, PLY and text USD or USDZ are read with numpy for
triangles, vertices, bounding size and materials, drawn as a shaded
still and turned in a canvas viewer; STEP and IGES show as point clouds
with their counts and units; FBX, binary USD and Alembic are catalogued
by format.
Accessor counts and strides are validated and strided data is read in
one pass. OBJ, USD, STEP and IGES stop and refuse past their vertex,
face or point caps, and request-time meshes read at most 64 MiB.
A UTF-16 part slipped past the byte check for a DOCTYPE. Workbook parts
and SVG now go through expat with every doctype and entity handler
raising, and parts declaring or carrying another encoding are refused.
glTF checks running vertex and index totals and limits meshes and
primitives; OBJ and USD check each polygon against the face cap and a
per-face corner limit before extending.
Expat buffers character data, each element joins its parts once at its
end tag, and text past 8192 characters per element is dropped.
Only file kinds wait for the background worker, so the has_preview
smart-album flag matches media items again.
pypdf (BSD-3-Clause) rewrites the PDF with its document information,
XMP metadata and embedded JPEG metadata removed, then reads the copy
back and checks every object. Encrypted PDFs and anything that cannot
be verified are still refused.
Attachments go through the name tree, /EF, /AF and FileAttachment
annotations, so all are removed and any embedded container left is
refused. JPEG markers are walked past the first scan, JPEG 2000 passes
only with plain boxes, and a PDF with a stored location leaves without
it only when every stream was understood.
The clean copy is a new document holding only each page's content and
the resources it uses; images are re-encoded from their pixels and ICC
profiles replaced by device spaces. Everything else is left out, and
every object in the written copy is searched for location and photo
metadata before it is used.
Dictionaries pass through per-type key allowlists, raw image samples are
size-checked and rewritten through Pillow, inline images and unknown
streams refuse the PDF, and every copied byte string is searched for
embedded file signatures anywhere in it.
setup/notices.py writes THIRD-PARTY-NOTICES.txt from the installed Python
packages, the production npm packages, the Rust crates in Cargo.lock and
the downloaded ffmpeg build, and its check mode runs in CI. The file ships
in every installer and the engine, and Settings shows it under Licences
and notices.
CharProcs entries must be content streams, an indexed colour space needs
an integer size from 0 to 255 and a table that fits it, and every value
copied from the source is rebuilt rather than reused.
Hiding, deleting or making private an item added in place now seals the
file itself, checks the sealed copy against it and only then removes the
plain file from its folder. Restoring puts it back at its path or beside
it under a new name, and delete forever gives it back. The Disk browser
and its thumbnail cache leave protected items out, and the window asks
before moving an outside original into the vault.
Sidecars formDAM wrote are sealed with their originals, the vault folder
is fsynced before an original is removed, failed seals back off and still
scrub caches, interrupted seals are finished, restores claim their name
exclusively and a failed give-back keeps the item in Recently Deleted.
The Disk browser checks protected rows once per listing, and waveform
decodes have a watchdog and a bounded buffer.
Preview storage tolerates unbindable values, PLY and STL readers are
capped, SVGZ inflation and ffmpeg stills are bounded, PNG and TIFF frames
group only when they look rendered, and location stripping refuses
instead of failing on unexpected archives and text.
Late content no longer moves the asset panel, mesh colours come from the
tokens, fetches and drags are released with their views, audio keys and
paste-edits stay off under dialogs and Trim, and the notices script
evaluates markers for every shipped platform.
Moves the check for edit files another item still uses into extedit so
vaultcrypt.py stays under the file size limit after the merge.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 20:47
A protected item's waveform comes from its sealed bytes, and without
ffmpeg those were never given to the WAV reader, so the route answered
409. This is what failed PR #19's Linux engine tests.
When the rebuild refuses a PDF, exports, packages and web galleries name
it and the window asks whether to render every page to an image in a new
PDF with no metadata. Nothing is flattened without the flatten_pdfs flag.
A one-time scan after the upgrade, and Scan Again in Settings > Vault,
look in folders formDAM has imported from or browsed for files matching
protected items by SHA-256. Each one moves into the vault after the same
check, or is ignored, only when the person chooses. The README now
describes the vault, delete forever of files added in place and flattening.
@nodemode-ai
nodemode-ai merged commit 42d0a07 into main Nov 30, 2026
5 checks passed
@nodemode-ai
nodemode-ai deleted the feat/audio-assets branch November 30, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support the Form family's file types (project files, documents, 3D, design resources, more image and video formats)

2 participants