Skip to content

A bare song name is its output track - #79

Merged
ninjudd merged 3 commits into
mainfrom
tracks/bare-name-to-track
Aug 9, 2026
Merged

ninjudd merged 3 commits into
mainfrom
tracks/bare-name-to-track

Conversation

@ninjudd

@ninjudd ninjudd commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

creek meant //songs/creek/mix:main. It now means //songs/creek/track:main.

This is one half of a flag day. okamnesiac/bloom#6 expresses creek as a root track in the same breath, and neither half works alone: landing this without bloom's migration breaks field build creek, and landing bloom's without this breaks it identically from the other side. I ran both directions rather than assuming — against bloom's migrated worktree the bare name builds track:main, and against unmigrated bloom it reports pattern matched no labels: //songs/creek/track:main.

One spelling, not a fallback to whichever of the two exists. A song declaring both an output track and an output mix is already refused by check, and a fallback would be two ways to resolve one name — the thing that made field version worth collapsing.

The two-outputs message said "a bare song name reaches the mix". It reaches the track now, so the message says that. The ambiguity it reports is unchanged; only the direction of the silent answer moved, and a test pins the new wording.

mixes/ still loads and still renders. What changed is that nothing points at one by default any more, which is precisely what makes retiring it next a subtraction rather than a second flag day.

Testing

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

460 tests, 34 files. Two of them encoded the old meaning and now encode the new one — a bare song name means its main mix became …its output track, which is the change stated as a test rather than only in prose.

The flag day itself needs both sides, so check it against bloom's PR branch. From a bloom checkout with okamnesiac/bloom#6 applied:

cd ~/amnesiac/bloom
field build creek

Builds //songs/creek/track:main. Against unmigrated bloom the same command reports pattern matched no labels: //songs/creek/track:main — that is this PR's breakage, and it is the reason the two merge together rather than in sequence.

Explicit labels are unaffected either way, which is worth confirming since it bounds the blast radius:

field build creek/track:main
field build creek/mix:main      # still resolves; mixes have not retired

And the grammar is untouched — only the shorthand's expansion moved:

node -e "const {parseLabel}=require('$HOME/amnesiac/field/dist/labels.js');
console.log(parseLabel('creek'), parseLabel('creek/mix:main'))"

creek gives { pkg: 'songs/creek/track', name: 'main' }; the explicit mix: form still parses to songs/creek/mix.

Nothing is left behind: no daemon, no generated files, no writes outside the repo.


Note

Medium Risk
Default label resolution for play/build/export-style commands changes globally; it must ship with the companion bloom migration or bare song builds fail with no matching labels.

Overview
Bare song shorthand now targets the output track, not the main mix. Songs-relative input like creek expands to //songs/creek/track:main instead of //songs/creek/mix:main. The change is in parsePattern in labels.ts (track:${SONG_OUTPUT_NAME}); explicit paths such as creek/mix:main still parse to the mix package.

This is intentionally one spelling with no mix fallback, paired with bloom’s migration so field build creek and migrated projects stay aligned.

check still errors when a renderable main track and a main mix both exist; the diagnostic now says a bare song name reaches the track (tests assert that wording). Docs in build-graph.md match: bare creek resolves to the output track; mixes/ still build but are no longer the default target before retirement.

Reviewed by Cursor Bugbot for commit cbdb611. Configure here.

@minjudd

minjudd commented Aug 8, 2026

Copy link
Copy Markdown

Starting review of cbdb611.

@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 cbdb611. Three findings — one P1 that I reproduced, and two stale claims the flag day leaves behind.

The change itself is small and internally consistent: parsePattern expands to track:, parseLabel tests move with it, the two-outputs message now says the bare name reaches the track, and the grammar is untouched so creek/mix:main still parses. pnpm typecheck is clean and the suite is 460 passed.

That green suite is part of the finding rather than reassurance about it. Nothing in it takes a song from field create to a bare-name reference, so the one path this change breaks is the one path no test walks.

The flag-day framing in labels.ts is the right call — a fallback really would be two ways to resolve one name — but a flag day is only safe if everything that assumed the old resolution moves in the same commit, and three things have not.

Comment thread src/labels.ts Resolved
Comment thread docs/build-graph.md Resolved
Comment thread src/labels.ts Resolved
@minjudd

minjudd commented Aug 8, 2026

Copy link
Copy Markdown

Starting review of a0df599.

@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 a0df599. Both documentation findings are fixed properly. The P1 is not fixed — it moved, and I reproduced the new shape of it.

