# Episode 10 --- Muse Understands Code **Working YouTube title:**\ **Blast Radius, Gravity, and the Bug That Isn't a Bug** **Thumbnail thought:**\ `the function nobody suspected.` **Target runtime:** \~8:00 ------------------------------------------------------------------------ ## \[0:00--0:20\] COLD OPEN **\[CAMERA --- Episode 09's closing line, on screen: "everything the code domain can tell you when nothing's even conflicting."\]** **GABRIEL:** No conflicts today. Just four tiny files and a lot of questions. **\[TITLE CARD --- fast\]** > MUSE UNDERSTANDS CODE **\[Music enters.\]** ------------------------------------------------------------------------ ## \[0:20--1:00\] THE SETUP **\[TERMINAL\]** ``` text $ cat app.py auth.py db.py utils.py ``` ``` python # app.py from auth import login def handle_request(username, password): return login(username, password) # auth.py from db import query def login(username, password): ... # db.py def query(sql): ... # utils.py def unused_helper(): return "nobody calls me" ``` **GABRIEL VO:** A real call chain --- `app` calls `auth`, `auth` calls `db` --- plus one function that calls nothing and is called by nothing. Four commits of real history behind it. Let's ask it things. ------------------------------------------------------------------------ ## \[1:00--1:40\] THE HISTORY OF ONE FUNCTION **\[TERMINAL\]** ``` text $ muse code symbol-log "auth.py::login" ``` ``` text ● created "Initial: app, auth, db, utils" ● modified "auth: trim username before querying" ● modified "auth+db: lowercase username, log queries" ● modified "auth+db: reject empty username, stop logging raw sql" 4 event(s) (created: 1, modified: 3) ``` **GABRIEL:** Not "this file changed four times." This *function's* life story, across every commit that touched it, regardless of what else was in those commits. ------------------------------------------------------------------------ ## \[1:40--2:20\] TWO DIRECTIONS, ONE PAIR OF COMMANDS **\[TERMINAL\]** ``` text $ muse code impact "auth.py::login" ``` ``` json { "blast_radius": { "1": ["app.py::handle_request"] } } ``` ``` text $ muse code deps app.py ``` ``` json { "imports": ["import::auth::login"] } ``` **GABRIEL VO:** `impact` looks backward --- who calls this, if I break it, what breaks. `deps` looks forward --- what does this file need to keep working. Same call graph, opposite direction, same one line of history it's all built from. ------------------------------------------------------------------------ ## \[2:20--3:00\] THE CHURN LEADERBOARD **\[TERMINAL\]** ``` text $ muse code hotspots ``` ``` text auth.py::login 4 changes db.py::query 3 changes app.py::handle_request 1 change utils.py::unused_helper 1 change ``` **GABRIEL:** `login` changed the most. If you were guessing where the risk lives in this codebase, that's usually the first place people point. **\[beat\]** Let's check if that guess is actually right. ------------------------------------------------------------------------ ## \[3:00--3:50\] CHURN ISN'T RISK **\[TERMINAL\]** ``` text $ muse code gravity ``` ``` text db.py::query gravity 66.7% 2 transitive dependents auth.py::login gravity 33.3% 1 direct dependent app.py::handle_request gravity 0.0% utils.py::unused_helper gravity 0.0% ``` **GABRIEL VO:** `query` changed *less* than `login`. It's still the riskier function to break --- everything that depends on `login` also transitively depends on `query`. **\[beat\]** Hotspots tells you what people keep touching. Gravity tells you what would hurt the most if you got it wrong. Those are two different questions, and this codebase just gave two different answers. ------------------------------------------------------------------------ ## \[3:50--4:30\] THE HIDDEN COUPLING **\[TERMINAL\]** ``` text $ muse code entangle ``` ``` json { "pairs": [{ "symbol_a": "auth.py::login", "symbol_b": "db.py::query", "co_changes": 3, "co_change_rate": 1.0 }] } ``` **GABRIEL:** Every single time `login` changed, `query` changed with it. A hundred percent co-change rate, across real commits, not a guess. **\[beat\]** Nobody declared that dependency anywhere. Muse found it by watching what actually happened. ------------------------------------------------------------------------ ## \[4:30--5:10\] DEAD CODE, HONESTLY **\[TERMINAL\]** ``` text $ muse code dead --high-confidence-only ``` ``` text app.py::handle_request not referenced, module not imported utils.py::unused_helper not referenced, module not imported ``` **GABRIEL VO:** `unused_helper` --- correct, genuinely dead, nobody calls it. **\[beat\]** `handle_request` --- also flagged. And that one's wrong. It's the entry point. Nothing's *supposed* to call it from inside this codebase; something outside calls it. **\[CAMERA\]** Static analysis can't see outside its own repo. Know that blind spot before you trust a dead-code report on your actual entry points. ------------------------------------------------------------------------ ## \[5:10--5:45\] NONE OF THIS IS A SEPARATE PRODUCT **\[CAMERA\]** Every one of these --- history, blast radius, hotspots, gravity, coupling, dead code --- is a query over exactly the same commit DAG and content-addressed objects from Episode 02 and 03. **\[beat\]** No separate analytics engine. No background indexing service you have to stand up. The data was always there, in every commit; these commands are just asking it different questions. ------------------------------------------------------------------------ ## \[5:45--6:20\] THE POINT **\[CAMERA\]** You could reconstruct some of this from Git --- with enough scripting, enough log-parsing, enough patience. **\[beat\]** Muse didn't have to reconstruct anything. It already understood symbols, from the moment you committed. These questions were always answerable. Nobody had asked them yet. **\[ON SCREEN\]** > THE DATA WAS NEVER MISSING. ONLY THE QUESTIONS WERE. ------------------------------------------------------------------------ ## \[6:20--6:55\] OUT **\[TERMINAL --- a `.mid` file, waveform preview\]** **GABRIEL VO:** Every one of these questions assumed code. Symbols, imports, call graphs --- things a programming language actually has. **\[beat\]** Next episode, we ask the exact same *category* of question about something that isn't code at all. Notes. Tempo. Velocity. **\[CAMERA.\]** Same six methods. Wildly different answers. **\[CUT TO BLACK\]** > `musehub.ai` ------------------------------------------------------------------------ # Production Notes Episode 10 is a showcase, not a deep dive --- eight commands, most episodes cover one or two thoroughly. The connective tissue holding it together is more important than any individual command: every demo should visibly build toward "hotspots and gravity disagree, and that disagreement is the actual lesson," not just be a checklist of features. ## Opening Skip any recap of Episode 09 beyond the single on-screen callback line. This episode needs its runway clear --- eight real commands in under seven minutes leaves no room for a slow start. ## The Gravity/Hotspots Contrast Is the Spine Structure the whole episode so hotspots comes immediately before gravity, and make sure the audience consciously guesses "login is riskier" from the hotspots number before gravity corrects them. The correction only lands if the audience made the wrong guess first. ## The Dead-Code Caveat Is Not Optional Flagging `handle_request` as a false positive is one more instance of this season's running discipline: every tool has a blind spot, and the episode names it instead of only showing the tool's best case. Don't cut this beat for pacing --- it's short, and it's exactly the kind of honesty the last two episodes established as the show's standard. ## Everything Here Is Real All eight commands were run against an actual four-file, four-commit demo repo, built specifically to produce a genuine (not staged) gravity/hotspots disagreement and a genuine 100% co-change pair. Re-verify the exact numbers against whatever `muse` build is current at record time --- the demo repo itself is disposable and easy to rebuild identically. ## The Seed The viewer arrives thinking: > **Okay, decent set of code-quality tools. I've seen similar things > bolted onto other version control systems as plugins.** They should leave thinking: > **Wait --- none of this was a plugin bolted on. This is just what > "understanding code" gets you for free once diff and merge already > work this way. What does "understanding music" get you?** That's Episode 11, and the transition should feel like changing instruments, not changing subjects.