fix(audio): establish canonical local-audio resource policy - #866
fix(audio): establish canonical local-audio resource policy#866seonghobae wants to merge 88 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@opencode-agent Take the canonical #781 owner lane on the existing First repair the exact current-head CI blocker with repository-pinned tooling, not guessed formatting: CI run Then, on the resulting exact head, preserve the unique non-duplicative #781 evidence currently stranded in competing PR #985 (
Run focused RED→GREEN tests, repository-pinned Ruff check/format, Bandit, mypy where applicable, then canonical quickcheck. If a finding belongs to #865 or #783 rather than this exact branch, prove the first causal boundary and leave it with its owner rather than adding a leaf workaround. Commit only to this branch and report resulting exact head and evidence. |
|
@OpenCode repair exact head |
|
@opencode-agent Please review the current exact PR head |
# Conflicts: # CHANGELOG.md
|
Exact-head maintenance update for 505a595:
Keep Draft; predecessor evidence does not transfer. |
|
@opencode-agent review\n\nReview only current PR head 505a595 against protected develop base 749511c. Revalidate the canonical local-audio resource policy, source metadata preflight before decode, post-decode limits, empty-layout chord handling, payload-safe diagnostics, exact tests, and current security checks. Do not reuse predecessor-head evidence or provider-unavailable results. |
|
Queued @opencode-agent for PR #866 at head |
|
Canonicalization note (2026-08-30): this draft covers the same Issue #781 audio-resource-policy Gap as #985. The maintained successor is #985, now carrying the shared encoded/decoded admission policy and the current fail-closed numeric-metadata fix at head |
Buyer/security gap
Advances #781 by making local-audio resource admission one versioned policy before expensive decode, resampling, downmixing, transcription, separation, or downstream analysis. The 100 MiB encoded-byte ceiling remains shared across native local-file/YouTube bootstrap, the desktop bridge, Python request/decode admission, and YouTube download admission.
Exact current identity and ownership
develop@acdbea6344fe1231c39535b575f4de35e4c607c9.c2cc5bbeda6628fa9999401d6b0d228cb9b6bb9c.fix/audio-resource-policy-781.faf565d92d464de8edb968ee123e6e953eb1b5d6, which must integrate into protecteddevelopfirst.Implemented policy-v1 boundary
AudioResourcePolicyowns the 100 MiB encoded ceiling, target rate, decoded duration/sample/memory ceilings, numeric validation, and inclusive source-container bounds of 8 kHz–192 kHz and mono/stereo.preflight_audio_metadata()readssoundfile.info()from the already-open caller-owned handle, rejects malformed/overlong/unsupported source metadata before transformation, and rewinds the handle for the decoder. It does not open paths, follow URLs, or decode PCM.TemporalAnalyzer,AudioStemSeparator, and bass transcription run that preflight beforelibrosa.load(..., sr=..., mono=True, duration=...); decoded output is then revalidated before beat tracking, pYIN, or Demucs/model work.analysis.tsretain filesystem-observed/request metadata byte admission for local-file and YouTube bootstrap. YouTube additionally rejects announced oversize before download, usesmax_filesizeand an in-flight progress abort, removes only owned in-directory partials, and canonicalizes completed paths before cleanup or success.Security Notes
librosa.loadin all three consumers, decoded/model-output failures, empty-array shape invariance, and owned YouTube cleanup.Exact-current-head verification
Local verification ran on exact head
c2cc5bbeda6628fa9999401d6b0d228cb9b6bb9c:./scripts/harness/quickcheck.sh— passed documentation/security/supply-chain/bootstrap checks, ESLint, ruff/format, Bandit, mypy, desktop 198/198 with 100% coverage, shared-types 20/20 with 100% coverage, Python 761 passed/24 skipped with 100.00% coverage, and Vite build.git diff --checkand all local harness checks passed. The macOS Demucs subprocess emitted an existing native worker segmentation-fault log during fallback coverage, but the harness completed successfully with exit 0; this is recorded as platform evidence, not claimed as a clean accelerator run.Fresh hosted checks for this exact head are queued or still running, including CodeQL, OpenCode Review, Required Noema Review, PR Review Merge Scheduler, and close-empty workflow jobs. Queued, skipped-required, failed, stale-head, predecessor, draft-skipped, model-only, self/author, or administrative evidence is not passing evidence. No qualifying independent non-author last-push approval is present; the old Cursor
CHANGES_REQUESTEDreview state is not transferred as a current-source finding, and the current review thread inventory has zero unresolved threads.Remaining #781 / merge boundary
Keep Draft and unmerged until #865 integrates, this stack is reconstructed on the resulting protected
develop, and one unchanged exact head has terminal-success required CI/security/SAST/SBOM/supply-chain/package/release/central-review gates, native/Rust and applicable CPU/GPU evidence, exact owned statement/branch coverage and docstrings/rustdoc, zero valid unresolved findings, and a qualifying independent approval. Remaining work includes explicit per-job CPU/GPU/VRAM admission budgets, cancellation/resource measurements, and realistic whole-product CPU/GPU numerical/performance parity evidence. Do not infer completion from local proof,MERGEABLE, Ready state, or auto-merge.Repository ownership boundaries
nanoid/pdfjs-dist/undicidependency-security baseline..githubremains the authority for hosted review/coverage tooling; no local workaround or repeated unchanged dispatch replaces it.Latest exact-head maintenance
Current head: 505a595. Protected base: develop@749511c3ad4000090048718f685c6bee6b3d2c25.
Merged current origin/develop through ordinary merge commit b4a3513; the only conflict was CHANGELOG.md and both canonical audio-policy and current develop entries were retained. Exact-code review confirmed source-container metadata preflight is already wired before temporal, stem-separation, and bass-transcription decode; no duplicate policy authority was added.
Fixed the remaining valid canonical-lane defect: ChordRecognizer now uses zero-element shape-invariant y.size, with regressions for (0, 2) and (2, 0) layouts.
Local exact-head verification: 783 Python tests passed and 24 numeric-parity tests were skipped by platform policy; production statements/branches/functions/lines are each 100%. Ruff check, Ruff format check, mypy, and Bandit passed. No dependency, lockfile, workflow, model, network, filesystem, IPC, or reviewer-credential authority changed beyond the ordinary develop merge and this focused chord guard.
Keep Draft and do not transfer predecessor-head evidence.