Repository navigation
Retire the sound machinery: every definition is a track - #114
Conversation
nested-tracks.md chunk 6 finale (decision 12): the sound: entry field, the sounds/ loader, the sound schema union, the effect generators and the sound-side generate/choose paths go, each behind a migration diagnostic; the sound: label forwards to track:.
|
Starting review of bf773f2. |
minjudd
left a comment
There was a problem hiding this comment.
Approving bf773f2. A 1,949-line deletion whose whole claim is that nothing moved, so I went at the claim rather than the diff — and it is checkable here without a daemon, which makes it stronger than a build log.
Every node in bloom is identical, key included. All 14 tracks across both songs, the five gen: nodes, and convert:gen-lead-take-48000, explained on main and on this head with the same takes in place: same type, same input list with the same hashes, same parameters string, same action key. Not one differs. That is what makes "a full build is entirely cache hits" true rather than observed, and it is the proof this is retirement and not change.
Every departing spelling forwards, and each names its destination:
//songs/creek/sound:lead-take → sounds folded into tracks: try //songs/creek/track:lead-take
//songs/creek/sounds:lead-take → same
//songs/creek/targets:lead-take → targets: is now track: try //songs/creek/track:lead-take
songs/creek/sounds/ → sounds/ has retired … fold an effect sound into a track with one insert, a
supercollider or generative sound into a leaf track …, rename sound: to gen: …
sound: in an entry → the tombstone, per entry, naming the fold
audio/<n>/variants.yaml sound: → still the rename diagnostic
targets: landing on track: directly is the detail worth calling out: chaining it through sound: would have been correct-looking and useless, and the body is right that it is the mistake that spelling already made once.
The create path pre-flights before the worker, which I checked by making it fail. An existing track ("pad" is already a track … that file exists; add a generative: entry to it yourself), an asset collision (audio/water/ is the ledger's), and a populated takes directory all refuse with no model contacted. The last one I had to fill to see — an empty variants.yaml passes, which is right: there is nothing there to lose.
579 tests, 471 pass, 42 skip, 66 fail — #113 was 581/472/42/67, so the net −2 is the two retired fold-transition tests exactly as described, and every failure in the run is the one field-audiod is not built string. pnpm typecheck clean; field check on bloom ok.
The docs land where the behaviour did: overview.md's song no longer has sounds, build-graph.md's vocabulary line says tracks/entries/inserts, and both now.md entries keep the stays-until-exercised shape — the nested-tracks line saying what it is waiting for rather than being deleted on merge day.
One cosmetic thing, no action needed: audio/ghost/ already holds 1 takes in creek. The sibling refusal a few lines up carries the plural guard (take${n === 1 ? '' : 's'}) and this one does not.
The two things I cannot check stay yours: that the full build prints only source and cached, and that the daemon is genuinely untouched by a change that removed three of its callers.
No findings.
The chunk 6 finale's second half (nested-tracks.md §18, decision 12). #113 left bloom with no
sounds/directory and nothing exercising the machinery; this removes it. Thesound:entry field, the sound schema union (effect sounds, the supercollider sound form, the generative recipe form and its tombstones), thesounds/loader andsong.sounds, the graph's declared-sound rules, the eq/limit/reverb generators, the sound-side generate/choose paths, and the namespace's sounds scan are gone. Three rules remain in the engine —supercollider,stem,resample— every spec synthesized from the model; the effect contracts live on as inserts, unchanged (schema/effects.ts is still the wire format, and the daemon is untouched).Every departing spelling forwards rather than dying with a grammar error. A surviving
sounds/directory gets one diagnostic with the fold instructions — mixes/-grade, one message for the directory because the fix is the same fold for every file in it. Asound:entry is a tombstone naming where its target went. Thesound:andsounds:label packages forward totrack:(§18 decision 5 — "the sound: label still forwards to track: at the finale"), andtargets:chains straight there rather than to a second dead end, the mistake it was already fixed for once. A pre-fold takes file keeps itssound:→gen:rename diagnostic — the schema deliberately still admits the old key so the loader can say the move instead of "unrecognized key".field generateandfield choosespeak entries only now. Filling targets a generative entry by its gen node name, and a brand-new request scaffolds a leaf track carrying the entry — the shape every request lives in — validated through the track schema but written from the raw object, so the scaffold has no defaulted placement noise and is byte-for-byte the file a person would write. The create path pre-flights everything it would mint: the track file it writes, the gen node name, the bare name, an existing takes directory, and the audition labels. Thepkg: 'sound' | 'gen'distinction disappeared from both results and the CLI's hints along with the second kind.The proof that this is pure retirement: bloom's graph came through untouched.
field checkis ok and a fullfield build //songs/...after the change is entirely cache hits — zero re-renders, because no surviving node's key contains anything that left. The forwarding is exercised for real:field build //songs/creek/sound:lead-takeanswers "sounds folded into tracks: try //songs/creek/track:lead-take", and the plural forwards the same way.Tests moved with the machinery rather than shrinking around it: the effect-property oracle translates its sound-shaped fixtures into wrapper tracks with one insert and still measures every property from C++ output through the build rules; effects chains became wrapper tracks placing wrapper tracks; build/watch/export/stem/model fixtures became wrapper tracks or generative/supercollider leaves; generate/choose tests assert the scaffold shape and the takes file instead of a recipe. Two historical tests retired with the transition they proved (the fold-is-a-cache-hit pair), each replaced by the invariant that survives it — a generator render is keyed by parameters, never by its name, so a rename is a cache hit under the new label.
Docs follow the behaviour: project-model.md and build-graph.md now describe the track-only model (the layout tree loses
sounds/, the entry-kind list loses its transitional fourth kind, "Sound types" became "Node types"); nested-tracks.md's status is complete-except-deferred-sends with the finale recorded; now.md keeps both lines in the neighbours' stays-until-exercised shape.Testing
From the repo root,
pnpm build && pnpm typecheck && pnpm test— 579 tests pass (net −2 from #113's 581: the two fold-transition tests retired with the transition, and the migrated suites kept their assertion counts). No native change, so nopnpm build:nativeneeded.By hand, in
examples/bloom(needspnpm buildso thefieldon your PATH is current; spawns anaudioddaemon —field quitstops it):checksays ok, and the full build prints nothing butsourceandcachedlines — zero re-renders is the whole claim: the retirement moved no graph node and no action key, and a singlebuiltline here would mean it did. The third command fails usefully:pattern matched no labels: //songs/creek/sound:lead-take (sounds folded into tracks: try //songs/creek/track:lead-take)— before this PR that spelling resolved. What a project mid-migration sees: put any YAML file insongs/creek/sounds/andfield checkanswers with the fold instructions for the directory; writesound: lead-takein a track entry and the schema forwards it to thetrack:spelling.field generate/choosestill work end to end against the entry model (the stub-worker suites insrc/commands/generate.test.tsandchoose.test.tscover the scaffold, fill, and repoint paths).Note
Medium Risk
Large schema and graph refactor across build, generate, and labels, but behavior is intended to be retirement-only with label forwarding; risk is mainly migration edge cases and missed references to removed sound paths.
Overview
Finishes nested-tracks chunk 6 by retiring
sounds/and the sound machinery so every buildable definition lives on a track:generative:/supercollider:entries,inserts:for effects, and//songs/.../track:labels. The graph keeps onlysupercollider,stem, andresamplegenerators; eq/limit/reverb generator modules are removed while insert contracts and daemon rendering stay the same.Migration instead of hard failures: surviving
sounds/directories get fold diagnostics;sound:entries andsound:/sounds:/targets:labels forward totrack:with hints; stale takes files still getsound:→gen:guidance.CLI:
field generatefills a gen node by name or scaffolds a leaf track for a new request;field chooseis gen-only (nopkg: sound | gen). Help text and examples usetrack:/gen:labels.Tests and docs follow the track-only model (wrapper tracks for effect chains, updated bloom build expectation: cache hits, no re-renders). Fold-specific tests are replaced by the invariant that generator renders key on parameters, not node names.
Reviewed by Cursor Bugbot for commit bf773f2. Configure here.