Skip to content

Split the schema monolith into per-domain files under src/schema/ - #28

Merged
ninjudd merged 1 commit into
mainfrom
refactor/schema-split
Aug 6, 2026
Merged

ninjudd merged 1 commit into
mainfrom
refactor/schema-split

Conversation

@ninjudd

@ninjudd ninjudd commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

src/schema/schemas.ts had grown to 565 lines doing ten files' work. It's now one file per project-file domain — common (slug, musical time shapes, sample rates), manifest, song (song + tempo + arrangement), assets, effects (params + inserts), targets (the rule union), mix, track (clip/loop), take, generation — with schema/index.ts as the barrel, so consumers keep a single import path (all 18 importers repointed schemas.js → index.js, nothing else about them changes).

A pure move: every schema, comment, and KeyOrder is verbatim. The only visibility change is that shared building blocks (ticks, samples, the musical-time shapes, effect param objects) are now exported from their modules, since the domains import them across files.

Also carries the two non-blocking footnotes from the #27 scoped review, as that review suggested:

  • Precision: "Siri voices are hidden from say -v entirely" is now stated as what the probing actually established — the system-selected Siri voices match no nameable entry (a few Siri-branded regional voices do list), and nothing is literally named "Siri" for the magic string to shadow. Fixed in build-graph.md and the rule comment.
  • The cache edge: build-graph.md now says plainly that the cache doesn't watch Settings — after a toggle, voice: Siri renders keep serving pre-toggle bytes until text/voice/rate changes the key — and why that's also the feature (a good render survives voice drift until the recipe itself moves).

Typecheck clean, 222 tests pass.


Note

Low Risk
Structural refactor with no schema semantics change; risk is limited to import-path mistakes or accidental export drift, mitigated by unchanged tests and verbatim schema move.

Overview
Replaces the single schemas.ts (~545 lines) with one module per project-file domain (common, manifest, song, assets, effects, targets, mix, track, take, generation) and a schema/index.ts barrel so the public import path stays ../schema/index.js. All consumers that imported schemas.js are repointed to index.js; schemas, KeyOrders, and comments are otherwise unchanged aside from exporting shared pieces (e.g. ticks, effect param objects) where cross-file imports need them.

Docs and say rule comments are tightened for voice: Siri: system-selected Siri voices are not nameable via say -v (only some regional Siri-branded names list), and build-graph.md now states that the cache does not watch Settings—existing Siri renders keep pre-toggle bytes until text/voice/rate change the action key, which is intentional stability against voice drift.

Reviewed by Cursor Bugbot for commit 5bd4e9f. Configure here.

565 lines doing ten files' work: common (slug/musical-time/sample-rate
building blocks), manifest, song (song+tempo+arrangement), assets,
effects (params + inserts), targets (the rule union), mix, track
(clip/loop), take, generation — with schema/index.ts as the barrel, so
importers keep one import path. A pure move: every schema, comment, and
KeyOrder verbatim; the only visibility change is that the shared
building blocks (ticks, samples, time shapes, effect params) are now
exported from their modules.

Rides along per the #27 review footnotes: build-graph.md and the say
rule comment soften "hidden from say -v entirely" to what the probing
established (system-selected Siri voices match no nameable entry; a few
Siri-branded regional voices do list), and the caveat now names the
cache edge — after a Settings toggle, Siri renders keep pre-toggle bytes
until text/voice/rate changes the key, which is also what lets a good
render survive drift.
@ninjudd
ninjudd merged commit 4c1a5b2 into main Aug 6, 2026
2 checks passed
@ninjudd
ninjudd deleted the refactor/schema-split branch September 28, 2026 04:11
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.

1 participant