The §3.4 amendment is the right kind: dated, quoting what it replaces, saying what changed and why, and stating explicitly that the shorthand still expands to exactly one label rather than trying track: and falling back — which is the question a reader of that decision would ask next. It sits inside item 4 so items 5 onward keep their numbers, which matters because §3.5 is cited two lines above it. build-graph.md:23 now matches, including the parenthetical, which was the half most likely to be left behind.

pnpm typecheck clean, suite 460 passed.

The suite passing is again not evidence about the path in question: the six test files that needed the mix restored show how much setup assumed createSong produced one, and none of them exercises create-then-play by bare name.

Comment thread src/commands/create.ts Resolved
Comment thread src/generators/inserts.test.ts Resolved
@minjudd

minjudd commented Aug 8, 2026

Copy link
Copy Markdown

Starting review of 9dfe2a6.

@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 9dfe2a6. The P1 is fixed at the root, and I verified it from outside the code rather than by reading the change.

Both reproductions that failed before now pass. A song with nothing in it answers to its own name — field song create creek alone gives resolveLabel: OK, because the scaffolded main is a stem rather than nothing. And the realistic path works without the hand-edit that was the whole complaint: create the song, track create keys, author a clip, and creek resolves, because createTrack placed keys into the output track.

Making an empty audio track render silence is the better of the two fixes available. The alternative — placing at creation while empty tracks stayed unrenderable — would have made every new song fail check until its first clip, which is the trap the previous comment described. This inverts it: silence is content, so the placement is legal from the moment the track exists, and the predicate stays one function that validate and the graph share.

I tested the claim about comments rather than taking it, since it is the kind that quietly stops being true. Writing a main.yaml with a header comment and an inline one on an insert, then running track create, keeps both and appends the placement in canonical key order. toJS() would have dropped them, and bloom's output track is exactly the file that carries such comments.

The daemon relaxation is scoped the way its comment claims. duration: 0 is now accepted, and an authored zero is still refused upstream — timeSpan is z.number().int().positive(), and a musical span that resolves to zero is caught in validate with "duration resolves to zero ticks". So the plan admits the resolved case without admitting the authored one, and -1 is asserted to stay refused where 0 used to be. Plan version moved to 6 on both sides.

The P3 is fixed too: both imports read import { mkdirSync, mkdtempSync, … } with the brace spacing restored and mkdirSync in the alphabetical run rather than appended.

Verified at this head: daemon rebuilt for version 6, pnpm typecheck clean, full suite 461 passed.

One thing I checked and am recording rather than filing, because it is transitional and harmless: a mix whose tracks: is omitted now counts the output track as a channel, since main is renderable and nothing places it. It is silent in the test that covers it, and a song that has both a main track and a main mix is the two-outputs error rather than this case — so the overlap is only reachable for a mix named something else, during migration, and mixes/ retires next.

No findings.

