Skip to content

Retire mixes/ - #81

Merged
ninjudd merged 5 commits into
mainfrom
tracks/retire-mixes
Aug 9, 2026
Merged

ninjudd merged 5 commits into
mainfrom
tracks/retire-mixes

Conversation

@ninjudd

@ninjudd ninjudd commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Nothing points at a mix any more, so this is subtraction: 695 lines out, 129 in, and most of what came in is comments recording where something went.

The mix rule did four things and a track already does all four. It summed its inputs applying each one's gain and pan — a placement's gain_db and pan carry that. It baked a master chain in — that is a track's inserts:. It rendered the song's declared length with loop: folding the overhang — the output track took that in #78. And it drove a master gain into that chain — which is the level on the placement above it. A mix was a track that could not hold clips or nest, and creek renders bit-identically without one.

A mixes/ directory left behind is named rather than ignored. That project is mid-migration, and silently not reading the directory is the worst of the three options: the mix it describes would stop existing with the files still on disk saying otherwise. The message says what to move where. For the same reason the legacy mix.yaml diagnostic is repointed — it used to send people to mixes/, which is now a second dead end — and mix: or mixes: in a label suggests track:.

The transitional fixture block from two commits ago is deleted rather than extracted into a helper, which is what I said would happen when I declined to extract it. Five tests whose subject retired are gone. Three that tested the master chain now test the output track's inserts, which is the same assertion about the thing that replaced it.

The daemon still speaks op: "mix" and nothing sends it one. That half is the next PR; deleting the TypeScript type while the binary answers to the op would leave a wire format nothing describes.

Merge order

This cannot land until both of bloom's songs are migrated. okamnesiac/bloom#6 does creek. tall-grass also has mixes/main.yaml and is not in that PR — I found it only when this branch's guard fired on it. Merging this first turns field check on bloom into two errors.

Testing

cd ~/amnesiac/field
pnpm build && pnpm typecheck && pnpm test

445 tests, 33 files — down from 461 because five tests whose subject retired are gone and mix.test.ts went with the rule.

A song with no mix anywhere, which is what field song create now produces:

rm -rf /tmp/retire-demo && mkdir -p /tmp/retire-demo && cd /tmp/retire-demo
field init --name retire-demo
field song create creek
field track create creek verse
field import ~/amnesiac/bloom/shared/samples/water.wav --song creek --name hit

Put a clip in songs/creek/tracks/verse.yaml — replace clips: [] with:

clips:
  - id: h
    source: hit
    position: 0
    duration: 1920

Then:

field check
field build creek

ok, then //songs/creek/track:main. No mixes/ was created and none is needed.

Now the guard, which is the part that would fail silently if it were wrong:

mkdir -p songs/creek/mixes && printf 'name: main\n' > songs/creek/mixes/main.yaml
field check

Exit 1, naming the directory and what to move where. If this printed ok, a project's mix would have quietly stopped existing with its files still on disk — that is the failure this check exists for, and it is why the directory is diagnosed rather than skipped.

rm -rf songs/creek/mixes
field build creek/mix:main

pattern matched no labels: //songs/creek/mix:main (mix: is now track: try //songs/creek/track:main) — the label people have typed for months lands somewhere useful instead of dead. mixes: gives the same suggestion, which is the targets: lesson: correcting the plural to mix: would have handed back a second dead end.

Against bloom, once both songs are migrated:

cd ~/amnesiac/bloom
field check
field build creek
shasum -a 256 .field/out/songs/creek/track/main.wav

3825c1650d6149102626d6b5f936f866b319417391208c7d797682886d07fd2d, the hash //songs/creek/mix:main produced before any of this. Before tall-grass is migrated, field check reports its mixes/ instead — correctly.

Clean up with rm -rf /tmp/retire-demo.


Note

Medium Risk
This changes how song finals are built and labeled (mix → output track), so projects with unmigrated mixes/ will fail check until migrated; render parity depends on the prior nested-tracks work being correct.

Overview
Retires the mix build rule and songs/<song>/mixes/ so a song’s listenable output is only //songs/<song>/track:main. The graph no longer loads mix YAML or wires mix nodes; mixGenerator, planMix, and mixSchema are removed, and generatorFor only registers stem plus sound rules.

Migration and CLI behavior: field check reports a leftover mixes/ directory with concrete steps (move tracks to the output track’s inputs with placement gain_db/pan, master chain → track inserts, delete the folder). Legacy mix.yaml diagnostics point at the output track instead of mixes/. Label errors for mix: and mixes: suggest track: so old labels don’t dead-end at mix:.

Tests and docs drop mix-specific coverage and fixture scaffolding; master-chain behavior is asserted on the output track’s inserts. Docs and examples use track:main for build/export/play. MixPlan in render-daemon.ts remains until the daemon drops op: "mix".

