Consolidate admin settings into a single-definition registry#310
Merged
plusplusoneplusplus merged 1 commit intoJun 10, 2026
Merged
Conversation
Adding an admin-exposed config setting previously required edits in ~10 places (config types/defaults, zod schema, namespace merge + source keys, admin field specs, runtime feature flags, DashboardOptions, html-template embed, SPA config plumbing, AdminPanel state/JSX, plus per-setting tests). A setting is now ONE entry in config/admin-setting-definitions.ts (value spec, default, runtime behavior, optional runtimeFlag and Features-card UI metadata) plus its CLIConfig/ResolvedCLIConfig/DEFAULT_CONFIG declaration: - admin-config-fields.ts derives validate/apply specs from the registry - schema.ts generates nested zod fragments and deep-merges them with a hand-written base tree of non-admin fields - namespace-registry.ts merges dotted registry keys generically (override ?? base ?? default) and tracks file/default sources by path; hand-written descriptors remain only for non-admin namespaces and customMerge settings (agentProviderRouting.auto) - buildRuntimeFeatures() builds RuntimeDashboardConfig.features from runtimeFlag entries; spaHtml embeds the whole map as __DASHBOARD_CONFIG__.features (JSON, <-escaped) and utils/config.ts flattens it generically — per-flag plumbing through DashboardOptions/ html-template/utils-config is gone - the AdminPanel Features card renders groups/rows/badges/selects from registry UI metadata over a generic featureValues record (state, dirty, save payload, cancel all generic); exact data-testids preserved - absentFallback preserves bootstrap-conservative reads for partial configs (e.g. workItems.hierarchy.enabled) - parallel admin validation now requires an integer, matching the file schema it previously disagreed with Tests: new generic contract suite (test/config/admin-setting-definitions .test.ts, 432 generated tests) verifies every setting end-to-end — DEFAULT_CONFIG consistency, schema accept/reject, validate/apply round-trip, merge override, source tracking, runtime flag exposure, and UI metadata integrity — so new settings get coverage automatically. Embed/source-grep tests updated to the features-map embed and registry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Adding an admin-exposed config setting previously required edits in ~10
places (config types/defaults, zod schema, namespace merge + source keys,
admin field specs, runtime feature flags, DashboardOptions, html-template
embed, SPA config plumbing, AdminPanel state/JSX, plus per-setting tests).
A setting is now ONE entry in config/admin-setting-definitions.ts (value
spec, default, runtime behavior, optional runtimeFlag and Features-card UI
metadata) plus its CLIConfig/ResolvedCLIConfig/DEFAULT_CONFIG declaration:
hand-written base tree of non-admin fields
(override ?? base ?? default) and tracks file/default sources by path;
hand-written descriptors remain only for non-admin namespaces and
customMerge settings (agentProviderRouting.auto)
runtimeFlag entries; spaHtml embeds the whole map as
DASHBOARD_CONFIG.features (JSON, <-escaped) and utils/config.ts
flattens it generically — per-flag plumbing through DashboardOptions/
html-template/utils-config is gone
registry UI metadata over a generic featureValues record (state, dirty,
save payload, cancel all generic); exact data-testids preserved
configs (e.g. workItems.hierarchy.enabled)
schema it previously disagreed with
Tests: new generic contract suite (test/config/admin-setting-definitions
.test.ts, 432 generated tests) verifies every setting end-to-end —
DEFAULT_CONFIG consistency, schema accept/reject, validate/apply
round-trip, merge override, source tracking, runtime flag exposure, and
UI metadata integrity — so new settings get coverage automatically.
Embed/source-grep tests updated to the features-map embed and registry.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com