ninjudd added 3 commits August 8, 2026 17:32
`creek` meant `//songs/creek/mix:main`. It now means
`//songs/creek/track:main`, which is the other half of a flag day: bloom's
creek is expressed as a root track in the same breath, and neither half
works alone. Landing this without bloom's migration breaks `field build
creek`; landing bloom's without this breaks it identically from the other
side. Both were run to confirm that rather than assumed.

One spelling, not a fallback to whichever exists. A song with both is
already refused, and a fallback would be two ways to resolve one name.

The two-outputs message said "a bare song name reaches the mix". It now
reaches the track, so the message says that instead — the ambiguity is
unchanged, the direction of the silent answer is not.

`mixes/` still loads and still renders. Nothing points at one by default
any more, which is what makes retiring it next a subtraction rather than a
second flag day.
`field song create` scaffolded mixes/main.yaml, so with the shorthand
expanding to track: every song this tool has ever made became unreachable
by its own name — and the obvious recovery, adding tracks/main.yaml, hit
#78's two-outputs check telling you to delete a file the tool generated.
Reproduced both halves before changing anything.

So the scaffold moves: a song is born with tracks/main.yaml, empty, and no
mixes/ at all. That is the flag day being a flag day rather than the
shorthand and the generator disagreeing invisibly.

`field track create` deliberately does not place the track it creates. I
tried it, and a placement of a clipless track is refused for a real reason
— no clips means no stem, no node, and a dangling edge — so placing at
creation made every new song fail check until its first clip landed. The
convenience the mix's implicit "all audio tracks" provided does not
survive explicit containment, and inventing a replacement inside a flag-day
commit is how the wrong one gets built. It is called out where someone will
hit it, not left to be rediscovered.

Two docs findings with it. build-graph.md still said "a bare song name
plays its main mix" 158 lines above the paragraph this branch rewrote, in
the label-grammar overview a reader hits first. And project-core.md §3.4 is
`(DECIDED)` and said the same thing, cited by that stale line as its
authority — so it carries a dated amendment now, in the style of the three
it already had, rather than being silently diverged from.
The scaffold fix moved the P1's cause from missing to empty: `tracks/main.yaml`
existed but had no clips and no inputs, so `renderableTrack` filtered it out,
it got no node, and the label the bare name resolves to still did not exist.
Justin's call closes it — an empty audio track renders as the silence it
contains, which is a stem rather than no stem.

That makes three things fall out. A scaffolded `main` is addressable the moment
it exists. `field track create` places each track it makes into the output,
which is the half of the mix's implicit "all audio tracks" people relied on and
which was illegal an hour ago. And a placement of an empty track resolves to a
zero-length window, so the daemon accepts `duration: 0` — only there, because
that length is resolved from a rendered child rather than authored, and an
authored zero-length clip stays refused where `timeSpan` is positive.

The check that refused placing an empty track is gone; midi is the only
unplaceable kind now, having no stem at all. Its test asserts the opposite of
what it used to.

Three test fixtures needed renaming rather than patching, and the reason is the
feature working: a mix called `main` beside a scaffolded output track is the
two-outputs error, so a test about mix membership had to stop calling its mix
`main`. One asserted a track's own fader does not reach its stem key; the level
lives on the placement now, so it moves there and asserts the same thing about
the parent.

The import brace spacing from the previous commit is fixed, alphabetised with
the run it joined.

creek still renders bit-identically through all of it — both outputs, same two
hashes.
@ninjudd
ninjudd force-pushed the tracks/bare-name-to-track branch from 9dfe2a6 to 7a9bca0 Compare August 9, 2026 00:33
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of 7a9bca0.

@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 7a9bca0 — a rebase onto main after #80 merged, carrying no new work.

The three commits replay unchanged. Comparing the PR-scoped ranges directly — 8247eed..9dfe2a6 against c59d09b..7a9bca0 — they are identical byte for byte, blob hashes included, so not a line of this PR's own content moved. What arrives between the two heads is #80's AGENTS.md and README change and the removed workflow, reaching this branch through the base rather than through the rebase touching anything here.

Re-ran the gate rather than resting on the approval of 9dfe2a6, since the base changed underneath it and a clean base does not vouch for the child: pnpm typecheck clean, full suite 461 passed at this exact head, working tree clean. Same counts as before, which is what an identical range against a docs-only base change should produce — and worth having confirmed rather than assumed, because "docs-only" is a claim about the base I would otherwise be taking on trust.

Everything from the 9dfe2a6 review stands: a new song answers to its own name with nothing in it, track create places into the output track and preserves comments while doing so, and the daemon's zero-duration relaxation stays scoped to the resolved case with authored zero still refused by timeSpan.

No findings.

@ninjudd
ninjudd merged commit 55f9160 into main Aug 9, 2026
1 check passed
@ninjudd
ninjudd deleted the tracks/bare-name-to-track branch August 9, 2026 00:39
@minjudd minjudd mentioned this pull request Aug 9, 2026
ninjudd added a commit that referenced this pull request Aug 9, 2026
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.
ninjudd added a commit that referenced this pull request Aug 9, 2026
The tool and the only real project using its format lived in two repos,
so a change to one could not be tested against the other. That cost most
of a day: field #79 moved the bare song name to `track:main` while bloom
sat unmerged and `field build creek` was broken with no test anywhere
able to notice; `tall-grass` was missed by a migration because creek was
what I looked at; a track fader went silent where the five files
carrying one were somewhere a test could not see. A test can only see
one repo — that is the whole argument, and CI running `field check` here
would have caught all three.

**Copied, not migrated.** This repo squash-merges into a linear history,
so bloom's commits could not have survived the merge however they
arrived; a submodule would have kept two repos and added a pointer to
forget to bump. The history goes with the old repository, which is being
deleted.

**No audio comes with it.** All seven WAVs stay behind, both generative
recipes ship with `variants: []`, and whoever clones generates their own
takes — which is what [chunk
1](okamnesiac/field#83) made expressible. Two
people's bloom sounding different is the demonstration, not the cost: a
project *is* its recipes. It also means no Git LFS in a TypeScript repo,
and no generated audio arriving in review where a diff says nothing.

Two files could not simply be dropped, because something referenced
them.

`water` was downloaded and then normalized, so its pin describes the
*processed* bytes — a download rule has to be `download` → `normalize`
with the pin on the output, not a URL field on the ledger. That is its
own plan, so the example drops it: the shared pin, the bytes, creek's
`water` track, and that track's placement in `main`. creek loses its
ambience.

tall-grass's 7/8 loop was a recording. It is now
`shared/instruments/seven-eight-loop.scd` — a seeded program rendering
the same two bars of 3+2+2 at 132, which needs no committed bytes and is
bit-reproducible. `drums.yaml` and `loop-cd.yaml` still say `source:
seven-eight-loop`, because a clip's source resolves a sound exactly as
it resolved an asset.

Both ledgers go with the last pins they held. A project committing no
audio carries no ledger; `field import` writes one when there is
something to write down.

The README is rewritten rather than copied: it described committed
audio, LFS, and a water recording, and it claimed tall-grass renders
without SuperCollider — which stopped being true when its loop became a
program. It now opens with what is missing and why, and a **Generating**
section is the first thing after setup.

CI is deliberately not here. That is chunk 3, and it deserves its own
change because the way to review it is to break a schema and watch the
example catch it — which is a different exercise from reading a file
copy.

## Testing

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

456 tests, unchanged: this adds no code. Then the example itself, which
is the actual subject:

```
cd ~/amnesiac/field/examples/bloom
field check
field build tall-grass
```

`ok`, then four built labels ending in `//songs/tall-grass/track:main`.
**tall-grass building on a fresh clone with no audio in the repository
is the claim this whole PR rests on** — every sound in it is a recipe,
so if `seven-eight-loop` had been dropped rather than replaced you would
get `references unknown source` here instead.

