- 22 Aug, 2026 3 commits
-
-
Aryan Noshirvnai authored
songs_info already skipped a fresh identify_audio() call for library-sourced songs (using the already-known title/artist directly), but dropped genre even though LibrarySong has it. Genre is now threaded through into plan_remix's Gemini prompt as an explicit hint per song - one more piece of already-verified metadata informing the arrangement, on top of the real audio preview and detected BPM/key it already used. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
GET /discovery/history now matches each hit against the caller's own library (title+artist, case-insensitive) and includes library_song_id when found - computed live on every read rather than persisted, so it stays correct if the library changes later (a song added after the hit, or later deleted) instead of going stale like a stored link would. POST /library/search is now a real universal search: songs (existing title/artist/genre match) plus albums, a derived (album, artist) grouping of the caller's own songs - there's no separate Album table, so an album only appears when it has a name and at least one matching song. Albums match on album name or artist, not song title, so searching one track doesn't surface an unrelated album. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
GET /soundmarks/reverse-geocode?lat=&lon= mirrors the existing forward /geocode proxy (same Nominatim server-side-proxy reasoning, same business_admin+ gate) but for coordinates -> address instead of address -> coordinates. Lets the location picker pre-fill its search field from the browser's own location instead of just placing a pin with no readable address next to it. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
- 19 Aug, 2026 1 commit
-
-
Aryan Noshirvnai authored
New foundation for scanning a whole chat instead of one song at a time: ApprovedChat (opt a chat in) and ChatScanJob (a background job that lists a chat's music, then downloads+identifies+tags+saves each song via the same pipeline /music/tag already uses per song). Mirrors RemixJob's proven pattern - a status column + BackgroundTasks, no new task-queue infrastructure - rather than inventing a new one. Deliberately on-demand (user approves a chat, then triggers one scan) rather than automatic background polling, which needs a materially different architecture (persistent per-user Telegram connections or a scheduler) not worth building until on-demand proves out the feature. Guardrails baked in from the start rather than bolted on later: a 50-message cap per scan, a 5-scans/day per-user cap, no two concurrent scans of the same chat, and a 1.5s pause between songs so a scan reads like a real user, not a script hammering Telegram/AcoustID/Gemini. Per-song outcomes (saved/skipped_duplicate/failed) are tracked individually in results_json, not just one pass/fail for the whole job. _identify_tag_and_store's request param is now optional so the background job can call it without a live HTTP request in scope - same reasoning as RemixJob storing a bare filename instead of a full URL. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
- 18 Aug, 2026 4 commits
-
-
Aryan Noshirvnai authored
get_chat_music() called search_messages(filter="audio") - a plain string - but Pyrogram's filter param is a MessagesFilter enum and internally reads filter.value, so every chat scan crashed the moment a user tapped a chat. Use MessagesFilter.AUDIO instead. Added a unit test that mocks pyrogram.Client and asserts the exact enum is passed, since the existing router tests only mocked get_chat_music() itself and never exercised this line. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Accounts with a Telegram cloud password enabled couldn't link at all - sign_in() raised SessionPasswordNeeded and the endpoint surfaced it as a generic 400. /auth/telegram/login now returns 412 in that case (not 401, so apiFetch's access-token-refresh retry doesn't swallow it), and a new /auth/telegram/password endpoint finishes the same in-progress Pyrogram auth session with the password, via a shared _link_telegram_session helper so both paths attach to the caller identically. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
It was documented as an account-linking flow (attach a Telegram session to the already-logged-in user) but the code never changed to match - it still created/looked up a *separate* User row keyed by Telegram's own numeric user_id and issued that identity a fresh token pair, same as the old Telegram-is-the-login design it was supposed to replace. Silently pointless: nothing actually got linked to whoever was logged in. Now requires an authenticated caller and attaches telegram_session_string + phone_number directly to current_user, no new tokens issued (the caller already has valid ones). Returns 409 if that Telegram account is already linked to a different Stax user. Found and fixed while helping the user actually test the chat-scanning feature against their real account. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
DELETE /library/{id} - removes a song, its file on disk, and any PlaylistTrack rows pointing at it (owner-scoped). DELETE /playlists/{id} - removes a playlist and its tracks (owner-scoped). DELETE /playlists/{id}/tracks/{song_id} - removes one track from a playlist without deleting the song itself (owner-scoped). Also adds rate limiting to POST /discovery/listen (20 identify calls per user per 10 minutes, new DiscoveryAttempt table + migration 9f6585c71f80) - each call is a real, billable Shazam + AcoustID request and was previously uncapped. Counts every attempt, not just successful ones (a failed identification still costs the same external API call, and only successful ones create a DiscoveredSong row). Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
- 16 Aug, 2026 2 commits
-
-
Aryan Noshirvnai authored
Username/password login had zero rate limiting since it shipped - unlimited guesses against any account from anywhere. Adds a username column to the existing AuthAttempt table (migration d22ca64d291e) and reuses the same DB-backed approach already protecting /auth/telegram/request_code: 10 attempts per account per 15 minutes, 100 per source per hour. Kept independent of the Telegram rate limit despite sharing a table - both _check_rate_limit and the new _check_login_rate_limit filter on their own column (phone_number.isnot(None) / username.isnot(None)) so hammering one endpoint never burns the other's budget. Verified live: 10 wrong-password attempts succeed with 401, the 11th (even with the correct password) gets 429; a telegram request_code call immediately after is unaffected. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
The existing playlist endpoints (list, create, add-track) had no way to actually view what's in a playlist - GET /playlists only returns the playlist rows themselves, not their tracks. Joins PlaylistTrack to LibrarySong, ordered by track order, scoped to the owner. Needed to build a real Playlist UI on the frontend (playlists have had a working backend with zero UI since they were added). Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
- 15 Aug, 2026 8 commits
-
-
Aryan Noshirvnai authored
Every stream endpoint (library, soundmarks, posts, live-location, rooms) only accepted the access token via an Authorization header - fine for apiFetch, but <audio src="..."> can't send custom headers, so the frontend was fetching the entire file as a blob before playback could even start (no progressive playback, no seeking). Added get_current_user_for_stream, which accepts the token as a ?token= query param too (same reasoning as the Rooms websocket fix), and switched all five stream endpoints to it. FileResponse already supports Range requests natively, so a direct <audio src> now gets real 206 Partial Content responses - confirmed live (curl -H "Range: ..." against /library/stream/1?token=...). Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
POST /remix and GET /remix/{job_id} previously had no authentication at all - user_id was a raw client-supplied form field, and job status was fetchable by guessing sequential ids (IDOR). Both endpoints now require a logged-in user; RemixJob gets a new user_id column (migration 347da5d41656) so job status is scoped to its owner. Also closed an adjacent IDOR found while fixing this: library_song_ids sourcing now scopes to the caller's own library, not any song id. WS /social/rooms/{room_id}/ws took user_id as an unauthenticated query param - anyone could connect claiming to be any user. It now takes a JWT access token instead (browsers can't set WS headers, so it travels as a query param) and verifies it - signature, expiry, real user row - before accepting the connection. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Adds POST /auth/register and POST /auth/login (username/password, PBKDF2-hashed stdlib-only, no new dependency). The former phone/code Telegram flow moves to /auth/telegram/{request_code,login,chats,chats/{id}/music} - it now links a Telegram account (for the chat-scanning music-tagging feature) to an already-authenticated user rather than being the identity mechanism itself. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
GeoDrop was a one-off "drop a song at this exact point" pin, permanent once created. Redesigning it as a live broadcast instead: one row per user, continuously overwritten as their position and currently-playing song change, so nearby people see what you're listening to right now, not a static pin you left once. - LiveLocation model: unique per user_id, upserted on every meaningful location/song change plus a periodic heartbeat while sharing is on. - PUT /social/live-location - upsert (song_id nullable: sharing your position doesn't require actively playing something). - DELETE /social/live-location - stop sharing. - GET /social/live-location/nearby - other users' live positions within a radius, self-excluded, enriched with song/username, sorted by distance. Filters out anything not updated in the last 5 minutes (LIVE_LOCATION_STALE_AFTER) - there's no reliable way for a closing browser tab to notify the server with an authenticated request, so staleness expiry is the actual "they stopped sharing" mechanism, not a clean disconnect signal. - GET /social/live-location/{user_id}/stream - stream whatever a nearby user is currently playing, same cross-user reasoning as the other social stream endpoints. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
A post's song_id isn't necessarily the poster's own library song, so playing it needed the same not-scoped-to-caller stream endpoint pattern already used for rooms, geo-drops, and soundmarks. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Posts and GeoDrop only ever returned bare song_id/user_id, had no way to browse posts at all (only create one or fetch one specific post's remix tree by id), and let you create a post/drop referencing a nonexistent song_id with no validation. - GET /social/posts: recent top-level posts (remixes nest under their parent via the existing tree endpoint instead), with a remix_count so the frontend doesn't need a second call to know if a post has replies. - Post/GeoDrop responses now include full song metadata (title/artist/album/coverart) and the author's username. - create_post/create_geo_drop now 404 if the song (or, for remixes, the parent post) doesn't exist instead of silently creating a dangling row. - GET /social/geo-drop/{id}/stream: stream a dropped song regardless of who uploaded it, mirroring /soundmarks/{id}/stream and /social/rooms/{id}/stream's same reasoning - the whole point of a drop is someone else finding and playing it. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Every route in this router trusted a client-supplied user_id/owner_id instead of deriving it from the JWT like every other router in the app (soundmarks, social, discovery, library all use get_current_user) - any caller could create a channel as any user, follow/unfollow as any user, or post vibe-sets/stories/showcases as any user by just changing a number in the request body. Also none of the routes required auth at all, including plain reads. Adds get_current_user to every route and derives the caller's identity from current_user.id instead, removing the now-redundant id fields from every request schema. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Rooms could already chat, react, and request/pass the aux, but nobody could actually hear anything - now_playing only ever broadcast a bare song_id, there was no way to stream a song you didn't upload yourself (the DJ's pick usually isn't the listener's own library song), and the DJ could set a nonexistent song_id with no validation. Adds full song metadata (title/artist/album/coverart) to both the snapshot and now_playing_changed broadcasts, validates the song exists before setting it, and adds GET /social/rooms/{id}/stream - mirrors /soundmarks/{id}/stream's same "shared social content, not scoped to the uploader" reasoning - so any room member can actually play what the DJ picked. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
- 12 Aug, 2026 3 commits
-
-
Aryan Noshirvnai authored
Adds a tier column (major/business/community) with tier-specific governance: major locations get a single super-admin-set anthem, businesses get an owner-managed playlist, community spots stay fully vote-driven. Adds a suggestion/review-queue system (SoundmarkSuggestion) for major and business tiers, scoped so business admins only see suggestions for soundmarks they own while super admins see everything. Migration backfills tier from the existing business_owner_id (owned -> business, unowned -> major) and seeds each business's playlist from its old single song_id so existing anthems aren't silently dropped. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Comments out the deploy_prod job (and the deploy stage) rather than deleting it - merges to main now only run tests, nothing gets pushed to the prod server automatically. Re-enable by uncommenting both when we're actually ready to cut a release. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Companion to the webapp's basicSsl dev server change (needed to fix the Geolocation API being blocked entirely on the old http:// dev origin - browsers require a secure context). Without this, the webapp's requests from https://144.76.210.145:5173 would get rejected by CORS even though geolocation itself would now work. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
- 11 Aug, 2026 3 commits
-
-
Aryan Noshirvnai authored
Previously /soundmarks/nearby only returned soundmarks that already had an active song, so a brand new soundmark (created by a super admin, no fallback song_id set, no proposals yet) was invisible to the Nearby page - there was no way for anyone to ever discover it and make the first proposal. Now it's included with song: null, and the webapp shows a "propose one" prompt instead of a play button for that case. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Users can now propose a song for any soundmark; the most-voted proposal is what actually plays there, not just an admin's original pick. One vote per (soundmark, user), movable between proposals. Directly setting a soundmark's song (business/super admin) now also seeds a proposal with the setter's own vote, so it competes fairly in the same ranking instead of being a separate, un-votable channel that a single stray vote could trivially override - and instead of silently losing to the crowd the moment anyone else proposes something. Soundmark.song_id remains as the fallback used only while a soundmark has zero proposals. /soundmarks/nearby and /soundmarks/{id}/stream now resolve through the same popularity logic, so a soundmark that only has user proposals (no admin-set song_id at all) is discoverable and streamable too, not just admin-seeded ones. Also added GET /soundmarks/geocode, a server-side proxy to OpenStreetMap's free Nominatim geocoder for the webapp's upcoming location-picker autocomplete - proxied because Nominatim's usage policy requires a real, identifying User-Agent header, which browser JS can't set on a raw fetch(). 11 new tests (proposal creation/merging, vote-switching, popularity overriding the admin fallback, and the geocode proxy incl. failure handling) - 144 backend tests passing overall. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
New feature, distinct from the existing GeoDrop (any user dropping a song for others to find): a Soundmark is a curated anthem tied to a place. One with no owner is a super-admin-curated landmark; one with a business_owner_id is that business's location, and only its owner (or a super admin) can change its anthem. - User.role ("user" | "business_admin" | "super_admin") plus get_current_business_admin / get_current_super_admin dependencies. Super admin passes both checks - same privileges, elevated. - New soundmarks router: nearby detection (haversine against each soundmark's own trigger radius, not a caller-supplied search radius), cross-user anthem streaming (deliberately not scoped to the caller owning the underlying song, unlike /library/stream), business-owner song assignment, super-admin CRUD, a "public library" search across every user's songs (no such cross-user endpoint existed before - everything else is locked to the caller), and user role management (promote/demote, with owning a soundmark auto-promoting a plain user to business_admin so ownership isn't otherwise inaccessible to them). - GET /auth/me so the webapp can read the caller's role. 25 new tests covering role gating, ownership enforcement, cross-user song picking/streaming, and radius-based nearby matching. Promoted dev-test-user to super_admin for webapp testing. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
- 10 Aug, 2026 3 commits
-
-
Aryan Noshirvnai authored
Previously, re-uploading (or re-tagging from Telegram) a file already in your library created a brand new LibrarySong row and a second copy of the stored file every time - the IdentifiedTrack cache already skipped re-identifying it, but still re-ran ffmpeg tagging and wrote a duplicate file, and always inserted a new row. Add a fingerprint column to library_songs and check it (per-user) before doing any of that: a match now just hands back the existing entry. Dedup is per-user and keyed by the same content fingerprint already used for the IdentifiedTrack cache, not by title/artist text (which drifts across correction passes and isn't reliable for this). Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
The previous fix (permissive ffmpeg retry on CouldntDecodeError) never actually applied to this case - confirmed via the full traceback this time (added logger.exception in the prior commit, which paid off immediately): the failing file had a .mp3 extension, so it took the "already mp3, just copy" fast path entirely, skipping ffmpeg. The actual failure was mutagen.mp3.HeaderNotFoundError inside MP3(mp3_file_path, ID3=ID3) - a .mp3 extension doesn't guarantee mutagen's strict frame-sync scanner can parse the content. Now: if that direct-copy fast path produces something mutagen can't read, re-encode through the same permissive ffmpeg fallback (which sniffs actual content, not the extension) and retry once. If even that fails, raises the same AudioDecodeError as before for a clean user-facing message instead of a raw mutagen exception. Added tests/test_audio_processing.py with two real (not mocked) cases: real WAV audio misnamed as .mp3 (exercises the actual recovery path with real audio content) and pure random bytes (confirms genuinely unrecoverable input still fails cleanly via AudioDecodeError, not a raw exception). Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Confirmed from a real webapp upload (dev server log): a file Shazam successfully identified ("Invisible" by Duran Duran, despite the local AcoustID fingerprinter also struggling with the same file - symphonia's demuxer logged dozens of "skipping junk"/"invalid mpeg audio header" warnings but still recovered enough to match) then failed outright at the ffmpeg conversion step with "Can't sync to MPEG frame", killing the whole request with a 500 even though identification had already succeeded. This is exactly the "messy real-world MP3s" scenario the product is meant to handle, not an edge case worth ignoring. - audio_processing.py: on CouldntDecodeError from pydub's default (strict) ffmpeg invocation, retry once via a direct ffmpeg subprocess with -err_detect ignore_err -fflags +igndts+discardcorrupt, which tells ffmpeg to skip past bad frames instead of giving up. New AudioDecodeError is raised only if that also fails, distinct from a bare Exception so callers can show a clean message instead of raw ffmpeg stderr. - music.py: both /music/upload and /music/tag now catch AudioDecodeError specifically (422, clean user-facing message) and everything else via logger.exception + a generic 500 message - previously upload_direct did `raise HTTPException(500, detail=str(e))`, which is exactly the raw ffmpeg stderr the user saw rendered directly in the webapp's error banner, and logged nothing server-side for future diagnosis. Verified: full 104-test suite still passes, module imports cleanly, dev server restarted successfully. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
- 09 Aug, 2026 13 commits
-
-
Aryan Noshirvnai authored
Confirmed via job trace: echo "\$PROD_SSH_PRIVATE_KEY" > ~/.ssh/prod_deploy_key failed with "Read-only file system" writing to /root/.ssh. Moved the SSH key and known_hosts to /tmp instead - reliably writable regardless of a read-only root, unlike the home directory. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Per explicit instruction: remove any test that risks making CI take this long, not just the one already confirmed to hang. sidechain's shrink fix (sr=8000->400) tested fine locally, but this runner has proven wildly inconsistent - the exact same non-DSP pipeline ranged from 4 minutes to 40+ minutes stuck at unrelated steps across back-to-back identical runs. Not worth trusting a single local timing over that track record. Both DSP-heavy tests in this file are now CI-skipped; every other test file was checked and doesn't touch librosa/numba/scipy/pedalboard at all. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
The NUMBA_DISABLE_JIT fix from the last commit didn't fully cover this: librosa.feature.chroma_cqt compiles a numba @stencil kernel, and stencils ignore NUMBA_DISABLE_JIT entirely (unlike regular @jit) - confirmed via a live job trace (job 4275) that sat completely motionless for 40+ minutes mid-traceback, inside numba's own type-inference error-formatting code. librosa's resampling isn't the cause either - confirmed res_type defaults to soxr_hq (not the numba-based resampy backend) in this version. Skips this one test when CI=true (GitLab's own predefined variable) rather than continuing to chase what looks like a numba/llvmlite compiler bug specific to this runner's CPU. Still runs normally locally - verified both paths: skipped under CI=true, passes normally without it. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Confirmed via the GitLab API: pipeline 1023/1024's test job sat completely motionless for 40+ minutes with zero new output, stalled right where test_detect_key_returns_valid_structure would run - the one test exercising librosa.feature.chroma_cqt, which is numba-JIT-compiled (librosa.core.constantq imports numba's jit decorator, confirmed locally). numba's JIT cache never persists across CI runs (fresh container every job), so that compile cost is paid from scratch on every single push for a one-shot call that's never repeated in-process - zero benefit, and on this runner's CPU (already documented elsewhere in this codebase as lacking SSE3/SSE4/AVX) it appears to hang outright rather than just compile slowly. NUMBA_DISABLE_JIT=1 forces the pure-Python fallback - verified locally this costs nothing measurable (2.2s either way for a single detect_key call) and all 104 tests still pass. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
No CORS configuration existed at all - every fetch() from a browser-based frontend on a different origin (localhost:5173, or the dev server's own :5173) would have been silently blocked. Auth here is a Bearer token in localStorage, never a cookie, so allow_credentials isn't needed - origins are read from CORS_ORIGINS (comma-separated), defaulting to the webapp's known dev origins. Verified: OPTIONS preflight to /auth/request_code from http://144.76.210.145:5173 now gets a correct Access-Control-Allow-Origin response. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Confirmed via the GitLab API: the non-Docker test job (torch/demucs removed, cached static ffmpeg, sidechain test fixed) already ran successfully in 4m14s (pipeline 1016). A second run of the same setup spiked to 26 minutes due to runner contention unrelated to what's installed - the Docker Hub pre-baked image wouldn't reliably fix that either, so dropping that direction rather than adding a registry/visibility decision for marginal, inconsistent benefit. The revert to 9a952fea's .gitlab-ci.yml would have also reintroduced the already-fixed deploy_prod SSH key bug (chmod on raw key text instead of a written-out file) - confirmed via API that pipeline 1019's deploy_prod failed on exactly that. Re-applied that fix on top of the reverted test job. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Every push was paying apt-get + pip install + ffmpeg-download cost fresh, even with caching helping at the margins. Complete rewrite: Dockerfile.ci now bakes ffmpeg, libsndfile1, and the full requirements.txt into one image, built and pushed to Docker Hub by the manual build_ci_image job. The test job itself no longer does apt-get, pip install, or any download at all - it just pulls that image and runs pytest directly. Verified before pushing (no docker available locally to build-test with): every requirements.txt package that could plausibly need compilation (tgcrypto, pedalboard, pyrogram, shazamio/shazamio-core) has a prebuilt manylinux2014_x86_64/cp310 wheel, so no gcc/build-essential is needed in the image. Needs DOCKERHUB_USER + DOCKERHUB_TOKEN as CI/CD variables before build_ci_image can push anywhere - GitLab's own Container Registry isn't available on this instance (confirmed earlier), Docker Hub is (this runner already pulls python:3.10-slim from it successfully). Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
Confirmed from the job log - chmod failed with "unrecognized option '-----BEGIN OPENSSH PRIVATE KEY-----" because $PROD_SSH_PRIVATE_KEY expands to the raw key text, not a file path (which File-type CI/CD variables give you). Writing it to ~/.ssh/prod_deploy_key ourselves works regardless of which type the variable actually is, so this doesn't depend on getting that GitLab dropdown exactly right. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
deploy.sh installs every deploy/systemd/*.service file automatically. This one came in from the origin/dev merge targeting a different, unrelated deployment (/root/stax_backend_api-dev, port 8001, an HTTP_PROXY pointing at 127.0.0.1:8118 - leftover from the old Iran-server tunnel setup that's been explicitly retired). Deployed as-is it would just crash-loop against a working directory that doesn't exist on this prod box. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
python:3.10-slim has no xz binary by default (my local machine did, which is why this got missed) - tar shells out to it for .tar.xz decompression and failed with "xz: Cannot exec: No such file or directory". xz-utils is tiny with almost no dependency tree, unlike ffmpeg's, so this doesn't reintroduce the slowness being fixed. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
The Container Registry approach (build_ci_image) is reverted - confirmed via job log that $CI_REGISTRY is empty on this self-hosted instance (Container Registry isn't deployed here), so there was nowhere to push to. Root cause confirmed from an actual job log: apt-get install ffmpeg alone took 2min51s, unpacking/configuring 185 packages (video codecs, X11/Mesa/GL, fonts, speech-recognition libs) that this project never uses - it's audio- only. None of that is cacheable via apt itself. Fix: download John Van Sickle's static ffmpeg build (verified genuinely static via ldd - "not a dynamic executable", confirmed real mp3 encoding works at 278x realtime) instead of apt-installing it, and cache the binary itself via the existing cache: block so even the download only happens on the first run. git is also dropped from the apt install list - confirmed unused anywhere in app/test code (GitLab's own checkout doesn't use it). Verified locally: full 104-test suite passes with *only* this static binary on PATH (system ffmpeg hidden), matching what CI will have. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
apt-get install ffmpeg/git/libsndfile1 in the test job takes ~2m50s every single push (confirmed from a job log: ffmpeg drags in ~185 packages - video codecs, X11/Mesa/GL, fonts, speech-recognition libs - none of which this project uses), and none of it is cacheable the way pip's downloads are. This adds build_ci_image (when: manual, new "build" stage) which builds Dockerfile.ci and pushes it to this project's Container Registry. It does not touch the test job yet - purely additive, so if this runner turns out not to support Docker-in-Docker, nothing about the existing working pipeline changes. Once this job is confirmed to succeed, a follow-up commit switches test's image to the built one and drops its apt-get step. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-
Aryan Noshirvnai authored
CI's test job was installing torch + demucs (a neural net stem-separation model) on every single push even though nothing in the test suite calls the real separator - test_remix.py mocks render_remix_sync entirely, and remix_engine.py's own detect_key/sidechain/style-preset tests only need librosa/scipy/numpy/pedalboard, not torch. That's most of what was making the pipeline slow (torch alone is a large download+install, on top of the memory pressure that caused the earlier 5min stall). - src/services/remix_engine.py: `import torch` and the mkldnn tweak move from module level into _get_separator(), alongside the already-lazy demucs import. The module (and everything depending on it, like the /remix router) now imports cleanly with neither installed. - requirements.txt: demucs removed. numpy/scipy/librosa/soundfile/pedalboard stay - real libraries, but not the heavy part, and needed for the audio- math tests that do run in CI. - requirements-remix.txt (new): just demucs, install torch CPU-only before it. Only installed by deploy.sh (prod), never in CI. - .gitlab-ci.yml test job: drops the torch install step entirely. Verified locally: uninstalled torch+demucs from the dev venv, app still imports and all 104 tests still pass in ~3s. Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
-