Reviewed by Cursor Bugbot for commit 1a49d5e. Configure here.

Nothing points at a mix any more: bloom's creek is expressed as root
tracks, and a bare song name resolves to the output track. So this is
subtraction — 664 lines out, 112 in, and most of what came in is comments
saying where something went.

The mix rule did four things and a track already does all four. It summed
its inputs applying each one's gain and pan, which a placement's gain_db
and pan now carry; it baked a master chain in, which is a track's inserts;
it rendered the song's declared length with loop folding the overhang,
which the output track took in #78; and it drove a master gain into that
chain, which is the level on the placement above it. A mix was a track
that could not hold clips or nest.

A `mixes/` directory left behind is a project mid-migration and gets told
so, naming what to move where. Silently not reading it is the worst of the
three options: the mix would stop existing with the files still on disk
saying otherwise. The legacy `mix.yaml` diagnostic is repointed for the
same reason — it used to send people to `mixes/`, which is now a second
dead end — and `mix:`/`mixes:` in a label now suggest `track:`.

The transitional fixture block from two commits ago is deleted rather than
extracted into a helper, which is what I said would happen when I declined
to extract it. Five tests whose subject retired are gone; three that
tested the master chain now test the output track's inserts, which is the
same assertion about the thing that replaced it.

The daemon still speaks `op: "mix"` and nothing sends it one. That half is
the next commit; deleting the TypeScript type while the binary answers to
the op would leave a wire format nothing describes.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of 1a49d5e.

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1a49d5e. Configure here.

Comment thread src/model/project.ts Resolved

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

Reviewed 1a49d5e. Three findings — one P1 I reproduced by rendering, and two about text the subtraction left behind.

The removal itself is clean where I checked it. Nothing constructs a MixSpec any more, RULES loses its mix entry, GeneratorSpec narrows to two members, and Fader moves inline with the reason it survives written next to it — deleting the type while the binary answers to op: "mix" really would leave a wire format nothing describes. PACKAGE_HINTS mapping both mixes: and mix: to track: is the right call and the comment gives the right reason: correcting the plural to a singular that is also gone would hand back a second dead end, which is the mistake targets: was already fixed for.

The mixes/-left-behind guard is the right choice among the three you name. Silently not reading the directory is worse than either alternative, and the message says what to move where rather than only that something is wrong.

pnpm typecheck is clean and the suite is 445 across 33 files, matching your Testing section exactly.