creek is the other half, and it must *fail*:

```
field build creek
```

`//songs/creek/sound:still-water-keys has no takes yet — field generate
still-water-keys --song creek --seed <n>`. If this builds, audio got
committed by accident. If it says `no such label`, the takeless recipes
are malformed rather than empty.

Then the README's own sequence. With the real workers installed it is
the two `field generate` lines from **Generating**; without them, the
stub worker exercises the same path:

```
cd /tmp && rm -rf bloom-clone && cp -R ~/amnesiac/field/examples/bloom bloom-clone && cd bloom-clone
export FIELD_ACED_PYTHON=~/amnesiac/field/src/testing/stub-worker.mjs
export FIELD_VOICED_PYTHON=~/amnesiac/field/src/testing/stub-worker.mjs
field generate still-water-keys --song creek --seed 90210 --variants 2
field generate lead-take --song creek --seed 4823 --variants 3
field check
head -3 songs/creek/sounds/lead-take.yaml
```

`ok`, and the recipe still opens with its comment — filling edits the
file in place, so a shipped example's annotations survive. Note that
neither command passes `--prompt` or `--text`: the recipe is the
request, and a flag repeating it is refused.

Stop there with the stub. `field build creek` after a stub generate
fails on `not a RIFF/WAVE file`, because the stub writes text rather
than audio — that is the stub, not this change, and it is why the two
builds above use tall-grass and the *refusal* from creek as the real
assertions.

The audio is genuinely absent, which is the definition of done for this
chunk:

```
cd ~/amnesiac/field && git ls-files examples/bloom | grep -c '\.wav$'
```

`0`. And `git ls-files examples/bloom | wc -l` is `36`.

Clean up with `rm -rf /tmp/bloom-clone`. Building inside
`examples/bloom` leaves a `.field/` there, which its own `.gitignore`
covers.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation and example YAML/SCD only; no application code or CI
changes in this PR.
> 
> **Overview**
> Adds the **bloom** Field project under `examples/bloom` so the
format’s real consumer lives in the same repo as the CLI (CI wiring is a
follow-up chunk). The tree is **36 tracked files and zero WAVs**:
recipes, tracks, and SuperCollider programs ship; generated takes stay
local via `.gitignore`.
> 
> **Copy-time edits** from the standalone repo: creek’s shared **water**
ambience and its ledgers are removed; tall-grass’s **seven-eight-loop**
becomes a seeded `supercollider` sound (`seven-eight-loop.scd`) instead
of a recording. Creek’s **still-water-keys** and **lead-take** use the
new takeless generative shape (`variants: []`).
> 
> The **README** is rewritten for “no audio in git”—setup, `field check`
on a fresh clone, generating creek’s missing takes, and building
**tall-grass** from recipes only. Plan docs (`bloom-in-tree.md`,
`now.md`) mark chunk 2 done and note deleting `okamnesiac/bloom` instead
of archiving it.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5ac4896. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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