config: retire the core.* logging namespace (closes #443)#468
Open
lonix wants to merge 2 commits into
Open
Conversation
After #440 removed every unread core.* key, the namespace was down to a single survivor: core.cleanup.channel_id. Audit shows it's vestigial. VoiceChannelTruncationService.getNotificationChannel() reads it, but nothing in the service ever actually sends a notification to that channel — the value flows only into the Database admin page renderer to display "Notification channel: #X" next to a feature that doesn't post anything. Setting or unsetting the key produces no observable behavior. Per Path A from the issue (delete it; the v1.0 admin panel is the right place to surface bot events, not a parallel sprawl of Discord channels), removing the whole thing. Schema (src/services/config-schema.ts): - Drop core.cleanup.channel_id from ConfigSchema, defaultConfig, settingsMetadata. - Drop the `core` entry from categoryMetadata (no keys left in it). - cleanupUnknownSettings() will purge any orphan DB rows on next start; the Config mongoose model keeps `"core"` in its category enum so the validator accepts those rows during the transition window (same pattern as the retired `amikool` / `fun` enum slots). Service (src/services/voice-channel-truncation.ts): - Remove getNotificationChannel(). It had a single caller that itself used the result only for display, with no real downstream effect. Database admin page (src/web/admin-views.ts, read-only-routes.ts): - DatabaseProps.trunk loses the notificationChannel field; the page no longer shows the "Notification channel" row. Other dbtrunk diagnostics (schedule, last run, retention) unchanged. - Route handler drops the corresponding await + destructure + fetchChannelData call. Docs (SETTINGS.md): - Drop the entire "📝 Discord Logging" section (which also documented the four other core.* sub-namespaces #440 had already removed — longstanding doc drift cleaned up here). - Drop matching TOC entry and quick-reference block. Tests: - Drop the two now-bogus config-schema.test.ts assertions on core.cleanup.channel_id. - Drop notificationChannel: null from the two renderDatabasePage fixtures in admin-views.test.ts. 743 tests pass; typecheck / lint / format clean.
Three checks (Dependency Review, Test Node 24, Typecheck) failed at the checkout / action-download step with HTTP 403 — pure GitHub infrastructure flakiness. The other four jobs (Test Node 22, Lint, markdownlint, Analyze) ran the same code and passed. Empty commit to re-trigger.
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.
Closes #443. Picking Path A (delete) as recommended in the issue.
Why delete it
After #440 removed every unread
core.*key, the namespace was down to a single survivor:core.cleanup.channel_id. Audit shows it's fully vestigial.VoiceChannelTruncationService.getNotificationChannel()reads the key, but nothing in the service ever actually sends a notification to that channel — the value flows only into the Database admin-page renderer, which displays "Notification channel: #X" next to a feature that doesn't post anything. Setting or unsetting the key produces zero observable behavior.Given the v1.0 direction ("admin panel is the source of truth, not a sprawl of Discord channels"), Path A is the right call.
Changes
Schema (
src/services/config-schema.ts)core.cleanup.channel_idfromConfigSchema,defaultConfig,settingsMetadata.coreentry fromcategoryMetadata(no keys left in it).cleanupUnknownSettings()will purge any orphan DB rows on next start. The MongooseConfigmodel keeps"core"in itscategoryenum so the validator accepts those rows during the transition window — same pattern as the retiredamikool/funenum slots.Service (
src/services/voice-channel-truncation.ts)getNotificationChannel(). Its single caller used the result only for display, with no real downstream effect.Database admin page (
src/web/admin-views.ts,read-only-routes.ts)DatabaseProps.trunkloses thenotificationChannelfield; the page no longer renders the "Notification channel" row.truncation.getNotificationChannel()await + the now-unusedfetchChannelDatacall.Docs (
SETTINGS.md)core.*sub-namespaces Config: delete dead/unused config keys #440 had already removed (longstanding doc drift cleaned up here).Tests
core.cleanup.channel_idassertions inconfig-schema.test.ts.notificationChannel: nullfrom the tworenderDatabasePagefixtures inadmin-views.test.ts.Verification
npm test— 743 passed, 1 skipped, 0 failed.npx tsc --noEmit— clean.npm run lint— 0 errors.npm run format:check— clean.grep -rn 'core\\.' srcreturns nothing.core.cleanup.channel_idset: on next start expectcleanupUnknownSettings()log🧹 Found 1 unknown/old settings...listing it./admin/databaseno longer shows the "Notification channel" row, other rows unchanged.Test plan
/admin/database.Generated by Claude Code