On merge order, your claim checks out and I verified it rather than taking it: ls ~/amnesiac/bloom/songs/*/mixes returns both creek and tall-grass. So this cannot land until both are migrated, not just the one in bloom#6 — and with the guard in place, merging first turns field check on bloom into two errors rather than one.

Comment thread src/generators/index.ts Resolved
Comment thread src/model/project.ts Resolved
Comment thread src/graph/graph.ts Resolved
The mix rule was the only consumer of a track's own gain_db and pan.
Retiring it left them declared, accepted, and unread: `-24` on an output
track passed check, did not even invalidate the cache, and rendered
byte-identically. Reproduced before fixing.

Decision 13 already said these retire, so they are gone from the schema
rather than left as fields meaning nothing. That makes a leftover one an
error instead of a silence, which is the trade this codebase keeps making.

Turning the song down is the same decision's move applied to the root:
another gain stage is another level, so `main` places a `body` track and
the level lives on that placement. Measured at exactly -12.0 dB for
gain_db: -12, so the capability the mix's master gain provided did not
leave with it.

Two comments describing things that are no longer true: `LoadedSong`'s
still introduced a `mixes` collection this branch deleted two lines below
it, and graph.ts's still said an empty stem is not a useful artifact —
false since #79 made exactly that the point — while calling the mix rule
present tense in the commit that removes it.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of 5899736.

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

Reviewed 5899736. All three findings are fixed, and the P1 the strongest of the three ways available — removing the fields rather than teaching something to read them. One new finding, which is the cost of having chosen that way.

Removing them is right for the reason the comment gives: a level that must differ per parent cannot live on the thing being placed, so there was never a correct reader to add. trackOrder drops them too, so fmt will not reintroduce a key the schema now rejects, and the validation that existed only to refuse them on a placed track goes with them — it has nothing left to say.

Recording it in §1.13 as landed, including the interval where the field passed check and changed nothing, is the honest version. That paragraph now reads as a decision with a date and a consequence rather than an intention.

Both stale comments are fixed, and the graph one is fixed properly rather than minimally: "every audio track gets a node, an empty one rendering as the silence it contains" states the rule #79 established instead of the one it replaced, and "the way the mix did before it retired" keeps the lineage while putting it in the past.

pnpm typecheck clean, suite 445 across 33 files.

Comment thread src/schema/track.ts Resolved
Removing the field left `strictObject` to answer "Unrecognized keys",
which is true and tells nobody anything. Every other removal in this
retirement forwards: a `mixes/` directory names what to move where,
`mix.yaml` is repointed rather than dropped, `mix:` and `mixes:` in a
label both suggest `track:`. This was the one that got none, and the one
most likely to be met — bloom's main has five track files carrying a
fader, so the first person to see it is whoever runs check after both
repos merge.

The two names are declared as `never` with the message, which keeps the
forwarding address in the schema beside the comment explaining it rather
than in a lookup table the loader consults.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of 1a210c9.

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

Reviewed 1a210c9. The forwarding address is there and works. One P3, on how the sentence lands once the diagnostic formatter is done with it.

Keeping the keys declared purely to reject them with a message is the right trick — z.never().optional() accepts an absent field and refuses a present one, so a clean track file validates unchanged while an old one gets told where its level went. Verified both: a fresh song create / track create / clip still resolves and renders, and a track file carrying gain_db: -3 and pan: -0.2 now produces two messages naming the placement instead of "Unrecognized keys". pnpm typecheck is clean and the suite is 445 across 33 files, so declaring the type as never did not disturb anything downstream of Track.

The test moving from toContain('Unrecognized key') to the real sentence is the right assertion too — the old one would have passed on any rejection at all, including the one this commit exists to replace.

Comment thread src/schema/track.ts Resolved
The loader appends " at <field>" to every schema diagnostic, so "has
moved: …" opened with a verb whose subject landed 180 characters later,
twice per file. Dropping the two words makes it a sentence and turns the
trailing "at gain_db" back into the pointer it is everywhere else.

This string is the whole content of the previous commit and the first
thing five bloom track files will say, so it is worth reading as English.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of fc3b8e5.

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

Reviewed fc3b8e5. The message reads correctly now, and I found one more thing on a final sweep — user-facing this time, which is why it gets a thread rather than a note.

The rephrase works. Rendered at this head:

songs/creek/tracks/drums.yaml: a level lives on the placement that consumes this track — put it on the `inputs:` entry that places this track, and delete it here (nested-tracks.md §1.13) at gain_db

The trailing at gain_db is now the pointer it is everywhere else, and "put it on … delete it here" reads naturally with the field named at the end rather than stranded from its subject. pnpm typecheck clean, 445 tests across 33 files.

The finding below is mine to have missed earlier: it was already wrong when #79 changed what a bare song name resolves to, and I reviewed that PR without catching it. It only surfaced now because retiring the rule made me sweep for what still mentions it.

The rest of what that sweep turned up is comment text I am recording rather than filing, since the PR's substance is done and none of it is user-facing: schema/song.ts:13 still says the output "is the mix, or the track named main"; testing/playable.ts:23 defaults a fixture label to //songs/x/mix:main, a label that can no longer exist; loop-ui.ts:3,13,15 and export.ts:57 illustrate with //songs/creek/mix:main; graph.ts:40 still lists "(stem, mix)" as the synthesized specs. Sweep them or leave them — they cost nothing until someone copies one.

Comment thread src/schema/track.ts Resolved
`field build --help` still described the shorthand as reaching the main
mix, three PRs after it stopped. The description string is the one place
that text exists outside the docs, so it survived greps that were looking
at docs/ and labels.ts.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of f34b947.

@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 f34b947.

field build --help now reads "or a bare song for its output track", and grep -rn "main mix" src/ returns nothing outside tests. pnpm typecheck clean, 445 tests across 33 files.

Over six heads this went from a subtraction with three loose ends to one without them. Worth recording what the sequence actually established, since the individual commits undersell it:

The mix rule really was a track that could not hold clips or nest — every one of its four jobs has a home, and the PR proves that by deleting it rather than asserting it. What the review added was the part that only shows up from outside: a schema field with no reader is invisible until you render both ways, so gain_db: -12 producing a byte-identical file was the finding, not the missing consumer. Removing the field rather than teaching something to read it was the stronger fix and yours, and it forced the good question after it — what a project carrying the old spelling hears — which is now a sentence naming where the level went instead of zod saying a key is not allowed.

The last one was help text, which is the class this repo keeps finding late: comments get audited because they sit next to code being changed, and --description strings sit next to nothing. It had been wrong since #79 and I reviewed that PR without catching it.

Merge order, unchanged and now two-part. bloom's main still has mixes/ in both songs and five track files under songs/creek/tracks/ carrying gain_db/pan. Both must migrate before this lands or field check there fails on both counts — the directory guard fires per song, and the retired-fader message fires per file. A fix loop reported bloom clear; that is true of its branch and not of main, and I have told it so. Nothing in this PR needs to change for that: the ordering is a fact about two repositories, not a defect in one.

No findings.

@ninjudd
ninjudd merged commit af45059 into main Aug 9, 2026
1 check passed
@ninjudd
ninjudd deleted the tracks/retire-mixes branch August 9, 2026 01:39
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