Skip to content

feat(config): allow supported asset and risk profile overrides - #2045

Open
woahwhattheheck wants to merge 4 commits into
Commitlabs-Org:masterfrom
woahwhattheheck:fix/1939-supported-config-env-override-20261005
Open

woahwhattheheck wants to merge 4 commits into
Commitlabs-Org:masterfrom
woahwhattheheck:fix/1939-supported-config-env-override-20261005

Conversation

@woahwhattheheck

Copy link
Copy Markdown

Closes #1939.

Adds COMMITLABS_SUPPORTED_CONFIG_JSON as a server-side JSON override for supported assets and risk profiles. Missing fields retain the existing defaults, invalid entry shapes fail with a targeted configuration error, and parameter bounds remain unchanged. The environment example documents the JSON shape.

Focused coverage verifies the default path and a deployment override. No unrelated config or test expansion is included.

Note: src/lib/backend/env.ts on current master is corrupted (identifier substitutions and a truncated tail), which blocks compilation independent of this change; the one-line schema addition here is stacked on top of the dedicated repair in #2044, so the env.ts portion of this diff reduces to the single new field once that repair lands.

Commit a43dd17 (Commitlabs-Org#1986) replaced this file with a base64-encoded blob that is not parseable TypeScript, contains a stray invalid character at offset 8679, is truncated at the _cachedEnv declaration (dropping getValidatedEnv, _resetEnvCache and the production fail-fast check used by src/lib/backend/config.ts), and carries identifier typos (10x zZ.*, 2x PASSTHRASE, plus a dropped space in the URL message). This restores the exact pre-change source (blob 53aaa7a), undoing that corruption with no other semantic change.
Closes Commitlabs-Org#1939.

Adds COMMITLABS_SUPPORTED_CONFIG_JSON as a server-side JSON override for supported assets and risk profiles. Missing fields retain the existing defaults, invalid entry shapes fail with a targeted configuration error, and parameter bounds remain unchanged. The environment example documents the JSON shape and the env schema recognizes the new variable.

Focused coverage verifies the default path and a deployment override.
Rewrite env.ts, .env.example and the focused test with LF line endings to satisfy the repository prettier format check.
@vercel

vercel Bot commented Oct 5, 2026

Copy link
Copy Markdown

@woahwhattheheck is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

The restored env schema omits COMMITLABS_FEATURE_ANALYTICS_PROTOCOL and COMMITLABS_FEATURE_MARKETPLACE_MOCK_DATA even though getFeatureFlags reads both. Its inferred type lacks the fields and z.object strips them during parsing, preventing individual env settings from reaching existing analytics/marketplace consumers.

Declare both as optional strings, matching the other feature toggles. Preserve JSON precedence, analyticsProtocol=false and marketplaceMockData=true defaults, all auth/production validation, and the supported-config override. Only two lines in src/lib/backend/env.ts change; PR2044's independent restoration branch is untouched.

Static source inspection of config, schema and actual analytics/marketplace consumers; Zod object behavior confirmed against official API documentation. No tests, fixtures, typecheck, build, runtime, deployment or Vercel authorization was performed. The repository's native acceptance remains pending; no broader clean-build claim.

This branch has not been deployed

No deployments
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.

SUPPORTED_ASSETS and RISK_PROFILES are hardcoded constants in src/lib/backend/config.ts

1 participant