Skip to content

Consolidate admin settings into a single-definition registry#310

Merged
plusplusoneplusplus merged 1 commit into
mainfrom
pr/3c487a8c8-consolidate-admin-settings-into-a-single
Jun 10, 2026
Merged

Consolidate admin settings into a single-definition registry#310
plusplusoneplusplus merged 1 commit into
mainfrom
pr/3c487a8c8-consolidate-admin-settings-into-a-single

Conversation

@plusplusoneplusplus

Copy link
Copy Markdown
Owner

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

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>
@plusplusoneplusplus plusplusoneplusplus merged commit 77967a3 into main Jun 10, 2026
36 checks passed
@plusplusoneplusplus plusplusoneplusplus deleted the pr/3c487a8c8-consolidate-admin-settings-into-a-single branch June 10, 2026 14:18
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