refactor(client/config): portable config.json via @demon/client#267
Open
ryanontheinside wants to merge 1 commit into
Open
refactor(client/config): portable config.json via @demon/client#267ryanontheinside wants to merge 1 commit into
ryanontheinside wants to merge 1 commit into
Conversation
…emon/client Extract the portable operator-defaults config (schema, DEFAULT_CONFIG, pure transforms, loader, and the RtmgConfig -> wire SessionConfig mapping) from the web app into packages/demon-client/config/ so web / M4L / VST share one implementation. Web lib/config.ts keeps only its zustand/React wiring and re-exports the rest; types/engine.ts and lib/loopGrid.ts re-export the config-semantic enums (DCW / RCFG / time-signature / loop-grid), now single-sourced in the SDK. applyConfig / captureRtmgConfig / buildConfig become thin wrappers over the SDK's pure cores (applyConfigToState / captureConfigFromState / rtmgConfigToSessionConfig). Add preserve-unknown-on-write: mergeConfig stashes unknown top-level keys on a non-enumerable carrier and serializeConfig re-emits them, so a config a client doesn't fully model round-trips without loss. The web Export path serializes through it.
This was referenced Jun 16, 2026
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.
What
Plan 01 of the client-SDK refactor: move the portable
config.jsonoperator-defaults (schema,DEFAULT_CONFIG, pure transforms, loader, and theRtmgConfig→ wireSessionConfigmapping) out of the web app into@demon/client(packages/demon-client/config/), so web / M4L / VST share one implementation.lib/config.tskeeps only its zustand/React wiring and re-exports the rest — zero call-site changes across its 21 importers.types/engine.ts/lib/loopGrid.tsre-export the config-semantic enums (DCW / RCFG / time-signature / loop-grid), now single-sourced in the SDK. UI-only metadata (SLIDER_META, label maps, keyscales) stays in web.applyConfig/captureRtmgConfig/buildConfigbecome thin wrappers over the SDK's pure cores (applyConfigToState/captureConfigFromState/rtmgConfigToSessionConfig).mergeConfigand re-emitted byserializeConfig, so a config a client doesn't fully model round-trips without loss. The web Export path serializes through it.Decisions
schema_versionis already the existingversionfield (added in refactor(web/config): separate shared config from web-only block + version it #266) — not duplicated.time_signatureis barestring;VALID_TIME_SIGNATURESis ints inconstants.py), so the SDK is the single source and web re-exports them.Dependency
Depends on #266 (
refactor/shareable-config). This PR is stacked on that branch and targets it as its base — retarget tomainonce #266 merges.Verification
tsc --noEmitclean; 51/51 web unit tests (incl. newconfigRoundTrip.test.ts); 18/18 Python drift guards (test_client_sdk+test_wire_contract); SDKdist/rebuilt.test:replaytier fails, but pre-existing on the base branch (canonical recordings predate theclient_time/slice_bytes_rxparams telemetry from feat(rtmg/web): flag "unstable connection" when slices land behind the playhead #260) — confirmed the identical failure with these changes stashed.