AGENTS.md
This file provides guidance to coding agents when working with code in this repository.
Commands
CI (.github/workflows/ci.yml, ubuntu + macOS) runs exactly these:
cargo fmt -- --check
cargo clippy --locked --all-targets -- -D warnings
cargo test --locked
- Single test:
cargo test --test acp_integration <name>(or--lib <name>for unit tests insrc/). tests/live.rshits real Onde Cloud and silently skips unlessONDE_API_KEY=app-id:app-secretis set:ONDE_API_KEY=... cargo test --test live -- --nocapture.- Enable the tracked pre-commit hook (runs
cargo fmt --checkon staged.rsfiles) once per clone:git config core.hooksPath .githooks. - Run locally:
cargo run -- --setup(store API key), thencargo run(TUI) orcargo run -- --acp(ACP over stdio).SPLITFIRE_YOLO=1/--yoloskips permission prompts; logs go to stderr viaRUST_LOG.
Architecture
This crate holds only the music part of the agent. The ACP server, session/turn loop, approval, workspace tools (read_file, write_file, run_command, ...), terminal UI and MCP layer all come from the Onde Agent Platform crates (ed-acp, ed-acp-tui, ed-mcp, from the onde-ed workspace). Look there for anything protocol- or session-related; the README says it is checked out next to this repo.
src/profile.rs:SplitFireimplementsed_acp::Profile. It is the single wiring point: identity (INFO, env prefixSPLITFIRE), system prompt, toolsets (WorkspaceTools+MusicTools), slash commands, and the lazily started built-indemucs --mcpserver (SharedServer; a client-supplied MCP server nameddemucswins). Embedding apps use that: the separator passes its own--mcpserver, and KaroKowe Jam and KaroKowe Karaoke wrapSplitFireand return no built-in servers.src/prompt.rs: system prompt and slash commands (/analyze,/chords,/practice,/stemsonly when separation is available).src/tools/:MusicToolsis oneToolsetexposing sixtheory_*tools,analyze_audioandlist_separations. All are read-only and never prompt for approval. New tools need an entry indefinitions(),handles()anddescribe().src/theory/(pitch, interval, scale, chord, key, tempo) andsrc/audio/(symphonia decode, loudness/tempo/key analysis) are the pure computation behind the tools. The design principle is that the model calls these instead of recalling answers, so results must be exact (correct enharmonic spelling, e.g. C# major has E# and B#).src/lib.rsvssrc/main.rs: the crate is both a library (Profilefor hosts that embed the agent over an in-memory channel withed_acp::serve) and thesplitfire-agentbinary. Theclifeature (default) pulls ined-acp-tuiand the MCP test stub; build with--no-default-featuresto check the embeddable library alone.src/embed/(behind the off-by-defaultembedfeature) is the SplitFire-only glue a Tauri host needs beside the publisheded-acp-tauricrate:embed::fetch_key(SplitFire's/agent/key),embed::splitfire_mcp(the SplitFire API's MCP server), andembed::trim(droprun_commandand swap the stems paragraph on platforms that can't start processes). It has notauridependency — the app identifier comes in as a&str. TheNO_STEMS_START/NO_STEMS_ENDmarkersembed::trim::replace_no_stemskeys off are defined insrc/prompt.rs, which writes the paragraph, so the two can't drift.- The binary has three modes: TUI when stdin is a terminal; ACP over stdio with
--acpor when stdin is not a terminal; plus--setup/--list-models. The TUI is itself an ACP client that spawnssplitfire-agent --acpas a subprocess.
Tests
Integration tests run the real binary against a scripted mock model and a test MCP server (src/bin/mcp_stdio_stub.rs, built from ed-mcp's test-server feature, hence it requires cli). tests/acp_compliance.rs runs the platform conformance suite from ed-acp-testkit plus SplitFire-specific cases; shared helpers are in tests/common/.
Conventions
- Edition 2024. Per
.agents/skills/rust-coding-standard: no.unwrap()/.expect()outside#[cfg(test)], don't silently discard errors withlet _ =. registry/holds the ACP registry submission (agent.json); keep itsversionin step withCargo.tomlwhen releasing (both at 1.2.0).
Remembered notes
- Maven Central
search.maven.org/solrsearchis search-index-lagged and often returns 0 results for newly published artifacts (e.g.com.ondeinference:onde-inference1.3.2 returnednumFound=0for multiple query forms, but the artifact was live). Authoritative sources for a "is X published on Maven Central?" check, in order of truth: (1)https://central.sonatype.com/api/internal/browse/component/versions?filter=namespace:<g>,name:<a>— the modern API, returnsversion+publishedEpochMillis; (2)https://repo1.maven.org/maven2/<group-path>/<artifact>/maven-metadata.xml— has<latest>/<release>/<lastUpdated>, definitive; (3)curl -I https://repo1.maven.org/maven2/<group-path>/<artifact>/<version>/<artifact>-<version>.pom— confirms the POM is live. Always useUser-Agent: Mozilla/5.0because Xcode-shipped Python 3.9'surllibcan JSON-decode-error on some endpoints.