Skip to content

refactor: runtime-settings registry - #35

Merged
sg merged 1 commit into
mainfrom
refactor/settings-registry
Jul 5, 2026
Merged

refactor: runtime-settings registry#35
sg merged 1 commit into
mainfrom
refactor/settings-registry

Conversation

@sg

@sg sg commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What changed

  • New settings.py registry: each DB-persisted tunable (advert_interval_hours, command_delay, channel_retry_max) is one declarative entry (type, range, audit action, UI metadata, side-effect hook).
  • Bot: six per-setting load/set methods collapsed into load_runtime_settings() / set_runtime_setting().
  • Management: three get/set pairs replaced by setting_list/get/set (validation + audit driven by the registry; audit action names unchanged).
  • API: six endpoints replaced by GET /api/settings + PUT /api/settings/{key}.
  • Web UI: setting rows now render from the registry per tab; new !adm setting [key] [value] generic accessor (existing aliases unchanged).
  • New tests/test_settings_registry.py; all 13 tests pass.

Why

Adding a tunable previously touched 5 layers; now it's a Config field + one registry entry.

Breaking changes

None user-facing; internal REST endpoints for delay/retry/interval moved to /api/settings (bundled UI updated).

🤖 Generated with Claude Code

@sg
sg merged commit a918ef0 into main Jul 5, 2026
1 check passed
@sg
sg deleted the refactor/settings-registry branch July 5, 2026 18:49
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