Date: 2026-03-18 12:03 Model: Gemini 3 Pro (Preview) Type: challenge Artifact: ## Cloud Download Brief (Draft) ### Problem Cloud tracks in MixBoard playlists cannot be exported t
Here is a devil's advocate critique of the Cloud Download Brief.
You have framed this primarily as a "Download" feature with a goal of persistent storage ("Track model update"). I argue this is the wrong mental model for v1 and actually increases risk.
The premise risk: If you mark a cloud track as "downloaded" and update its filePath in SwiftData, the user (and the app) now treats it as a local file.
filePath is dead.Track state back to cloud-only.Alternative Framing: Treat this as Just-In-Time (JIT) Staging, not Library Downloading.
Track model permanently.This avoids the complex state management of "Hybrid" tracks (Cloud but Local) and side-steps the entire persistence question until Phase 2.
The brief notes a massive tension: "ChadTrack is a transient Codable struct... while Export flow works with Playlist -> Track (SwiftData)."
You identified the risk, but you didn't identify the blocking implication.
Track objects. You cannot attach a file path to a ChadTrack struct and expect it to work with the existing MixExporter logic that likely iterates over Track entities.Track) that might not even exist for the items the user wants to export.Required Verification: You must confirm if a ChadTrack is converted into a Track entity when added to a playlist. If not, the entire Exporter architecture needs refactoring to accept ChadTrack + URL tuples, not just Track objects.
ChadMusicAPIClient.streamURL(for:): You mention the user constructs an HTTP URL via this method.
DownloadService will fail with 403 Forbidden.Track @Model: You cite isCloud, cloudStreamPath, and cloudTrackId fields.
Track model. If Track was designed purely for local files (implied by the original limitation), these fields might be theoretical or missing.The brief suggests "Track model update — store cached file path so downloaded files persist across sessions."
Challenge: This significantly expands the scope from "Export" to "Offline Mode." If you persist the path:
Recommendation: Reject persistence for this slice. Download ONLY for the duration of the export.
The brief mentions: "File naming: use server path structure, or flatten to trackId/filename?"
The Risk: Using server path structures blindly is a security vulnerability (Path Traversal). If the server dictates the filename and sends ../../etc/passwd, you have a problem.
Better approach: Always generate a flattened, sanitized filename specifically for the export folder (e.g., UUID + extension). Do not trust the server's filename structure.
No specific blocking hallucinations found, but strict verification of the Track model schema is required.