Repository navigation
licensing: replace bundled libsndfile LGPL runtime path #1129
Description
Commercial-policy defect
BandScope's analysis engine directly depends on soundfile>=0.13.1. The Python soundfile package itself is BSD-3-Clause, but its documented binary-wheel/runtime path relies on libsndfile; platform wheels can bundle libsndfile, whose license is LGPL. ContextualWisdomLab does not accept GPL/LGPL/AGPL components as an inbound default for the commercial ecosystem.
Exact evidence
services/analysis-engine/pyproject.tomldeclaressoundfile>=0.13.1in the runtime dependency set.- python-soundfile 0.13.1 documentation states that SoundFile is based on libsndfile/CFFI/NumPy, that audio I/O is provided by LGPL libsndfile, and that binary wheels may ship their own libsndfile copy. It also states that SoundFile opens the formats libsndfile supports.
- BandScope's current native product contract advertises WAV, MP3, FLAC, and M4A intake. The libsndfile upstream issue
libsndfile/libsndfile#389requesting AAC in an M4A/MP4 container remains open, so current SoundFile/libsndfile preflight cannot be treated as evidence that the advertised M4A contract is natively covered. - feat(analysis): enforce one canonical audio resource policy (#781) #985 therefore remains a preservation/evidence lane for the historical M4A fallback only; its
audioreadpath may invoke an external decoder and widens authority from an admitted handle to a filesystem path. It is not a commercially approved replacement and must not be cherry-picked as a licensing workaround. - A fresh candidate scan found that current Symphonia supports AAC and MP4 in pure Rust, but its upstream license is MPL-2.0. That is not the preferred Apache-2.0/MIT/BSD-class inbound profile in this issue and therefore requires an explicit organization/legal policy decision before it can become the selected commercial boundary. Capability alone is not license admission.
Checking only the top-level Python package license or wrapper metadata is therefore insufficient for both the distributed/runtime dependency chain and the advertised supported-format contract.
Required outcome
Replace or remove the libsndfile-backed runtime path from the commercially supported BandScope product without weakening real-audio behavior.
Acceptance must include:
- a commercially permitted, organization-approved audio I/O boundary with exact transitive/native license provenance (prefer Apache-2.0/MIT/BSD-class permissive licensing; any other license requires explicit policy acceptance rather than assumption);
- equivalent or stronger decoding and metadata-preflight semantics for the formats BandScope actually advertises, including M4A/AAC, with rights-cleared realistic audio fixtures and recognized decode/resample reproducibility evidence;
- descriptor/byte-buffer-first admission where feasible so the replacement does not regress fix(audio): establish canonical local-audio resource policy #866's bounded, path-minimizing Resource Admission authority; any subprocess or filesystem-path fallback needs an explicit threat/resource contract;
- removal of the LGPL native dependency from lock/build/package/SBOM/release inputs rather than merely changing the Python wrapper;
- updated dependency policy, architecture, README/public docs, SBOM/NOTICE/third-party evidence where applicable;
- validation on mandatory Windows and macOS product lanes, including the advertised WAV/MP3/FLAC/M4A set, before commercial readiness is claimed.
Decision boundary
Do not select a decoder because it is Rust-only, pure Rust, or format-complete in isolation. Candidate evaluation must score license admissibility, exact AAC/M4A/WAV/MP3/FLAC coverage, descriptor/streaming API, bounded allocation behavior, deterministic resampling handoff, Windows/macOS packaging, vulnerability/supply-chain history, and maintenance health. Preserve #866 as the Resource Admission/Decode source authority until this issue has an approved replacement contract; then land the replacement through ordinary ancestry with real-audio RED→GREEN evidence and remove libsndfile from the actual product graph.
Do not solve this by suppressing native dependency inventory, pinning a different LGPL libsndfile build, treating wheel/container/process separation as a waiver of organization policy, silently dropping M4A from one layer while UI/native contracts still advertise it, or adopting an MPL/other candidate without the required policy decision.
Activity
seonghobae commentedon Sep 1, 2026
Canonical implementation ownership should stay in the existing #781 Resource Admission & Decode vertical, currently PR #985 (
feat/canonical-audio-resource-policy-781), rather than spawning another decoder micro-PR.Fresh code review confirms the compliance defect is broader than the direct
soundfiledeclaration: protected/current #985 production decoding still reacheslibrosa.loadfrom temporal analysis, stem separation, and bass transcription, while the metadata preflight directly usessoundfile.infowithaudioreadfallback. Removing only the directsoundfileline therefore cannot prove libsndfile is absent from packaged/runtime inputs.Replacement decision boundary:
audioread→ffmpeg/GStreamer as a hidden workaround; it changes neither the requirement for exact native/transitive license provenance nor the supported-path acceptance contract.Resource Admission & DecodeRust port using Windows Media Foundation and macOS AVFoundation on the product's mandatory Windows/macOS targets, exposed to Python only through a bounded typed adapter. Keep DSP/math ownership separate from the existingbandscope_numericcrate. This route still requires exact SDK/binding provenance and real Windows/macOS decode parity/resource evidence before licensing: replace bundled libsndfile LGPL runtime path #1129 can close.Acceptance for #985/#1129 must remove libsndfile from the actual lock/build/package/SBOM/release graph, route metadata probe and PCM decode through the same admitted decoder authority, preserve WAV/MP3/FLAC/M4A behavior unless the product owner explicitly changes the format contract, and exercise rights-safe real fixtures on mandatory Windows/macOS lanes. No predecessor checks/reviews transfer after that branch changes.
seonghobae commentedon Sep 2, 2026
Fresh single-writer reconciliation: live PR state now identifies #866 (
fix/audio-resource-policy-781@3a76907dd3df603cc65188fa6d5c97d583f744e4) as the canonical #781 Resource Admission & Decode implementation owner. #985 remains Draft preservation/reference work because its compressed-container M4A fallback and alternate error contract still contain unique behavior not yet transferred; it is not a second canonical writer and must not be closed until that behavior is reconstructed or explicitly retired with product/security evidence. Apply #1129’s libsndfile-removal work to #866/current semantic successor, preserving #985’s valid requirements without copying its path/subprocess authority blindly. The earlier comment naming #985 as canonical is therefore stale ownership metadata, not current implementation authority. No checks/reviews/approvals transfer between #985 and #866.seonghobae commentedon Sep 3, 2026
Fresh #1129 decoder-candidate triage, against canonical #866 exact head
c5cc94feda19f8c75504abab9731717963309932and live protecteddevelop@acdbea6344fe1231c39535b575f4de35e4c607c9:The implementation boundary is still unresolved, but the candidate set is now narrower and materially different from the earlier platform-API-only recommendation.
.mp3,.m4a/AAC,.aacand.opus-adjacent intake contract by itself, so adopting it alone would be a buyer-visible format regression rather than a transparent licensing: replace bundled libsndfile LGPL runtime path #1129 repair.Decision consequence: there is currently no evidenced option that is simultaneously (a) already organization-approved under the preferred permissive-license policy, (b) mature across the full advertised compressed-format surface, and (c) ready to replace the current
soundfile/librosagraph without real-audio/platform qualification. #1129 should therefore remain blocked on one explicit product/license decision, while engineering can prepare evidence without changing the supported-format contract:Until one of those decisions is accepted, keep #866 as the single Resource Admission & Decode owner, keep #985 open as preservation evidence for the unsuperseded M4A behavior, and do not add a new decoder micro-PR. A technical spike must live in the canonical owner/successor, remain Draft, and must not remove
soundfile/librosaor alter public format claims until the replacement proves exact lock/build/package/SBOM absence of libsndfile plus real decoded-audio parity.seonghobae commentedon Sep 7, 2026
Fresh commercial decoder gate on 2026-09-07:
6011294fca3fb40e02dad06782a8dcfe6060b291; protecteddevelopis314ddeae7b775a4957594b599358c8255617eb2e. Earlier comments naming old fix(audio): establish canonical local-audio resource policy #866/feat(analysis): enforce one canonical audio resource policy (#781) #985 heads are historical only.a3ac980f1e2049c7ad5ebc03d82f3190fdec9e2cstill installedsoundfile==0.13.1,librosa==0.11.0, andaudioread==3.1.0from the frozen analysis dependency graph. That is direct current evidence that licensing: replace bundled libsndfile LGPL runtime path #1129 has not been accidentally solved by later protected workflow/dependency work.https://github.com/pdeljanov/Symphonia); RustAudio/audrey remains MIT/Apache-2.0 but only covers FLAC/Ogg Vorbis/WAV/ALAC-in-CAF (https://github.com/RustAudio/audrey); OxideAV remains MIT/pure Rust but its current workspace still reports Vorbis decode around 86% and Opus around 95%, so it is not yet evidenced as a drop-in release-parity replacement (https://github.com/OxideAV/oxideav-workspace).Therefore the commercial blocker is still an explicit product/license choice, not missing implementation effort that should be guessed by the writer: approve bounded MPL-2.0 Symphonia qualification; approve an OxideAV hardening/qualification path without release claims until real-audio/platform parity is proven; or explicitly reduce the supported-format contract. Until that decision exists, do not remove
soundfile/librosa, alter advertised formats, or create a parallel decoder PR. Engineering evidence belongs in #866/current successor; #985 stays open only for unsuperseded M4A behavior.seonghobae commentedon Sep 11, 2026
Fresh commercial-decoder research narrows the preferred technical spike without selecting a license policy on assumption.
Candidate: OS-native decode backend behind BandScope's existing Resource Admission contract. Keep #866 as descriptor/byte/resource authority, then hand only an already-admitted source to target-specific native decoders; return bounded PCM + source metadata into the Rust-owned deterministic resample/MIR path. Do not let the decoder backend become a second admission authority.
Primary evidence checked 2026-09-11:
.m4asources and the AAC/MP3 decoders: https://learn.microsoft.com/en-us/windows/win32/medfound/supported-media-formats-in-media-foundationwindows-rsis Microsoft's Rust binding family and the upstream repository carries MIT and Apache-2.0 license files; use focused/generated bindings rather than a broad umbrella dependency if this path is implemented: https://github.com/microsoft/windows-rsobjc2-audio-toolbox), but its exact selected feature/transitive license graph must be captured from the pinned release before admission; do not treat binding availability as legal approval: https://docs.rs/objc2-audio-toolbox/latest/objc2_audio_toolbox/Why this is preferable to the current fallback: it can remove the bundled libsndfile runtime rather than hide it, keeps decode in-process under OS-owned codec implementations, avoids
audioreadsubprocess/path widening, and supports platform-realistic M4A/AAC. It also preserves the option to keep deterministic resampling, channel policy and MIR calculations in BandScope-owned Rust.Required RED/acceptance before adoption:
NativeAudioDecoderport with Windows Media Foundation and macOS AudioToolbox adapters. The domain port must expose source sample rate/channel count/frame count or duration before transformed PCM becomes authoritative.soundfile/libsndfile frompyproject/lock/build/package/SBOM and prove absence in packaged Windows/macOS artifacts. Keep feat(analysis): enforce one canonical audio resource policy (#781) #985 open until the M4A preservation requirement is demonstrated by this successor or the product format contract is explicitly changed.This is a candidate architecture/RED contract, not an Accepted ADR and not evidence that the current package is commercially clear.
seonghobae commentedon Sep 12, 2026
Fresh primary-platform research narrows the native replacement candidate without making a licensing/policy acceptance claim.
Windows / Media Foundation. Microsoft’s current Media Foundation format documentation states that the native MPEG-4 file source handles
.m4a,.m4v,.mov, and.mp4, and that the native AAC decoder is available from Windows 7 onward. The dedicated MPEG-4 support page also lists the AAC Decoder and MPEG-4 File Source as in-box Media Foundation components. This makes a Windows Media Foundation adapter a technically credible candidate for advertised M4A/AAC intake without bundling libsndfile, subject to exact byte-stream/resource and packaging tests.Primary references:
macOS / Audio Toolbox. Apple’s current Audio Toolbox API documents first-class
kAudioFileM4AType,kAudioFileMPEG4Type,kAudioFileMP3Type,kAudioFileWAVEType, andkAudioFileFLACTypefile types, plus AAC decoding/encoding APIs. Audio Format Services exposes installed decoder discovery (kAudioFormatProperty_Decoders) and Audio File properties expose file/data format metadata. This makes Audio Toolbox a technically credible macOS candidate for descriptor/stream-oriented metadata admission + decode rather than an externalaudioreadsubprocess/path fallback.Primary references:
This evidence does not settle the organization’s legal/inbound-license policy and does not by itself prove BandScope parity. Keep #1129 open. The next implementation/research boundary should compare a thin Rust-owned platform adapter pair (Media Foundation / Audio Toolbox) against the existing #866 contract with the same rights-cleared WAV/MP3/FLAC/M4A corpus: original-container metadata before transform, bounded byte/resource admission, duration/sample-rate/channel limits, deterministic PCM/resample handoff, malformed/truncated container fail-closed behavior, and Windows/macOS package/SBOM evidence. Prefer byte-stream/descriptor APIs where the platform allows them; any unavoidable filesystem path needs the existing app-owned publication/content-identity invariant rather than widening authority. Do not remove
soundfile/libsndfile until that RED→GREEN parity and actual package-graph removal are proven.