Repository Public
1<!--2ORIX Sonata3File: CLAUDE.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# ORIX Sonata — working rules89Native macOS music-programming studio: Sonata language → compiler → Musical IR / DSP IR →10real-time and offline audio. Bundle `ai.spboucher.orix.sonata`, Apple Silicon, macOS 15+.11The mandate is traced section by section in `ROADMAP.md`. State of the work: `STATUS.md`. Risks: `RISKS.md`.1213## Non-negotiable14151. **No fake anything.** No decorative waveform, no silent instrument declared working, no16 button without an effect, no number that was not measured. Unfinished = disabled and listed17 in `STATUS.md`.182. **Audio thread**: no allocation, blocking lock, file or network access, logging or19 compilation in any `process` path. Preallocate; SPSC queues and atomics only.203. **One source of truth**: the compiler crates. The app, CLI and LSP call them; nobody21 re-implements parsing, timing or parameter tables. Time conversions go through `sonata_ir::time`.224. **Headers**: every first-party source file starts with the ORIX Sonata header23 (project, `File:` relative path, `Description:`, author Simon-Pierre Boucher, contact@spboucher.ai).245. Never touch other projects, signing material or secrets. Nothing is published without the owner's word.256. Safe loudness: tests and previews start quiet; the master limiter is on by default.2627## Layout and ownership2829| Path | Role |30|---|---|31| `crates/sonata-ir` | contracts: `Rational`, tempo map, diagnostics, `Program`, `DspGraph`, `PatchSpec`, `Registry` types. Change only with the integrator's agreement. |32| `crates/sonata-lexer`, `-parser`, `-semantics`, `-compiler` | frontend, formatter, language services, graph builder, cache |33| `crates/sonata-dsp` | primitives (`core`, `osc`, `filter`, `env`), `effects`, `analysis` |34| `crates/sonata-instruments` | engines, patch interpreter, engine registry |35| `crates/sonata-runtime`, `-render` | real-time engine, offline render, file writers |36| `crates/sonata-interop` | MIDI, MusicXML, audio import |37| `crates/sonata-cli`, `-lsp`, `-ffi` | command line, language server, C ABI for Swift |38| `Apps/ORIXSonata`, `Packages/*` | the macOS app (XcodeGen `project.yml`) |39| `StandardLibrary/std` | the standard library, written in Sonata, embedded in the compiler |40| `Documentation/` | spec, ADRs, manual; `Examples/` are compiled by the tests |4142## Commands4344```bash45cargo test --workspace # all Rust tests46cargo clippy --workspace --all-targets -- -D warnings47cargo fmt --all48cargo run -p sonata-cli -- render Examples/aurora.sonata --output build/aurora.wav49Scripts/build.sh debug|test|release # app (after M1)50```5152Rust 1.95 (pinned in `rust-toolchain.toml`), `rustfmt.toml` at the root. Dependencies are kept53minimal, MIT/Apache-2.0 only, and recorded in `Documentation/DEPENDENCIES.md`.5455## Working in parallel5657Several agents work in this repository at once. Stay inside the paths you own, never run58`git add -A` or `git commit -a`: commit only your own paths (`git add <paths> && git commit`),59retry if `index.lock` is held. Do not rewrite history. Do not edit another owner's file: note60the request in your final report instead. Use your own `CARGO_TARGET_DIR` only if builds block61each other for long. Do not spawn sub-agents.62