Skip to content

config: retire the core.* logging namespace (closes #443)#468

Open
lonix wants to merge 2 commits into
mainfrom
claude/delete-core-namespace
Open

config: retire the core.* logging namespace (closes #443)#468
lonix wants to merge 2 commits into
mainfrom
claude/delete-core-namespace

Conversation

@lonix
Copy link
Copy Markdown
Owner

@lonix lonix commented May 26, 2026

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)

  • 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 Mongoose Config 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(). 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.trunk loses the notificationChannel field; the page no longer renders the "Notification channel" row.
  • Other dbtrunk diagnostics (schedule, last run, retention, history) unchanged.
  • Route handler drops the corresponding truncation.getNotificationChannel() await + the now-unused fetchChannelData call.

Docs (SETTINGS.md)

  • Drop the entire "📝 Discord Logging" section, which still documented the four core.* sub-namespaces Config: delete dead/unused config keys #440 had already removed (longstanding doc drift cleaned up here).
  • Drop matching TOC entry and quick-reference block.

Tests

  • Drop the two core.cleanup.channel_id assertions in config-schema.test.ts.
  • Drop notificationChannel: null from the two renderDatabasePage fixtures in admin-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\\.' src returns nothing.
  • Manual on a deployment that had core.cleanup.channel_id set: on next start expect cleanupUnknownSettings() log 🧹 Found 1 unknown/old settings... listing it.
  • Manual: /admin/database no longer shows the "Notification channel" row, other rows unchanged.

Test plan

  • Existing tests still pass; behavior unchanged for everything outside the vestigial code path.
  • Manual UI check on /admin/database.

Generated by Claude Code

claude added 2 commits May 26, 2026 12:42
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.
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.

Config: rationalize the core.* Discord-channel logging story (delete or finish)

2 participants