Repository navigation
Musical time arrays: [bar, beat?, tick?] in project YAML - #24
Merged
Merged
Conversation
Scalars stay ticks; arrays are musical, resolved through the song's meter map at load. Positions are ordinal and 1-indexed ([9, 2] = bar 9 beat 2, no bar 0); spans are cardinal and zero-legal ([4] = four bars, [0, 2] = two beats), advanced from the field's anchor so meter changes mean what a musician means. Fields: clip position/duration, loop.every, arrangement section at, song length. The schema validates shape only; the model layer resolves and diagnoses (beat ranges need the meter map), and the graph never sees an array — either spelling of a time is the same action key (verified on field: converting creek to [12]/[4] was a full cache hit). Arrays emit single-line via a KeyOrder flow flag, the one recorded exception to block style; fmt preserves the author's notation. Plan with the decision record in docs/projects/all/musical-time.md; clip-looping status updated to complete.
ninjudd
commented
Aug 6, 2026
ninjudd
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed at head 240ea48 (in place). CI is red on this head and the failure is real: pnpm typecheck fails with 6 errors — vitest's 216/216 is genuine (I re-ran it), but typecheck is part of the CI gate and fails locally too. Details inline on the Track export. One P3 besides (a doc-vs-behavior gap on loop.every across meter changes). Everything else verified clean — including the cache guarantee proven live on real data.
- P2 — typecheck fails: the resolved-type promise and the raw-parse test fixtures disagree. Inline on
schemas.ts:433. Blocking by construction (CI is red), mechanical to fix. - P3 —
loop.everyarrays resolve once at the clip's anchor, so repetitions that cross a meter change don't stay on the authored musical interval — while §1.4's text promises they would. Inline onproject.ts:490.
Verified by execution:
- §1.6 on real data: field's drums clip — authored in ticks yesterday, since converted to
position: [1]/duration: [12]/every: [2]— checks clean, and both the drums stem and the mix come backcached: byte-identical action keys across the notation rewrite, on exactly the clips whose tick spelling I had verified byte-for-byte.bloom fmtcalls the array spellingalready canonical. - Diagnostics, all four probed through the real CLI with named messages: absolute-clip array (
musical arrays need anchor: musical), zero-resolving span,beat 5 out of range for 4/4 at bar 1, and a validposition: [1, 2]/duration: [0, 2]clip that builds. - vitest 216/216 at this head; the 6
tscerrors are all inmix.test.ts/track-render.test.tsfixtures, none in production code.
Verified by reading, no issues found:
- The raw-vs-resolved type split (
*Fileinternal, resolved exported) is the right shape, and the load-boundary casts are honest because validate resolves-or-diagnoses every array beforeloadProjectreturns — nothing past the check gate can meet an array. MeterMap.parsenow delegates topositionTicks, so--from, the play readout, and YAML arrays share one resolver — one grammar, one set of range errors.clearFlowpre-dates this PR, soflowCollectionPadding: falsecan't shift canonical text of any existing file — flow only ever appears via the new per-key flag, and empty collections render[]regardless. The §1.7 exception is precisely scoped.- Span semantics (cardinal, zero-legal, stepping at the meter in force at the moving position) match the tests, including 7/8 and mid-span meter changes; the ordinal/cardinal split with its zero-ambiguity rationale is the kind of decision record that will save a future argument.
- The v1 field list and both deferrals (tempo/meter
atself-reference; takepositiondual-representation) are reasoned, not just listed.
One process note, gently: the PR body's "216 tests pass" was true and is also why this slipped — vitest transpiles without type-checking, so pnpm typecheck is the half of the local gate that would have caught it before CI did.
…pan caveat The two test fixture helpers hand trackSchema.parse output (file types, number | number[]) to planMix/planTrack, which take the resolved types — cast, true for the same reason the loader's cast is true: fixture times are scalar ticks. musical-time.md §1.4 and project-model.md now record that a span resolves once at its anchor, so loop.every repetitions past a mid-window meter change keep the anchor-time interval.
This was referenced Aug 6, 2026
ninjudd
added a commit
that referenced
this pull request
Aug 10, 2026
nested-tracks is Active — chunk 4 is revived by #123 and the soak holds either way; Shipped was the one indefensible value. The three stale prose lines are updated to what actually happened (voice generation through #64/#65 and the #113 fold, effects through #14/#15 with the §6 executor move, musical time through #24), so the keyword and the prose agree on day one. The README claims adoption, not sharing, while agent-config#15 is still open.
ninjudd
added a commit
that referenced
this pull request
Aug 10, 2026
Project documents here carried their state as prose alone, which reads well and machine-reads not at all. The shared convention now specifies YAML frontmatter with a `status:` keyword on every document in `all/` (ninjudd/agent-config#15 has the convention and the review-gate semantics it feeds): the keyword carries the claim, the prose `**Status:**` line keeps the why — which PRs carried the work and what is left — and `Draft` specifically declares a plan not yet claiming to be executable, so its open questions stop blocking its pull requests; the PR that flips it out of Draft answers for them. This adds the frontmatter to all 18 documents and rewrites the README's "What goes in a document" section around the split. The README's old argument — prose rather than a keyword, because the useful thing to say is which PRs and what is left — is kept rather than overturned: the prose line still says exactly that, and the keyword takes only the claim the prose was never good at exposing to tooling. No `owner:` field — one person to ask here. Statuses were derived from each document's own prose cross-checked against the three lists, not from the prose alone, which surfaced three stale status lines: effects.md and musical-time.md say "In progress" but their chunks all shipped (`inserts:` chains are live in bloom's creek tracks and the master chain; musical time arrays landed in #24), and voice-generation.md says "nothing here has yet loaded the model" while now.md records that creek sings. All three are `Shipped` in frontmatter with their prose untouched, per the convention that a finished plan is not rewritten to match later reality — the frontmatter is the correction. The tally: 16 `Shipped`, 2 `Draft` (automation.md, splice.md — both designs with no code, on later.md). Nothing lands on `Active`, `Blocked`, or `Stalled`: the five now.md lines are all soak-period entries whose plans completed, which is this repo's documented keep-the-line convention doing its job. ## Testing From the repo root, on this branch: ``` grep -L '^status: ' docs/projects/all/*.md grep -h '^status: ' docs/projects/all/*.md | sort | uniq -c ``` The first prints nothing — any filename it prints is a document the sweep missed. The second prints exactly `2 status: Draft` and `16 status: Shipped`. The claim that would show a wrong call: a `Draft` document appearing on `now.md`, since Draft means implementation not started — `grep -l 'status: Draft' docs/projects/all/*.md` returns only automation.md and splice.md, both linked from later.md alone. Docs-only; nothing to build, no state left behind. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only changes to project plan markdown; no runtime code, build graph, or data paths affected. > > **Overview** > Project plans in `docs/projects/all/` now carry a one-line YAML `status:` keyword in frontmatter, with `docs/projects/README.md` rewritten to define the convention instead of prose-only status. > > The README documents a fixed keyword set (`Draft`, `Active`, `Blocked`, `Stalled`, `Shipped`, `Superseded`, `Abandoned`, `Reference`), splits responsibilities so frontmatter is the machine-checkable state of record and the existing `**Status:**` line keeps PR history and what’s left, and explains that **`Draft`** means the plan is not yet claiming to be executable (so open questions in Draft plans don’t block their PRs). When keyword and prose disagree, that’s treated as a bug to fix. > > All 18 documents in `all/` get frontmatter: **16 `Shipped`**, **2 `Draft`** (`automation.md`, `splice.md`). Three plans are marked `Shipped` in frontmatter while their prose still says in progress or unstarted—`effects.md`, `musical-time.md`, and `voice-generation.md`—because implementation had already landed; prose is left as historical per the “don’t rewrite finished plans” rule. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 178e7e5. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scalars stay ticks; arrays are musical, resolved through the song's meter map at load — the numbers musicians think in, in the files they author.
at: [9, 2]is bar 9 beat 2, there is no bar 0; spans are cardinal and zero-legal —duration: [4]is four bars,every: [0, 2]is two beats — advanced from the field's anchor through the meter map, stepping bars and beats at whatever meter is in force, so a span crossing a meter change means what a musician means by it. Dotted strings were rejected:1.3is a YAML float, and a forgotten quote silently means a different number.--fromkeeps its dotted form — a shell arg is not YAML.position/duration,loop.every, arrangement sectionat, songlength. Musical arrays requireanchor: musical; on absolute clips they are an error, not a conversion. Deferred: tempo/meter eventat(self-referential enough not to rush) and takeposition(recorder-written, dual-representation).MeterMapand diagnoses ranges (beat 5 out of range for 4/4 at bar 2), misanchoring, zero-resolving spans, and arrays with no valid meter map. Resolution rewrites arrays to tick scalars at the load boundary, so the graph never sees an array and either spelling produces the same action key — verified on field by converting creek tolength: [12]/duration: [12]/every: [4]: every target was a cache hit.KeyOrdergains a per-keyflowflag — time arrays stay single-line (length: [12]), the one recorded exception to block style;flowCollectionPadding: falsekeeps them unpadded.fmtpreserves the author's notation: scalar stays scalar, array stays array.Tests: meter-map ordinal/cardinal resolution through meter changes and 7/8; flow emission and comment preservation; load-time resolution, array-vs-tick load equality, and each diagnostic. 216 pass.
Note
Medium Risk
Changes the project load/validation boundary for timeline fields across songs, clips, and arrangements; incorrect resolution would affect mix length and placement, though tests and cache-equivalence with tick spellings reduce regression risk.
Overview
Project YAML time fields can now be written as musical arrays (
[bar, beat?, tick?]) as well as tick scalars. Scalars still mean ticks; arrays are musical and are resolved through the song's meter map at load—downstream code and the build graph only see tick numbers, solength: [12]and an equivalent tick value yield the same build/cache behavior.Resolution and validation happen in
loadProject/validate: ordinal positions (e.g.at: [9, 2]), cardinal spans (e.g.duration: [4],every: [0, 2]), songlengthfrom bar 1, and clip spans anchored at clip position. The schema checks array shape only; beat/tick range, zero spans, missing meter map, and musical arrays onanchor: absoluteclips are diagnosed explicitly.MeterMapaddspositionTicksandspanTicks(meter changes included);parsedelegates topositionTicks.Canonical YAML adds a per-key
flowflag so time arrays stay single-line (length: [12]);fmtpreserves scalar vs array choice.Docs add musical-time.md and cross-links; clip-looping is marked complete in planning docs.
Reviewed by Cursor Bugbot for commit 240ea48. Configure here.