Skip to content

feat(database): follow the bot's V7 contract to 788939a - #477

Merged
RedStar071 merged 3 commits into
refactor/v3from
chore/v3-bot-contract
Oct 21, 2026
Merged

RedStar071 merged 3 commits into
refactor/v3from
chore/v3-bot-contract

Conversation

@RedStar071

@RedStar071 RedStar071 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Stacked on #451.

🔗 Linked issue

Related to #451.

🧭 Context

vendor/wolfstar was pinned 117 commits behind the bot's V7. Since then the bot added tables and columns (appeals, honeypot, log options, five more log channels, the Polls rule, the ModerationAction indexes from wolfstar-project/wolfstar#313), and it dropped modules.logs, modules.commands, logs.command and logs.settings from its settings because they turned nothing off.

📚 Description

The submodule now points at 788939a. columns.ts and constants.ts follow the bot's files key for key.

  • Logs is gone from the modules, the sidebar flag and setup. Setup always asks for the event log channel now.
  • The five new log channels (invites, threads, scheduled events, stickers and sounds, apps and webhooks) sit in the Channels groups. The "Server & bot" group is just "Server", since the command and settings logs no longer exist.
  • Export and import carry every portable setting the bot has (timezone, honeypot.*, appeals.*, logs.message-update-style, moderation.track-roles, …), checked with the bot's limits. Before, a bot file with timezone was reported as unsupported.
  • The rule editor offers Polls and the perChannel option of message spam.
  • Old audit rows that changed modulesLogs, logsCommand or logsSettings keep their labels.

Two settings are refused on writes, a null reset included. updatesChannel moves the follow of the support server's announcements, which only the bot sets up (syncUpdatesChannelFollow). commandsRestrictions belongs to the bot's /commands modal, and I did not port its shape. The contract types its column as plain JSON, which is recursive, and Ref<GuildData> hit "Type instantiation is excessively deep", so GuildData keeps it as unknown[]. Happy to type it properly if the dashboard should edit restrictions later.

There is no UI yet for the honeypot, appeals, time zone or the new moderation switches. They can be set from the bot and survive an export, but I'd rather add their sections in their own PRs.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. My AI open-source policy.

RetriggerView in GreptileConfidence Score: 5/5

No merge-blocking issues remain. Both previously reported problems are addressed in the current code.

Summary

This PR updates the dashboard to the bot’s V7 settings contract at 788939a.

  • Guild settings now match the bot’s V7 data contract.
  • Settings files now carry the bot’s portable guild settings.
  • Admins can set newer event logs without turning on a Logs module.
  • Auto-moderation rules can catch polls and channel-wide spam.

No outstanding findings remain, and no merge-blocking issues were identified. Tests were inspected, not run.

Reviews (2) · Last reviewed commit: "fix(database): take the appeal questions..." · Reviewed by Greptile

The bot added appeals, the honeypot, log options, five log channels, the
Polls rule and the ModerationAction indexes, and dropped modules.logs,
modules.commands, logs.command and logs.settings from its settings.

columns.ts and constants.ts follow the bot's files again. Logs is no
longer a module, the new log channels are in the Channels groups, export
and import carry every portable setting the bot has with its limits, and
the rule editor offers Polls and the perChannel option.
@coldtea-pr-lens

coldtea-pr-lens Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
  • Redraw · drawn at 65ec586, the branch has moved on

Architecture

Architecture diagram for wolfstar-project/wolfstar.rocks at 65ec586

Play the walkthrough

Inside the changed components — 1 view

Component view — Settings pipeline

Internal validation, mapping, and persistence boundaries of guild settings.

Architecture view of Component view — Settings pipeline in wolfstar-project/wolfstar.rocks

Data flow

Data flow diagram for wolfstar-project/wolfstar.rocks at 65ec586

Follow each request


Review

✨ Nothing flagged · reviewed 65ec586


Tip

Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs as before
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion

Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out on X, Bluesky, Mastodon, Reddit or LinkedIn

@wolfstar-github-agent

wolfstar-github-agent Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🤖 REVIEW PAUSED

Wolfstar Agent Kit posted this automated status. AI open source policy.

This pull request is from an outside contributor.

Add the wolfstar-agent-review label to approve automated review and verified repairs.
Approval covers head commit c90311924e6b.

  • Review and repair

