Skip to content

One inputs list: track, audio, and sound entries - #102

Merged
ninjudd merged 5 commits into
mainfrom
tracks/one-inputs-list
Aug 9, 2026
Merged

ninjudd merged 5 commits into
mainfrom
tracks/one-inputs-list

Conversation

@ninjudd

@ninjudd ninjudd commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

nested-tracks.md §18's first step, the format alone: clips: and inputs: merge into one inputs: list whose entries name what they play by field — track:, audio:, or sound:. The sound: field is §18's transition made explicit: it exists exactly as long as sounds/ does, so audio: never quietly accepts a name that renders — that would rebuild the bytes-versus-definitions ambiguity kind-in-field exists to remove. Placement fields are uniform across kinds, every entry may carry an id: (automation's handle, §18 decision 3, with per-track uniqueness checked), position: becomes at:, and type: retires — every track is audio, and midi returns as an entry kind when it is real. Old spellings forward the way mixes/ did: clips:, type:, position:, and source: each get a message naming the move, not an unrecognized-key shrug.

The planner needed almost nothing, which is the evidence the format was the thing lying: planTrack has sorted the two lists into one placement plan since placements existed, so this PR mostly deletes the second spelling (net −153 lines). Validation becomes one entry loop with per-kind resolution — audio: refuses a sound's name pointing at sound:, and vice versa — and the containment-cycle walker, explain's level answer, and the loop rules (every required on renders-later sources) all speak entries. Diagnostics on a bad reference stay non-fatal to time resolution, matching how clip sources always behaved.

One real behavior note: tall-grass's guitar was the only type: midi track in bloom; it becomes an ordinary empty track that renders silence and that nothing places. field track create loses its --type flag, and scaffolded tracks are written as name + inputs: [].

Generator entries (supercollider:, generative:) are deliberately absent — they are §18's next two steps, and this PR is the flag day they land on top of.

Review fixes folded in: loop repetitions carry the entry's pan (uniform fields made a panned loop expressible, and expansion must equal the hand-tiled equivalent — pan included), an unchosen generative sound is one diagnostic rather than a false "unknown" stacked on the choose message, the generative example in project-model.md says sound:, and the comment that claimed checkSource's messages were shared with the entry path now says the sites are separate on purpose.

Testing

From the repo root:

pnpm build && pnpm typecheck && pnpm test

510 tests pass, every fixture migrated to the new format. The exactly-one-kind rule is mutation-proven: disabling the schema's arity check turns its test red.

cd examples/bloom
field check
field explain creek/track:drums | grep '^action:'
field build creek/track:main
field build tall-grass/track:main

check says ok on the fully migrated example. Drums prints action: 6cd170a1cbfe (cached) — the same key it has carried since before #100 — and both songs come back entirely cached (creek: 10 cached + 2 source, tall-grass: 4 cached). This is the PR's core claim made falsifiable: entry spelling is wiring, the resolved placement plan is byte-identical, so a format flag day re-renders nothing. If any resolved field had drifted — an offset defaulting differently, the sort order moving — these commands are where it would show, as built lines and a moved drums key.

What wrong looks like — the forwarding messages on an old-format file:

printf 'name: drums\ntype: audio\nclips:\n  - id: k\n    source: kit-punch\n    position: [1]\n' > songs/creek/tracks/drums.yaml && field check
git checkout -- songs/creek/tracks/drums.yaml && field check

The first prints two migration messages ("every track is audio — delete type:…" and "clips: merged into inputs: — move each clip there, renaming position: to at: and source: to audio:/sound:/track:…"), plus a cascade from phrase losing sight of drums; the second restores and says ok.

I also ran field check and field arrangement creek from a clean git archive HEAD examples/bloom export — ok, and the structure prints as before — so nothing depends on this checkout's caches. scsynth is not on my PATH; nothing here needed it, because no SC action key moved and the cached renders satisfied every build.

State left behind: an audiod daemon in examples/bloom (field quit stops it), and .field/out/songs/tall-grass/ now exists from the first tall-grass build in this checkout.

nested-tracks.md §18 step 1, the format alone: clips: and inputs: merge
into one inputs: list whose entries name what they play by field —
track:, audio:, or the transitional sound:, which exists exactly as
long as sounds/ does so audio: never quietly accepts a name that
renders. Placement fields are uniform across kinds, entries may carry
ids (automation's handle, §18 decision 3), position: becomes at:, and
type: retires — every track is audio, and midi returns as an entry kind
when it is real. Old spellings get forwarding messages, mixes/-style.

The planner needed almost nothing: it has sorted the two lists as one
since placements existed, so the file format caught up with the plan.
Every action key survives — drums stays 6cd170a1cbfe through the whole
migration and both bloom songs rebuild fully cached.

tall-grass's guitar was the one real type: midi track; it becomes an
ordinary empty track that renders silence and nothing places.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of 229d2f4.

@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 229d2f4. Configure here.

Comment thread src/generators/stem.ts Resolved
minjudd
minjudd previously approved these changes Aug 9, 2026

@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 229d2f4. A flag day whose whole claim is that nothing moves, so I went at the claim rather than the diff.

The plans are identical, 12 of 13. Comparing explain's input: lists and parameters for every track in creek and tall-grass, origin/main against this head: byte-identical everywhere except tall-grass/guitar, which had no node at all on main and now has type: stem v1, parameters: {"clips":[]}. That is the ex-midi track becoming an empty audio one, which the body calls out as the single behaviour change. So no existing key can have moved, independently of the cached-build proof.

The structure survived the rewrite, seen from outside the planner. A clean git archive export of examples/bloom checks ok, and field arrangement creek prints the same five lines it printed before the format existed — 1.1.1 lead-vocal, pad, and the three phrase passes at 1, 5, 9. Different file format, same song.

The migration messages name the move. An old-format drums.yaml gets both, each written for the suffix: every track is audio — delete type:… at type and clips: merged into inputs: — move each clip there, renaming position: to at: and source: to audio:/sound:/track: by what it names… at clips.

The rules that keep the format honest all fire. Zero kinds and two kinds get the same sentence (an entry plays exactly one thing…), which is right — they are the same mistake from opposite sides. duplicate input id "dup-a1b2c". audio: kit-sc is refused by kind, not by existence: audio: names the sound "kit-sc" — a sound is a definition, not committed bytes; use sound:, which is the thing that keeps audio: from quietly reacquiring the ambiguity. The cycle walker speaks entries (phrase → drums → kit-punch → phrase) and self-placement keeps its own message.

The scaffolding path works end to end, which the flag day could easily have broken: field track create demo bass writes name: bass + inputs: [] and adds - track: bass / at: 0 to main, and check is ok.

pnpm typecheck clean; 509 tests, the 58 failures here all field-audiod is not built.

One thing I checked rather than assumed: sound: is a fourth spelling that §18's decision list does not contain, and it is documented where it has to be — project-model.md carries it, transitional nature and all, and that is the doc AGENTS.md requires to be current. §18 stays the point-in-time record, with the status line above it naming the three spellings that actually shipped.

The cached-build half of the gate — drums at 6cd170a1cbfe, both songs coming back entirely cached — is still yours, not mine: no daemon and no warm cache here.

No findings.

Bugbot finding on #102: expandLoop never copied pan onto repetitions —
unreachable while only clips looped (clips had no pan), real once
placement fields went uniform. A looping panned entry rendered centred
and its key ignored pan edits. Repetitions now carry pan under the same
omit-when-centred rule as the direct path, so a loop still hashes
identically to its hand-tiled equivalent — which is the new test, proven
failing first. bloom unaffected: its one loop is centred, drums stays
6cd170a1cbfe and creek rebuilds fully cached.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of f1ed61d.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 229d2f4849

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/model/project.ts Resolved
Comment thread docs/project-model.md Resolved
Comment thread src/generators/stem.ts Resolved
minjudd
minjudd previously approved these changes Aug 9, 2026

@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 f1ed61d. This is a real bug the format created and I did not catch — a looped entry silently rendered centred — and the fix is right in the way that matters: the loop's output now equals the hand-written tiling exactly, rather than merely carrying a pan.

Reproduced across the two heads. Giving creek's drums entry pan: -0.5 beside its existing loop:

229d2f4   {"start":0,...,"gain_db":0,"fade_in":0,"fade_out":0}          ← no pan, twice
f1ed61d   {"start":0,...,"gain_db":0,"pan":-0.5,"fade_in":0,"fade_out":0}

And the contract the test names holds against a real project, not just the fixture: hand-tiling the same thing as two 2-bar entries at bars 1 and 3, each panned, produces a parameters string byte-identical to the looped one. That is the strongest form of "expansion matches the hand-written equivalent", and it is what makes the fix a restoration rather than an addition.

Worth being precise about the blast radius, since it decides whether this needed to land before the merge: nothing in bloom pairs a loop with a pan, and all 13 tracks plan byte-identically to 229d2f4. So no key moves, nothing re-renders, and the bug was latent — which is exactly why it would have shipped. A pan that is silently dropped produces audio nobody can tell is wrong from the file, and check had nothing to say about it.

The omit-when-centred rule is preserved, so the fix cannot re-key a centred loop: pan is spread in only when non-zero, the same as the direct path.

pnpm typecheck clean, and the new test passes on its own — the 22 failures in stem.test.ts here are the daemon-dependent execute cases, all field-audiod is not built.

Credit where it is due: Bugbot found this, not me. I compared plans across the format change and read the entry schema, and a pan that survives to the schema but not through expandLoop is exactly the gap that comparison cannot see, because bloom has no entry that would show it.

No findings.

ninjudd added 2 commits August 9, 2026 12:52
Codex finding on #102: the unchosen branch pushed its choose diagnostic
and then fell through to the unknown-name check, whose predicate did not
know the unchosen state — a sound that exists was also reported unknown.
Introduced when kind checks went non-fatal. The predicate now counts
unchosen among the names that exist; test proven failing first.
Codex finding on #102: project-model.md still told readers to write
source: <name> for a generative reference, which the schema this PR
ships refuses. It now says sound: <name>, the transitional kind field.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of 1cb54e6.

@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 1cb54e6. The fix is right and I reproduced it on both heads; one finding, and it is a comment rather than code — the sign saying these two sites cannot drift is still up, in the file that no longer shares them.

The false second message reproduces, and is gone. An unchosen generative sound named by an entry, diagnostics on each head:

f1ed61d   input "intro" sources "keys", which has no chosen variant yet — field choose keys first
          input "intro" references unknown sound "keys"          ← false: keys is right there in sounds/
1cb54e6   input "intro" sources "keys", which has no chosen variant yet — field choose keys first

The second sentence was the worse half of the pair: it says the name does not resolve, which sends you looking for a typo, while the first says the name resolves fine and needs a choose. Two answers to "what is wrong here", and the wrong one reads as the fatal one.

The three sibling states are untouched, which is what makes this a suppression rather than a rule change — same probe, same output on both heads: audio: keys on the unchosen sound still gets only audio: names the sound "keys" … use sound:; a takeless recipe still gets nothing at all (bloom-in-tree.md §3, a request rather than an error); sound: nope still gets references unknown sound "nope". All four states of a generative sound — chosen, unchosen, takeless, absent — now answer through sound: the way they answer through a recipe's source:.

The change can only ever remove a diagnostic, and the guard it adds tests the same set as the push directly above it, so there is no gap where the choose message goes missing and the unknown one is suppressed anyway. pnpm typecheck clean; 257 pass and 16 skip across src/model, src/commands, and src/schema — none of that subset needs the daemon, so it is green here rather than merely un-run.

The doc line is correct: an entry does say sound: <name>. I checked the five source: mentions left in docs/ rather than assuming the sweep should have taken them too, and they are a different field — a sound recipe's own source:, which still exists and still resolves in the song's one namespace, so project-model.md:210's "source: pad must mean exactly one thing" holds as written.

Comment thread src/model/project.ts Resolved
minjudd on #102: checkSource's comment still vouched that its messages
were shared with the entry path so the two sites could not drift — false
since the entry loop went per-kind, and the false second diagnostic this
PR already fixed is exactly the drift it promised against. Both comments
now say what is true: checkSource serves a sound's source: with one
caller, and the entry path resolves per kind on purpose, because its
messages name the field and a shared kind-blind one cannot.
@minjudd

minjudd commented Aug 9, 2026

Copy link
Copy Markdown

Starting review of 79ec234.

@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 79ec234. Comment-only, and I checked that literally: zero changed lines in the diff are anything but a comment, so no test run could come out differently and I did not pretend one was evidence.

What I did verify is that the new comments say true things, since that is the entire content of the commit.

  • "One caller: validateSingleInput, below" — checkSource is defined at single-input.ts:25 and called at :55, and nowhere else in src/. The header now describes the function's real reach instead of a sharing arrangement it lost.
  • The reason it gives is the reason. unknown audio and unknown sound are both really there (project.ts:747, :771), and checkSource really does say references unknown source — so "kind-blind" names a property of the code rather than a rationale invented after the fact.
  • The citation that got promoted from bare to explicit landed on the right section. The old comment said "the whole visibility rule (§1.5)" with only a project-layout.md reference upstream of it to anchor the number, and this file cites nested-tracks.md §1.5 elsewhere for a track's local timeline — so making it explicit is exactly where a rewrite can silently pick the wrong document. project-layout.md §1.5 is audio/ is all of a song's committed sound, whose text is "enforced visibility, not content: a clip can only reference its own song's ledger plus shared/ — the system checks this." That is the rule, and §18 is still §18 with §17 unmoved above it.
  • "The one cross-scope spelling is audio: //shared/asset:" holds at the schema, which is where it has to: audio is sourceRef, track and sound are slug, so no other entry kind can spell a label at all.
  • "Entry references" is now the accurate word for the block, not just the current one. The header introduces fileBySource, whose only call site is fileBySource(entryRef(entry)) in the loop check at :833 — so the paragraph describes the code beneath it more closely than "Clip sources" did even before clips retired.

Reworded rather than re-shared is the right call for the reason your reply gives, and it leaves the two sites separate on the record — which is the part that makes the next drift a decision instead of an accident.

No findings.

@ninjudd
ninjudd merged commit e5189a0 into main Aug 9, 2026
1 check passed
@ninjudd
ninjudd deleted the tracks/one-inputs-list branch August 9, 2026 20:20
ninjudd added a commit that referenced this pull request Aug 9, 2026
nested-tracks.md §18 step 3: a track entry may hold an inline
`generative:` block — the sound schema's request fields verbatim (prompt
or text, plus conditioning), written where they play. The entry mints a
`gen:` node under step 2's naming rule, but nothing in the build may run
it: the node resolves to the chosen take, every take auditions as
`gen:<name>-<n>`, and a request with no takes fails resolution naming
the `field generate` that fills it.

Decision 3 amended as designed on concrete files: the required id fell.
Takes key on the gen node's name — the owning track's, or `<track>-<id>`
— so run-recorded state lives in `audio/<name>/variants.yaml` with a
`gen:` first key (`sound:` stays for the transitional sounds), and the
common leaf fold moves no files: `still-water-keys` folded and its audio
directory never moved, only the file's first key renamed, a move the
check diagnostic tells a pre-fold file to make. `field generate` and
`field choose` resolve gen node names, so the sole-entry leaf reads as
`field generate still-water-keys --song creek` — the exact command the
file's comment has always shown.

The track file never changes when audio is generated or chosen — the
design constraint stated in the leaf-content discussion, asserted at the
byte level by a test. It is also why a voice entry authors
`voice_ref_sha256` up front (the schema already pairs it with
`voice_ref`): the run verifies the snapshot against it and refuses a
drifted voice, instead of writing the hash back the way the sound path
fills its recipe.

Namespace guards grew to match: a generative entry may not mint a name a
sound or an asset holds (both claim `audio/<name>/`, which imports also
land in since #104), check says so, and the import pre-flight now reads
generative entry names from tracks/ so the collision is an upfront
refusal rather than a check-red project after the copy. The gen-name
collision check covers both generator kinds, so an un-id'd generative
and an un-id'd supercollider in one track collide with the
give-each-an-id message.

The fold's cache story is the amended decision 6 exactly, with a better
ending than kit-punch's: `keys` re-keyed once (its input moved from the
raw take to the wrapper stem) and re-rendered byte-identically —
`be389af6d73b…`, the hash it had before the fold — so `phrase` and
`main` never re-keyed at all and print `cached`. `lead-take`
deliberately does not fold: `vocal-48k` (a normalize sound) sources it
and a sound cannot see a track; it waits for multi-rate step 3, recorded
in the plan intro beside seven-eight-loop's identical deferral.

## Testing

From the repo root:

```
pnpm build && pnpm typecheck && pnpm test
```

549 tests pass (31 new: entry-takes loading and its diagnostics, the
graph shape and never-runs proof, generate/choose end-to-end against the
stub worker including the track-file-untouched byte assertion, the
namespace guards, and the review round's pins — tampered takes and
drifted voice references flagged by check, fmt coverage for takes files
on both sides, the orphaned-takes-directory scan, and generate/choose
refusing an asset-owned name and a mis-attached takes file).

```
cd examples/bloom
field check
field build creek/track:main
field query 'deps(//songs/creek/track:keys)'
```

`check` says `ok`. The build prints `source
//songs/creek/gen:still-water-keys →
songs/creek/audio/still-water-keys/1.wav` — a `built` line on that gen
node is what wrong looks like, because it would mean the build ran a
deliberate generation. `deps` prints the three-line leaf shape:
`gen:still-water-keys`, `track:still-water-keys`, `track:keys`. On a
warm pre-fold cache, `track:still-water-keys` and `track:keys` build
once and `phrase`/`main` stay `cached` — the downstream cache surviving
is the proof keys re-rendered byte-identically (`shasum -a 256
.field/out/songs/creek/track/keys.wav` still prints `be389af6d73b…`).
Without my cache the same claim is checkable via `field explain`: keys'
`parameters` are byte-identical across the fold, so only the input hash
moved.

```
field choose still-water-keys --song creek --variant 2
field build creek/track:main
field choose still-water-keys --song creek --variant 1
```

`choose` prints the gen spelling (`//songs/creek/gen:still-water-keys
now plays it; every placement follows` — before this PR it claimed a
`sound:` label and said `source:`, a spelling #102 retired). The first
build after switching takes rebuilds exactly the keys chain — different
take, different bytes, so `still-water-keys`, `keys`, `phrase`, `main`
rebuild and nothing else does — and both renders then live in the action
cache, so flipping between takes after that is entirely `cached`:
variant A/B-ing is a one-line diff each way and zero renders once both
have been heard.

I also verified the fresh-clone story from a `git archive` export (no
takes — audio/ is git-ignored): `field check` says `ok`, and `field
build creek` refuses with `//songs/creek/sound:lead-take has no takes
yet — field generate lead-take --song creek --seed <n>`, which is the
message the README now quotes (it used to quote still-water-keys' — the
fold changed which request the build reaches first). Generating on this
machine is stub-tested only; no model workers are installed here. State
left behind: an `audiod` daemon in `examples/bloom` (`field quit` stops
it).
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