Skip to content

Retire the sound machinery: every definition is a track - #114

Merged
ninjudd merged 1 commit into
mainfrom
tracks/retire-sound-machinery
Aug 10, 2026
Merged

ninjudd merged 1 commit into
mainfrom
tracks/retire-sound-machinery

Conversation

@ninjudd

@ninjudd ninjudd commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

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. The sound: entry field, the sound schema union (effect sounds, the supercollider sound form, the generative recipe form and its tombstones), the sounds/ loader and song.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. A sound: entry is a tombstone naming where its target went. The sound: and sounds: label packages forward to track: (§18 decision 5 — "the sound: label still forwards to track: at the finale"), and targets: chains straight there rather than to a second dead end, the mistake it was already fixed for once. A pre-fold takes file keeps its sound:→gen: rename diagnostic — the schema deliberately still admits the old key so the loader can say the move instead of "unrecognized key".

field generate and field choose speak 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. The pkg: '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 check is ok and a full field 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-take answers "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 no pnpm build:native needed.

By hand, in examples/bloom (needs pnpm build so the field on your PATH is current; spawns an audiod daemon — field quit stops it):

field check
field build //songs/...
field build //songs/creek/sound:lead-take

check says ok, and the full build prints nothing but source and cached lines — zero re-renders is the whole claim: the retirement moved no graph node and no action key, and a single built line 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 in songs/creek/sounds/ and field check answers with the fold instructions for the directory; write sound: lead-take in a track entry and the schema forwards it to the track: spelling. field generate/choose still work end to end against the entry model (the stub-worker suites in src/commands/generate.test.ts and choose.test.ts cover 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 only supercollider, stem, and resample generators; 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 and sound: / sounds: / targets: labels forward to track: with hints; stale takes files still get sound: → gen: guidance.

CLI: field generate fills a gen node by name or scaffolds a leaf track for a new request; field choose is gen-only (no pkg: sound | gen). Help text and examples use track: / 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.

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:.
@minjudd

minjudd commented Aug 10, 2026

Copy link
Copy Markdown

Starting review of bf773f2.

@minjudd minjudd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ninjudd
ninjudd merged commit bffdc10 into main Aug 10, 2026
2 checks passed
@ninjudd
ninjudd deleted the tracks/retire-sound-machinery branch August 10, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants