# Project Guidelines — ACE Music Studio Working notes for AI assistants editing this repo. This file is the *what & why* — the locked architecture, the gotchas, the sole-author rule. Companion to `SKILLS.md` (the *how* — process, debugging, deployment workflow) and `AGENTS.md` (tool-agnostic version of this file). --- ## ⚠ Sole-author rule (non-negotiable) **Mayank Gupta is the sole author on every commit in this repo.** No exceptions. When committing: - **NO** `Co-Authored-By: Claude…` (or any agent name) trailer. - **NO** "Generated with Claude Code" / "🤖 Generated with…" footers. - **NO** `--author=…` flag — let git use the user's configured identity. - **NO** attribution in PR descriptions. If asked to amend, re-commit, or rebase, strip any prior agent attribution from the commit message. Treat any tooling that suggests adding a Claude trailer as a bug to ignore. --- ## Architecture facts (locked — do not relitigate) Spec: `docs/superpowers/specs/2026-05-18-ace-music-studio-design.md` Plan: `docs/superpowers/plans/2026-05-18-ace-music-studio.md` 1. **Backend is ACE-Step 1.5 XL SFT** — not ComfyUI. Installed from git (the package isn't on PyPI). The upstream repo is `git+https://github.com/ace-step/ACE-Step-1.5.git`; the Apple Silicon fork is `git+https://github.com/clockworksquirrel/ace-step-apple-silicon.git`. 2. **Five tabs.** Generate, Cover, Extend, Edit, Lyrics. Progressive disclosure — defaults stay short and reveal advanced controls only when asked. 3. **One pipeline instance.** Single ACE-Step pipeline; mode handlers (generate / cover / extend / edit) call different pipeline entry points. No re-instantiation between calls. 4. **`@spaces.GPU` is applied at module load time.** Identity decorator off Spaces. The decorator's `duration=` parameter takes a callable that estimates per-call timeout from `(mode, params, multiplier)`. Estimator clamps at `[60, 300] s`. 5. **Qwen 2.5 7B handles lyrics generation.** Text-only inference; full multimodal weights are NOT required. On Mac the MLX path is used via mlx-lm. 6. **HF cache → `./models//` symlink.** ACE-Step looks for files at `local_model_path/...`. `app._bootstrap()` symlinks every cached snapshot into `./models///` so the preload weights are findable. On Spaces, the build-user-owned `~/.cache/huggingface/hub` is mirrored to runtime-writable `~/hf-cache-rw/` first, then symlinked. 7. **One Gradio process. Lazy backend singleton.** `get_backend()` constructs the pipeline on the first request (~30–60 s warm-up). Module import is fast. --- ## Gotchas we already paid for (don't re-discover) Each of these cost a debug cycle. Read once. ### MPS / Apple Silicon - `torch.mps` has no `mem_get_info`. Any VRAM-gate that calls that method raises AttributeError. **Fix:** `vram_limit_for("mps")` returns `None` so the gate short-circuits. - Several ops aren't implemented on the MPS backend (SDPA variants, some index ops). `app.py` sets `PYTORCH_ENABLE_MPS_FALLBACK=1` so they degrade to CPU instead of crashing. ### ACE-Step gotchas TBD as discovered during M1+ implementation. Record new ones here as they come up. ### Dependency footguns - `ace-step` is NOT on PyPI. Install from git (see `requirements.txt`). - Don't pin `spaces` in `requirements.txt`. HF Spaces' ZeroGPU build injects its own version. A pin causes pip-resolve failure. - `transformers >= 5` may break imports. **Pin:** `transformers>=4.45,<5.0`. ### Gradio 6.14 quirks - Running version is `gradio>=6.14,<7`. `requirements.txt` reflects this; HF Spaces `sdk_version: 6.14.0` matches. - Don't put `