README.md
markdown
| 1 | # Muse — Demo Hub |
| 2 | |
| 3 | > Domain-agnostic version control for multidimensional state. |
| 4 | > Music is the first domain. Code is the second. Genomics, 3D design, and |
| 5 | > spacetime simulation are next. |
| 6 | |
| 7 | Choose a domain to see Muse's full power: |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ## [MIDI Demo →](demo-midi.md) |
| 12 | |
| 13 | **9 new commands — version control that understands music.** |
| 14 | |
| 15 | Muse treats MIDI as a typed, content-addressed graph of note events. Every |
| 16 | note has a stable content ID. Every commit stores a note-level structured |
| 17 | delta. Two composers can independently harmonize the same track and merge |
| 18 | at the note level — changes to non-overlapping notes never conflict. |
| 19 | |
| 20 | | Command | One-line description | |
| 21 | |---------|---------------------| |
| 22 | | `muse midi notes` | Every note in a MIDI track as musical notation — pitch, beat, duration, velocity | |
| 23 | | `muse midi note-log` | Note-level commit history — which notes were added/removed in each commit | |
| 24 | | `muse midi note-blame` | Which commit introduced the notes in bar N? One answer, per bar. | |
| 25 | | `muse midi harmony` | Chord analysis and key detection from note content | |
| 26 | | `muse midi piano-roll` | ASCII piano roll visualization — pitch vs time, bar lines included | |
| 27 | | `muse midi hotspots` | Bar-level churn leaderboard — which bars change most across commits | |
| 28 | | `muse midi velocity-profile` | Dynamic range, RMS, and velocity histogram; per-bar mode | |
| 29 | | `muse midi transpose` | Transpose all notes in a track by N semitones (agent command) | |
| 30 | | `muse midi mix` | Combine notes from two tracks into one output track (agent command) | |
| 31 | |
| 32 | Plus the core VCS operations with musical semantics: |
| 33 | `muse diff` shows "C4 added at beat 3.5" · `muse merge` resolves conflicts |
| 34 | per dimension (melodic / harmonic / dynamic / structural) · `muse show` |
| 35 | displays note-level changes in musical notation. |
| 36 | |
| 37 | --- |
| 38 | |
| 39 | ## [Code Demo →](demo-code.md) |
| 40 | |
| 41 | **12 commands that are strictly impossible in Git.** |
| 42 | |
| 43 | Muse treats code as a typed, content-addressed graph of named symbols — not |
| 44 | a bag of text lines. Every commit stores a symbol-level structured delta. |
| 45 | Every function has a stable identity hash that survives renames and moves. |
| 46 | |
| 47 | | Command | One-line description | |
| 48 | |---------|---------------------| |
| 49 | | `muse code symbols` | Every function, class, and method in the snapshot — extracted from real ASTs | |
| 50 | | `muse code grep` | Search the symbol graph by name, kind, or language — no false positives | |
| 51 | | `muse code query` | Predicate DSL: `kind=function language=Go name~=handle hash=a3f2c9` | |
| 52 | | `muse code languages` | Language + symbol-type breakdown across the whole repo | |
| 53 | | `muse code blame` | Which commit last touched this exact function? One answer. | |
| 54 | | `muse code symbol-log` | Full history of one symbol — renames and moves included | |
| 55 | | `muse code detect-refactor` | Classify semantic operations: rename / move / signature / impl | |
| 56 | | `muse code hotspots` | Symbol churn leaderboard — which functions change most? | |
| 57 | | `muse code stable` | Symbol stability leaderboard — your bedrock, safe to build on | |
| 58 | | `muse code coupling` | File co-change analysis — semantic hidden dependencies | |
| 59 | | `muse code compare` | Deep semantic diff between any two historical snapshots | |
| 60 | | `muse code patch` | Surgical per-symbol modification — the agent interface | |
| 61 | |
| 62 | **Supported languages:** Python, TypeScript, JavaScript, Go, Rust, Java, C, C++, C#, Ruby, Kotlin |
| 63 | |
| 64 | --- |
| 65 | |
| 66 | ## Shared Architecture |
| 67 | |
| 68 | Both domains build on the same engine: |
| 69 | |
| 70 | ``` |
| 71 | Content-addressed object store ← immutable, SHA-256 |
| 72 | Snapshot manifest ← file path → object hash |
| 73 | Structured delta ← typed DomainOp tree (insert / delete / replace / move / patch) |
| 74 | Commit graph ← parent chain with structured deltas on every node |
| 75 | ``` |
| 76 | |
| 77 | The **MIDI plugin** adds: |
| 78 | |
| 79 | ``` |
| 80 | Note event model ← NoteKey (pitch, velocity, start_tick, duration_ticks, channel) |
| 81 | Note-level diffs ← PatchOp with child InsertOp/DeleteOp per note |
| 82 | Dimensional merge ← melodic / rhythmic / harmonic / dynamic / structural |
| 83 | Content IDs per note ← SHA-256 of the five NoteKey fields |
| 84 | ``` |
| 85 | |
| 86 | The **code plugin** adds: |
| 87 | |
| 88 | ``` |
| 89 | AST symbol trees ← SymbolRecord (kind, name, body_hash, signature_id, content_id) |
| 90 | Symbol-level diffs ← PatchOp with child InsertOp/DeleteOp/ReplaceOp per symbol |
| 91 | Rename detection ← body_hash match across addresses |
| 92 | Move detection ← content_id match across files |
| 93 | ``` |
| 94 | |
| 95 | Every domain command is a consumer of what the plugin already produces. |
| 96 | No new storage format. No new protocol. Just queries over the structured |
| 97 | commit history. |
| 98 | |
| 99 | --- |
| 100 | |
| 101 | ## The Semantic Stack |
| 102 | |
| 103 | | Layer | What it stores | Music commands | Code commands | |
| 104 | |-------|---------------|----------------|---------------| |
| 105 | | **Object store** | Raw bytes, SHA-256 | All | All | |
| 106 | | **Snapshot manifest** | `file_path → sha256` | `notes`, `harmony`, `piano-roll` | `symbols`, `languages`, `compare` | |
| 107 | | **Structured delta** | Typed op tree per commit | `note-log`, `note-blame`, `note-hotspots` | `blame`, `hotspots`, `stable`, `coupling` | |
| 108 | | **Domain graph** | Notes / AST symbols | `velocity-profile`, `harmony`, `query` | `grep`, `query`, `patch` | |
| 109 | | **Write layer** | Live file modification | `transpose`, `mix` | `patch` | |
| 110 | |
| 111 | --- |
| 112 | |
| 113 | *Muse v0.1.2 · Python 3.14 · `tree-sitter` for code · `mido` for MIDI* |