1. 09 Aug, 2026 1 commit
    • Aryan Noshirvnai's avatar
      Harden backend, add permanent identification cache, self-bootstrapping deploy · 92a8a0e4
      Aryan Noshirvnai authored
      - Extract auth/storage into src/core/security.py and src/services/storage.py,
        scope library/discovery/social routes to the authenticated user
      - Add IdentifiedTrack cache table keyed by audio fingerprint so repeat uploads
        of the same song skip Shazam/AcoustID/Gemini identification entirely;
        enable sqlite WAL mode so cache reads don't stall behind unrelated writes
      - Add Alembic migrations (baseline schema + identified_tracks)
      - Add pytest-mock to requirements.txt - was missing despite being used
        throughout the existing test suite via the mocker fixture
      - Rewrite deploy/scripts/deploy.sh to self-bootstrap a bare prod server
        (system packages, repo clone, venv, .env from CI-supplied secrets,
        systemd unit sync) and restart services on every deploy
      - Add .gitlab-ci.yml: test stage runs on dev/main pushes, deploy_prod runs
        only on main and SSHes into prod to trigger deploy.sh
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      92a8a0e4
  2. 06 Aug, 2026 1 commit
    • Aryan Noshirvani's avatar
      Replace hardcoded-password docs auth with HTTP Basic + custom console · 3c11a7b4
      Aryan Noshirvani authored
      Ports the same fix already tested and running on dev to main:
      - Removes the hardcoded plaintext admin/stax123 cookie-login flow and
        its fixed "valid_token_xyz" session-bypass cookie, replacing it with
        standard HTTP Basic Auth on /docs and /openapi.json, credentials
        from DOCS_USERNAME/DOCS_PASSWORD env vars (secrets.compare_digest).
      - Replaces stock Swagger UI with the custom branded console (dark/neon
        theme matching the Flutter app), minus the AI Remix panel - main
        doesn't have the /remix router, so that panel would just point at a
        404. Kept the Tag & Identify panel (main's /music/upload is real)
        and the generic OpenAPI-driven endpoint explorer.
      
      Tested locally end-to-end before this commit: full test suite 21/21
      green, and manually verified on a scratch port (401 with no
      credentials, 200 with correct ones, console renders without the
      remix panel, /openapi.json lists main's actual routes).
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_01BCxXmJVvDFJVHTUi4QgNzi
      3c11a7b4
  3. 04 Aug, 2026 2 commits
    • Aryan Noshirvani's avatar
      Fix import paths and service unit for relocated telegram_bot · be7e5940
      Aryan Noshirvani authored
      The previous commit moved bot.py/ai_remix.py into src/telegram_bot/ but
      missed staging the import-path fixes inside them, and the ExecStart in
      stax_bot.service still pointed at the pre-reorg antigrav-stax-audio
      path. Both were edited in the working tree already; this just gets them
      into the commit.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_01BCxXmJVvDFJVHTUi4QgNzi
      be7e5940
    • Aryan Noshirvani's avatar
      Reorganize into a modular src/ layout, remove dead legacy files · eef79169
      Aryan Noshirvani authored
      - Delete 18 files fully superseded by src/ (api_new/prod/remote*.py,
        root config/database/audio_processing/music_identification/
        telegram_auth/telegram_sync/social.py duplicates, broken patch_*.py
        and update_database.py debug scripts that reference a nonexistent
        Mac path, dead test_api.py/test_gradio.py, and the redundant
        stax_bot.tar.gz backup of the same dead files)
      - Relocate bot.py + ai_remix.py into a new src/telegram_bot/ package
        and fix their imports to use src.core/src.services (the Telegram
        bot isn't wired into the live FastAPI app, but it's real unshipped
        functionality, not cruft - kept it, not deleted it)
      - Move one-off dev scripts (list_models.py, build_loops.py, and the
        manual smoke scripts test_mb.py/test_mutagen.py) into scripts/,
        renaming the smoke scripts so pytest's default test_*.py discovery
        never sweeps them up outside tests/
      - Fold the misplaced-but-real test_social.py into tests/ (6 passing
        tests that weren't part of the actual suite)
      - Move stax_bot.service into deploy/systemd/ and fix its ExecStart
        (was pointing at a nonexistent telegram_client.py under a stale
        antigrav-stax-audio path)
      - Add .gitignore; untrack .env going forward (secrets remain in prior
        history - flagged separately, not rewritten here)
      - Rewrite README.md and setup.sh, which described/depended on the old
        flat api.py/bot.py architecture and the deleted tarball
      
      Full suite: 21/21 passing (up from 15 - gained test_social.py's 6).
      Live stax_backend service on this host untouched: same src/api/main.py
      entrypoint, same .env/stax.db on disk, still responding through the
      reorg.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_01BCxXmJVvDFJVHTUi4QgNzi
      eef79169
  4. 02 Aug, 2026 4 commits
  5. 01 Aug, 2026 19 commits