@wenathlan/debonair 2.0.136 → 2.0.138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,198 @@
1
+ # planning.pipeline — the 120+ step ladder of the full music pipeline
2
+
3
+ > the wave the owner ordered: ingest a real track → the engine decomposes it
4
+ > into the parametrized vector document → the document lands in the db with
5
+ > the owner id and the big pointers → the references power the pattern miner
6
+ > per genre → the composer generates a similar vector json → the engine
7
+ > renders real audio → the take plays, publishes and shows in the vitrine.
8
+ > every heavy stage runs SERVER SIDE (the gateway jobs, the saddle AVM
9
+ > modalities) — the visitor's browser, cpu and gpu never run the pipeline.
10
+ > companion of docs/planning.ladder.md (the kathesis verification ladder)
11
+ > and docs/planning.v2.28-completo.md.
12
+ >
13
+ > ## the code synthesis of outros.debonair (the reference verdict)
14
+ >
15
+ > the full code read of the reference folder closed the method question —
16
+ > the parts that PROVED real sound, the parts the composer mines:
17
+ > - `v2/src/lib/audio/engine.ts` — the voice recipes to reimplement root
18
+ > side: kick pitch env 165→52→40 hz with the noise click, snare noise
19
+ > bandpass 1750 + dual triangle body, hat hp 7800, clap 4 bursts 9.5ms
20
+ > apart, 808 bass pitch snap hz*2→hz in 45ms through a drive shaper,
21
+ > supersaw lead, pad lp with the 0.28hz lfo, keys tremolo, master chain
22
+ > tanh waveshaper k=3.2 → compressor −13/18/4.5 → analyser, feedback
23
+ > delay 0.27s fb 0.34, reverb noise impulse tail pow(1−i/len, 2.2), the
24
+ > 140ms look-ahead transport and the OfflineAudioContext render mirror →
25
+ > wav 16-bit / mp3 lamejs — the render proof the composer rides.
26
+ > - `v2/src/lib/audio/generator.ts` — the composition brain: 48 scales, 9
27
+ > style presets with exact drum lanes (trap kick [0,6,10] snare [4,12]
28
+ > hat 16th lanes clap [4,12] swing 0.12; drill, lofi, house...), bass
29
+ > locked to kick, markov 1st-order melodies with the ±3 semitone bias,
30
+ > DRIFT_CYCLE and ENERGY_CYCLE build/drop, seeded prng (same prompt same
31
+ > take), vary() diatonic drift.
32
+ > - `v2/src/app/api/analyze + similar + trainOnProject` — the pattern
33
+ > miner shape: note bigrams, 16-step drum histograms (adopt steps above
34
+ > 0.55 after trainedOn ≥ 3), embedding centroid, bpm histogram, cosine
35
+ > similarity over the 32-dim embedding — the exact miner PV3
36
+ > reimplements over our ingest documents.
37
+ > - `v1/v1 page.tsx` — the 6-layer biquad separation, the pcm store by
38
+ > session:second:track and the priority playback ladder (stored pcm →
39
+ > hex inline → seed synth → pattern synth) with the AudioBufferSource
40
+ > scheduling and the 1.0s per-second grid.
41
+ > - `mjs/analyser.mjs + ffmpeg.mjs` — the node decode lane (ffmpeg f32le
42
+ > → stft → per_second vectors) with the known bpm bugs (no octave fold
43
+ > guard) our analyze already handles.
44
+ > - the FAKE parts the new code never repeats: the ~200 decorative
45
+ > *Id/*Hash fields per second (constants and xor cosmetics), the
46
+ > expandFromSeed checksum claim (the checksum never validates — synthesis
47
+ > cannot reproduce pcm), the hex semantic signatures (0xKICK_SUB_HEAVY),
48
+ > the empty prisma/db/mini-services scaffolds, the yamnet removal.
49
+ > - the honest separation limit the reference states: elements sharing the
50
+ > spectral range AND the pan position are mathematically inseparable
51
+ > without a trained model — the hpss pair (harmonic/percussive) is the
52
+ > proven floor, the vocal/bass/drum lanes ride the band filters on top.
53
+
54
+ ## wave PV0 — what already stands (verified, committed)
55
+
56
+ - [x] PV0.001 hpss real separation with centered framing, ifft conj law and
57
+ f64 ola — conservation 2.3e-7 over the whole signal (hpss.ts)
58
+ - [x] PV0.002 the ingest document debonair.ingest/1: mix + harmonic/percussive
59
+ stems, one vector frame per second (centroid, flatness, chroma, bands,
60
+ zcr, rms, beat, onsets) and the fnv-1a pcm hash (ingest.ts)
61
+ - [x] PV0.003 the ingest store: gateway https with the house host law and the
62
+ byte-capped offline mirror (ingeststore.ts); sqlite rows through
63
+ parameter binding only (ingestdb.ts)
64
+ - [x] PV0.004 the /ingest bench walking decode → separate → analyze →
65
+ segment → store with the phase meter (Sol/ingest/ingest.tsx)
66
+ - [x] PV0.005 the typed-URL law: devthink barra <app> lands inside the os on
67
+ all ten family apps (?arrive handoff, ?independent escape)
68
+ - [x] PV0.006 the 339-test battery green, the 402kb bundle building clean
69
+
70
+ ## wave PV1 — the reference system (the ids, the pointers, the server law)
71
+
72
+ - [ ] PV1.001 schema upgrade of ingest_documents: owner_id (BIGINT pointer),
73
+ kind ("reference" | "render" | "upload"), visibility ("private" |
74
+ "vitrine"), blob pointers for mix and stems, size, sha256 — parameter
75
+ binding only, mirroring prisma/schema.prisma
76
+ - [ ] PV1.002 the id mint: bigintids.ts — time-ordered 64-bit ids (the big
77
+ pointers the house law names), zero storage, deterministic tests
78
+ - [ ] PV1.003 the gateway routes of ingest: POST /api/v1/ingest/upload
79
+ (multipart, streams to the job store, returns the job id), GET
80
+ /api/v1/ingest/jobs/:id (progress: decode, separate, analyze, segment,
81
+ store), GET /api/v1/ingest (the shelf rows), GET /api/v1/ingest/:id,
82
+ DELETE /api/v1/ingest/:id
83
+ - [ ] PV1.004 the server worker ingestworker.ts (node, the gateway lane):
84
+ decode (audio-decode/wav) → hpss separate → analyze → segmentsof →
85
+ ingestPcm → wavwriter per stem + mix → blob store — the browser never
86
+ runs any of it
87
+ - [ ] PV1.005 the blob store contract blobstore.ts: put(stream) → pointer
88
+ {id, bytes, sha256, kind}, get(id) → stream — the vault law (the
89
+ storage app owns the engine; the gateway serves it), git-lfs friendly
90
+ - [ ] PV1.006 the job ledger table ingest_jobs (id BIGINT, owner_id, state,
91
+ progress, error, document_id, created_at, finished_at)
92
+ - [ ] PV1.007 the bench rewired: file → POST upload → poll the job → the
93
+ phase meter reads the server progress → the document renders — zero
94
+ dsp on the visitor's machine; the local opt-in path stays behind an
95
+ explicit "run on this device" key
96
+ - [ ] PV1.008 every document row carries the owner id (the user ingest or
97
+ the system ia ingest — both stamp the same pointer chain)
98
+ - [ ] PV1.009 the system ingest lane: the ia (or an mcp automation, opt-in)
99
+ posts the same upload route with the service identity — the reference
100
+ library grows without a human
101
+ - [ ] PV1.010 tests: bigintids monotonicity, blobstore round trip, worker
102
+ end-to-end on a synthetic wav, the routes contract with a fake fetch
103
+
104
+ ## wave PV2 — the playback proof (the ingested track plays)
105
+
106
+ - [ ] PV2.001 the mix and stem wavs ride the blob store; GET
107
+ /api/v1/blob/:id streams them with the right mime (audio/wav)
108
+ - [ ] PV2.002 the playerbus learns the reference take: the ingested mix
109
+ loads as a take the bar plays (the same bus the generated takes ride)
110
+ - [ ] PV2.003 the bench document view gains the play key: the stored mix
111
+ streams through the shared bar (the proof the owner demanded: ingest →
112
+ play, no re-render)
113
+ - [ ] PV2.004 stem audition: harmonic and percussive playable solo/muted
114
+ (the stems the worker stored), the conservation audible
115
+ - [ ] PV2.005 the library shelf rows carry the play key too (the ingested
116
+ references sit beside the generated takes, one grammar)
117
+ - [ ] PV2.006 tests: the wav round trip (store → stream → decode equals the
118
+ source samples), the bus contract for reference takes
119
+
120
+ ## wave PV3 — the pattern miner (the genre tool the references feed)
121
+
122
+ - [ ] PV3.001 patternminer.ts: reads the ingested documents of a genre and
123
+ answers the genre profile — bpm distribution, key pool, chord ladder
124
+ frequency, onset density curves, band balance, loudness targets
125
+ - [ ] PV3.002 the genre profile document debonair.profile/1 (deterministic,
126
+ parametrized, versioned) — stored in genre_profiles with the reference
127
+ ids that fed it (the pointer chain audit-ready)
128
+ - [ ] PV3.003 similarity: the vector distance over frames (cosine on the
129
+ normalized segment vectors) — nearest references answer a prompt
130
+ - [ ] PV3.004 the miner runs server side (a gateway job like the ingest
131
+ worker); the browser asks, never computes
132
+ - [ ] PV3.005 the vitrine surfaces the profiles (the genre cards the home
133
+ shows come from the db, never hardcoded)
134
+ - [ ] PV3.006 tests: the miner on synthetic documents of two genres
135
+ separates, the profile determinism, the similarity ranking
136
+
137
+ ## wave PV4 — the composer (prompt → similar json → real audio → play)
138
+
139
+ - [ ] PV4.001 the composer prompt → genre match (genrematrix) → the profile
140
+ of that genre → a seeded vector plan similar to the references
141
+ - [ ] PV4.002 the render: audioengine renders the plan offline (the existing
142
+ renderTakeOffline lane) — kick/snare/hats sample-accurate, bass, keys,
143
+ pads, the arrangement the plan carries
144
+ - [ ] PV4.003 the render job table render_jobs (exists) wired to the worker:
145
+ queued → rendering → done, the wav lands in the blob store, the track
146
+ row lands in tracks with the pointers
147
+ - [ ] PV4.004 the generated take plays in the same bar, publishes to the
148
+ vitrine (the spotify/netflix shelf the owner described) and downloads
149
+ - [ ] PV4.005 the vocal lane grows after the instrumental proof (the
150
+ SINTESE-VOCAL-AI line), opt-in, never blocking the wave
151
+ - [ ] PV4.006 tests: the same prompt+seed renders the same bytes, the render
152
+ job lifecycle, the vitrine rows
153
+
154
+ ## wave PV5 — the design reform (debonair wears the devthink index face)
155
+
156
+ - [ ] PV5.001 screenshot the live os home and every debonair page (the
157
+ browser session) — the gap list against the index face
158
+ - [ ] PV5.002 the shell chrome: the window, the pin rail and the player bar
159
+ re-tuned to the os grammar (the trylle surfaces, the fluent shadows,
160
+ the campaign motion) — no drift tokens
161
+ - [ ] PV5.003 the home: the prompt-first hero over the noir stage retuned,
162
+ the song grid rows in the streaming grammar (cover, title, genre line,
163
+ duration, play on hover), the shimmer and the stagger
164
+ - [ ] PV5.004 the ingest bench in the same face (the dropzone, the meter,
165
+ the cards, the shelf)
166
+ - [ ] PV5.005 the generate/library/studio/settings pages one pass each —
167
+ short copy, no dots, the same nav law, every key answering
168
+ - [ ] PV5.006 the 404 and the intro re-faced
169
+ - [ ] PV5.007 the live verification: every route of the app inside the power
170
+ clip and standalone (?independent), screenshots compared
171
+ - [ ] PV5.008 the same face check on light theme
172
+
173
+ ## wave PV6 — the family integration (the engines talk)
174
+
175
+ - [ ] PV6.001 the gateway app serves the debonair api lane (the routes of
176
+ PV1/PV3/PV4 ride the gateway the family shares)
177
+ - [ ] PV6.002 the vault stores the blobs (the blobstore pointer resolves
178
+ through the vault engine when configured, git-lfs backed)
179
+ - [ ] PV6.003 the saddle AVM modalities run the heavy jobs (the worker lane
180
+ declares the sandbox modality, opt-in per deploy) — the visitor's
181
+ machine stays clean even at scale
182
+ - [ ] PV6.004 the mcp automation lane (opt-in): an external agent ingests
183
+ and generates through the same gateway with its own identity
184
+ - [ ] PV6.005 the debonair package.json exports the engine library (the npm
185
+ face: analyze, hpss, ingest, patternminer, audioengine, wavwriter —
186
+ zero hardcode, everything configured through options/db)
187
+
188
+ ## wave PV7 — the verification ladder (the proof the owner reads)
189
+
190
+ - [ ] PV7.001 the full battery green (vitest) on every wave's modules
191
+ - [ ] PV7.002 the typecheck + biome + build clean on every push
192
+ - [ ] PV7.003 the live proof: ingest a real track through the ui, watch the
193
+ server do the work, press play, hear the mix, hear the stems
194
+ - [ ] PV7.004 the live proof: generate from a genre with references, hear
195
+ the take, publish to the vitrine
196
+ - [ ] PV7.005 the live proof: devthink barra debonair → the window inside
197
+ the os, the bench inside it, no flash, one boot
198
+ - [ ] PV7.006 the worklog and the ladder ticked, the wave committed
@@ -0,0 +1,69 @@
1
+ # planning.v2.28-completo — the ladder to the complete debonair app
2
+
3
+ > owner directive: make the app COMPLETE (suno.com generation x FL studio desk),
4
+ > house tree, no src/, no ui/ folder, doctrine of #oficial 4 + DESIGN_MAP v2.
5
+ > this plan is the single source of truth for the wave that closes the gaps
6
+ > listed in DEBONAI-RULEMAP.md section 7 and DEBONAI-VERSIONS.md backlog.
7
+ > step ladder generated from the live inventory: docs/planning.ladder.md
8
+
9
+ ## where the app stands (inherited, verified this session)
10
+
11
+ - native app at `debonair/debonair/` (house tree: pure ts engines at the root,
12
+ Sol/ theme, docs/, tests/). 28 engines + kathesis b2 (spectrum, fingerprint,
13
+ analyze, vocalsynth). 261 vitest cases green, tsc 0, biome 0. commit 504b8ae
14
+ on branch kathesis/b2-wave, pushed.
15
+ - served in the sandbox by the next.js gateway (single launcher page, iframe of
16
+ the built bundle under public/debonair/). nothing is duplicated in the gateway.
17
+ - auth: device flow token persisted (iakadion). pushes land on
18
+ github.com/wenathlan/devthink.
19
+
20
+ ## gaps this wave closes (the definition of "complete")
21
+
22
+ | gap (inherited) | wave | delivery |
23
+ |---|---|---|
24
+ | daw editing is cosmetic (algebra exists, ui does not edit) | K3 | timeline editor in seconds: move (drag+snap), trim, split, duplicate, delete, clip selection; piano roll editor over the scheduled notes with add/remove/move/resize/quantize; honest re-schedule through takeevents + audioengine; aria + keyboard paths |
25
+ | no wav / midi / stems writers | K4 | wavwriter.ts (16/24/32f encoder, riff-correct), midiwriter.ts (smf format 1, vlq, tempo meta), stems.ts (per-role stem plans + manifest schema v1); export actions in the studio desk |
26
+ | no live visualization (analyser to canvas) | K5 | spectrum scope + waveform overview wired to the real analyser tap; playhead clock; reduced-motion guard |
27
+ | no server persistence (RenderJob idle) | K6 | gateway api projects (list/upsert/delete) on sqlite via prisma; cloudsync.ts engine (seam: fetch first, sessionStorage fallback, 2.5s timeout like onboardingstate); settings page shows sync state honestly |
28
+ | competitors dissected but not written down | K1 | docs/competitor-dissection.md from the five clones in allan/temp (libsonare, pulsegridstudio, magenta-js, acestep.cpp, heartlib) |
29
+ | planning ladder + version ladder | K2 | this file + docs/planning.ladder.md (900+ steps from the live inventory) |
30
+
31
+ ## waves (task ids continue the worklog ladder)
32
+
33
+ - K1 — competitor dissection (read-only on allan/temp; writes docs/).
34
+ - K2 — planning: this document + generated ladder.
35
+ - K3 — studio daw editing (pianoroll.ts engine + Sol/studio/timeline + pianoroll ui + tests).
36
+ - K4 — writers: wavwriter.ts, midiwriter.ts, stems.ts + contract tests.
37
+ - K5 — live viz (spectrum scope, waveform overview, clock) on the real analyser.
38
+ - K6 — gateway persistence (api + cloudsync.ts engine + settings surface).
39
+ - K7 — gates: vitest full suite, tsc strict, biome zero; vite build; sync
40
+ public/debonair; commit as iakadion on kathesis/b3-wave; fetch before push.
41
+ - K8 — browser verification of the served app (agent-browser) + worklog close.
42
+
43
+ ## doctrine invariants every wave must keep
44
+
45
+ 1. engines are pure ts at the root: no DOM, no AudioContext, no storage;
46
+ tables first, orchestrator last, ~300 correlated logics per file, JSDoc on
47
+ every export, typed results or error classes with machine codes.
48
+ 2. determinism: same prompt + same seed = same take; mulberry32(hashSeed(fnv-1a))
49
+ is the only rng; editors (pianoroll, timeline) are deterministic algebras.
50
+ 3. sol.css is the single design source; windows accent #4cc2ff only in chrome
51
+ focus, amber #d9962e only in brand/cta; zero emoji icons (lucide only);
52
+ zero pills; reduced-motion guards; solcss.test.ts must stay green.
53
+ 4. ui speaks english, lowercase chrome voice; mono tabular for bpm/key/lufs.
54
+ 5. one audible transport: playerbus; studio hushes the bus on mount.
55
+ 6. no touch on sibling apps (devthink, cadria, getry, vault, saddle...).
56
+ getry/vault integration stays an adapter seam, never reimplemented.
57
+ 7. gates before any push: biome 0, tsc 0, vitest green. commits as iakadion.
58
+ 8. honest ui: no fake metrics, no invented reviews; export is real (wav/midi
59
+ download of rendered audio), sync states read real endpoints with timeouts.
60
+
61
+ ## acceptance criteria (the wave is done when)
62
+
63
+ - [ ] all six gaps above closed with green gates.
64
+ - [ ] vitest suite green with the new engine contract tests.
65
+ - [ ] served app (gateway iframe) verified in a real browser: generate a take,
66
+ open the desk, edit a clip, edit a note, export wav + midi + stems,
67
+ see the spectrum move, save to cloud, reload, find the take.
68
+ - [ ] worklog carries every task id; version ladder updated (v2.28/2.29/2.30
69
+ delivered; v2.31 speechalign recording and v3.0 render queue remain).
@@ -0,0 +1,48 @@
1
+ # planning.versions — the 2.0.97 → 3.0 ladder of debonair
2
+
3
+ > the document the previous operation died creating (session corte at L2485-2495 of
4
+ > the context corpus). the ladder runs in houses of ~200-300: each house closes a
5
+ > capability block, ships green (biome 0/0 · tsc 0 · vitest green) and bumps the
6
+ > lockstep version. tree wins; the engine is the debonair root; the family imports
7
+ > the published `@wenathlan/debonair` library — never a path, never a bundle.
8
+
9
+ ## where the house stands (verified 2026-10-12)
10
+
11
+ - `667c20a` head · katexis b1 + sol v2 trylle foundation · 240 tests green
12
+ - wave b2 (kathesis) landed in this operation: `spectrum.ts`, `fingerprint.ts`,
13
+ `analyze.ts`, `vocalsynth.ts` + 4 suites → **261 tests green** (26 files)
14
+
15
+ ## the ladder
16
+
17
+ ### house 2.0.97 → 2.0.150 — the kathesis analysis core (this wave, b2)
18
+ - [x] spectrum kernel (fft · hann · chroma · kk correlation)
19
+ - [x] fingerprint identity (constellation · landmarks · db)
20
+ - [x] analyze pipeline (flux tempo · octave law · key · lufs · structure · report.schema v1)
21
+ - [x] formant voice (vowel table · seeded vibrato · syllable grid · level law)
22
+ - [x] enginemap honest refresh
23
+ - [ ] `report.schema.ts` — the json/txt formatters the corpus docs 12/26 prescribe
24
+ - [ ] `restage.ts` — the reference→analysis→plan loop (doc 14→16): a real track's
25
+ report feeds the arranger so the take follows the reference structure
26
+
27
+ ### house 2.0.150 → 2.0.200 — the daw body
28
+ - [ ] timeline editing for real: drag/split/trim wired to `timelinemodel` on the studio page
29
+ - [ ] piano roll page (`#oficial4` APP-0491..0735: Onboarding/Login/Mixer/Timeline/PianoRoll/Library/Master/Settings)
30
+ - [ ] wav/midi writers (export seam, `<50MB` validation before export)
31
+ - [ ] speechalign → vocal recording with ducking (the mic leg)
32
+
33
+ ### house 2.0.200 → 2.1.0 — the ai acoustics seam
34
+ - [ ] onnxruntime-node seat for the foundation embeddings (clap/beats, int8)
35
+ - [ ] fpcalc/olaf binary orchestration via the saddle contract (node executes, binaries in `tools/bin/`)
36
+ - [ ] whisper.cpp transcription of the vocal stem → the lyricist reads, "A SONORIDADE É INTOCÁVEL"
37
+ - [ ] fingerprint dedup on every render job before the library accepts it
38
+
39
+ ### house 2.1.0 → 3.0 — the family contract
40
+ - [ ] publish `@wenathlan/debonair` (npm/ghcr) — the engine leaves the house
41
+ - [ ] devthink music/musicstudio imports the published engine (no duplication)
42
+ - [ ] cadria/getry/vault consume the audio primitives through the same library
43
+ - [ ] 44.1k/48k master spec locked: −14 lufs streaming · −1 dbtp · anti-nan · pre-export validation
44
+
45
+ ## the laws this ladder obeys
46
+ 1. tree wins · 2. one domain per file ≤300 lines · 3. tables at the top, orchestrator last
47
+ 4. seeded determinism in everything generated · 5. zero hardcode, zero consumer data in the engine
48
+ 6. gates green before any bump · 7. commits as iakadion · 8. actions by tag, never sha
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenathlan/debonair",
3
- "version": "2.0.136",
3
+ "version": "2.0.138",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/wenathlan/devthink"