Only Wolfstar's click starts work. It adds the wolfstar-agent-review label.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the tracking.ignoredKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
i18n/locales/cs-CZ/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/da-DK/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/de-DE/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/el-GR/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/en-GB/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/en-US/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/en/guilds.json Source changed, localizations will be marked as outdated.
i18n/locales/es-419/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/es-ES/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/es/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/fi-FI/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/fr-FR/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/hi-IN/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/hr-HR/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/hu-HU/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/id-ID/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/it-IT/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/ko-KR/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/lt-LT/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/nl-NL/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/pt-PT/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/ro-RO/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/ru-RU/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/tr-TR/guilds.json Localization changed, will be marked as complete. 🔄️
i18n/locales/uk-UA/guilds.json Localization changed, will be marked as complete. 🔄️
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one rough edge worth a look.

Reviewed changes

Initial review of the whole PR (single commit). Locale JSON and schema files are generated and were skimmed only; the vendor submodule bump itself can't be checked here.

  • Settings contract — columns.ts, constants.ts and types.ts add the appeals, honeypot and log options tables and keys, and drop modulesLogs, modulesCommands, logsCommand and logsSettings.
  • Validation — new validators for timezone, honeypotAction, logsMessageUpdateStyle, moderationConfirmRecentMinutes and appealsQuestions.
  • Export and import — TransferableSettings carries the portable keys the bot has.
  • Dashboard — Logs is no longer a module (sidebar, setup, module registry), five new log channels are grouped in Channels.vue, and the rule editor gains Polls and perChannel.
  • Audit — legacy labels kept for the removed keys.

I checked that normalizeAutoModerationRuleOptions is generic over the defaults, so perChannel and Polls need no extra server code, and that no source file outside the legacy audit labels still references the removed keys.

ℹ️ commandsRestrictions: null bypasses the "refused on writes" guard

The PR says commandsRestrictions is refused on writes, and the new test checks that for []. parseSettingsChanges() handles value === null before it calls the validator, so a PATCH with { commandsRestrictions: null } resets the column to [] and wipes data the bot's /commands modal owns. The refusal itself comes from validatorFor() falling through, which is easy to lose on a later refactor.

Technical details
# `null` resets a bot-owned setting

## Affected sites
- `server/database/settings/validation.ts` `parseSettingsChanges()` — the `value === null` branch runs before `validate(value)`, so a key with no dashboard validator is still reset to its default.
- `test/unit/server/database/settings-validation.spec.ts` ("refuses the settings only the bot edits") — only passes `[]`, never `null`.

## Required outcome
- A write to `commandsRestrictions`, including `null`, is refused with the same "cannot be changed from the dashboard" error.
- The test covers `null` as well as `[]`.

## Suggested approach (optional)
- Make the bot-only set explicit (e.g. a `BOT_ONLY_KEYS` set shared by the validator and the test) and reject those keys before the `null` branch.

Pullfrog  | Fix it ➔ | View workflow run | Using claude-sonnet-5-5 | 𝕏

A null in a settings request reset commandsRestrictions to [] before
its validator ran, wiping what the bot's /commands modal wrote.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the one commit pushed since the prior pullfrog review (65ec586..4a6bdb0).

  • Bot-only settings guard — validation.ts now exports BOT_ONLY_SETTINGS (commandsRestrictions) and a shared refuse validator. validatorFor() returns it for those keys and for the final fallthrough, and parseSettingsChanges() skips the null reset when the validator is refuse, so { commandsRestrictions: null } is refused like any other write. This resolves the concern from the prior review.
  • Test coverage — settings-validation.spec.ts imports BOT_ONLY_SETTINGS instead of a local copy and checks both [] and null against the refusal message.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

Comment thread server/database/settings/columns.ts
Comment thread server/database/settings/validation.ts Outdated
…ot does

The bot keeps appeal questions of any length and count, so a backup it
exported failed to import here. The updates channel moves a follow of
the support server's announcements that only the bot sets up, so the
dashboard no longer writes it.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the one commit pushed since the prior pullfrog review (4a6bdb0..c903119).

  • updatesChannel is bot-only — BOT_ONLY_SETTINGS now includes updatesChannel next to commandsRestrictions, so validatorFor() returns refuse and a null reset is refused too. Nothing in app/ writes the key and it is not in the transferable list, so imports can't reach it either.
  • Appeal questions match the bot — validateAppealQuestions accepts any text and only drops duplicates, so a bot export with long, blank or more than five questions imports instead of failing the whole file.
  • Tests — the bot-only test also checks updatesChannel with [], null and a channel id, and settings-transfer.spec.ts round-trips a 1001-character question.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@github-project-automation github-project-automation Bot moved this from Backlog to Ready in Wolfstar Site Oct 21, 2026
@RedStar071
RedStar071 merged commit d638169 into refactor/v3 Oct 21, 2026
11 of 14 checks passed
@RedStar071
RedStar071 deleted the chore/v3-bot-contract branch October 21, 2026 12:13
@github-project-automation github-project-automation Bot moved this from Ready to Done in Wolfstar Site Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant