docs/BACKEND.md
Configure the backend
This guide is for operators deploying NeonFlux's Convex backend and contributors changing its contracts. Convex was chosen for its best-in-class live-update UX and because it is self-hostable with open-source Apache 2.0 client SDKs and a source-available FSL-1.1-Apache-2.0 backend (converting to Apache 2.0 after two years). The bot calls public Convex functions for every persisted feature, each checked with a key derived from the bot secret, and the web dashboard and verification pages use their own public Convex functions. See the bot guide for commands and the web guide for dashboard and verification setup
Shared setup
Configure a cloud development deployment
NeonFlux uses a Convex cloud development deployment. Use a deployment-specific development key, which lets the CLI target that deployment without an account login on this machine. Do not use a production key or a preview or project token for this setup
- Select the development deployment in the Convex dashboard
- Open its deployment settings and copy its deployment URL, which normally ends in
.convex.cloud - Create a development deploy key with permission to deploy functions and configure environment variables
- Copy the backend environment example, a template for the Convex CLI only, to
projects/backend/.env.localand fillCONVEX_DEPLOY_KEY - Set the deployment's variables from the table below through the dashboard: the server scope,
NEONFLUX_BOT_API_SECRET, the website origin, the OAuth application ID, the Turnstile secret for web verification and the WebSub values for YouTube alerts and Twitch credentials. Local.env.localvalues do not reach the deployed functions - Set the same secret in
projects/bot/.env, withCONVEX_URLset to the copied deployment URL. The bot adopts the scope and the website origin from the deployment. See the bot guide for the bot token and the remaining bot settings
Keep the bot API secret separate from the Fluxer bot token, OAuth credentials and the Convex deploy key. The deploy key belongs only in the backend's local configuration. Never provision the whole backend .env.local with convex env set --from-file, because that would upload the deploy key into the application environment. Environment files are ignored, and only the examples belong in version control
The bot needs the deployment URL, not the HTTP Actions URL ending in .convex.site. The backend's HTTP actions are the callbacks for YouTube upload alerts and Twitch live alerts, and the bot never uses them. Copy the exact URL when using a custom domain. The backend uses standard Convex functions and environment variables with no cloud-only identity dependency, but a self-hosted deployment procedure is not documented or verified
Environment variables
| Variable | Where | Purpose |
|---|---|---|
CONVEX_DEPLOY_KEY | projects/backend/.env.local only | Lets the CLI deploy to the development deployment |
NEONFLUX_SERVER_MODE | Convex | single (default) or multi. The bot adopts it at startup and refuses to start while its own environment sets it |
NEONFLUX_SERVER_ID | Convex | The one allowed server in single mode. Must be absent in multi mode. The bot adopts it at startup and refuses to start while its own environment sets it |
NEONFLUX_BOT_API_SECRET | Convex and bot | Shared bot service secret of at least 32 characters, without surrounding spaces. The bot sends only a key derived from it |
NEONFLUX_WEBSITE_URL | Convex | Optional website origin, such as https://dashboard.example.com, using HTTPS or loopback HTTP and without a path. The bot reads it for verification links, the install note and the dashboard link, and the web server reads it as its own origin. A loopback origin is used only when set explicitly |
FLUXER_CLIENT_ID | Convex | Fluxer OAuth application ID that dashboard sign-in tokens must belong to. The web server reads it from the deployment |
NEONFLUX_SESSION_ENCRYPTION_KEY | Convex | Optional 64-character hex key for AES-256-GCM encryption of stored dashboard session tokens at rest. Leave absent only in local development |
TURNSTILE_SECRET_KEY | Convex | Cloudflare Turnstile secret for verification starts |
TURNSTILE_HOSTNAMES | Convex | Optional comma-separated exact lowercase hostnames without scheme, port or path. Defaults to the host of NEONFLUX_WEBSITE_URL. Set it only when Turnstile reports another hostname |
NEONFLUX_BACKUP_KEY | Bot only | Optional base64 encoding of exactly 32 bytes. Leave it absent to disable backup archives |
NEONFLUX_MONTHLY_CALL_BUDGET | Convex | Optional monthly budget in billed function calls for the bill guard. Leave it absent to turn the guard off |
NEONFLUX_BUDGET_WARNING_SHARE | Convex | Optional share of the budget at which the bill guard warns, above 0 and below 0.9. Defaults to 0.65 |
NEONFLUX_WEBSUB_HUB_URL | Convex | Optional address of the WebSub hub that YouTube upload alerts subscribe at, such as https://pubsubhubbub.appspot.com/subscribe |
NEONFLUX_TWITCH_CLIENT_ID | Convex | Twitch application's client ID, required with the client secret for Twitch live alerts |
NEONFLUX_TWITCH_CLIENT_SECRET | Convex | Twitch application's client secret, used only inside actions to obtain a temporary app access token |
NEONFLUX_X_BEARER_TOKEN | Convex | The operator's own paid X key, used only inside actions. Without it X feeds are off. Bluesky needs no key |
NEONFLUX_X_MONTHLY_POST_READS | Convex | Optional monthly cap on X reads, 5,000 by default |
NEONFLUX_X_POLL_MINUTES | Convex | Optional minutes between reads of an X account, 30 by default and 5 at least |
NEONFLUX_X_API_ORIGIN | Convex | For tests only: Another origin for X requests, HTTPS except on localhost |
NEONFLUX_FEED_SOURCE_LIMIT | Convex | Optional limit on the accounts one deployment follows across all servers, 1,000 by default |
NEONFLUX_WEBSUB_CALLBACK_BASE | Convex | Optional origin that the hub calls back instead of the deployment's own CONVEX_SITE_URL, such as a custom domain for its HTTP actions. It cannot have a path |
Invalid or ambiguous scope configuration, an invalid NEONFLUX_WEBSITE_URL or a short or padded bot secret fails closed with 503 Backend not configured and logs the variable to fix, never its value. Generate the bot API secret randomly and rotate it in Convex and the bot together
Service authentication and errors
The bot reaches the backend through the public functions in botService.ts, one for each path listed in this guide. The service contract lists every function by name and whether it is a query or a mutation, and the bot maps each path to its name in backend-routes.ts, so /general/manage is botService:generalManage. Each call carries key, the bound serverId and the request
The key is the lowercase hex HMAC-SHA256 of the fixed label neonflux/bot-service-key/v1 from the service contract, keyed by NEONFLUX_BOT_API_SECRET. The bot derives it and never sends the secret, so the secret does not appear in function arguments and keeps its other uses, such as leveling digests. Each function first checks the server scope and the secret, then compares the key in constant time, before it reads anything. Changing the label changes the key on both sides
The function then binds the request to one server, as described in multi-server scope, checks the path's body limit against the request's JSON text in UTF-16 code units and that the request is a JSON object, and checks the origin of native evidence. It runs the feature's own service function handler in the same transaction, and that handler checks the installation first. A bot function never calls another function, so each bot request is billed as one function call. The feature functions stay internal, and the scheduler still calls some of them directly. IDs are canonical positive decimal strings within the signed 64-bit range. Object field names in requests must be ASCII, as Convex values require
Mutations answer { value, dueIn }. dueIn is present when the mutation's writes created background work, in milliseconds from now by the backend clock, so the bot's work dispatcher can run at that time
Every request and answer has a schema in the contracts package. Each function decodes its request with it before its own checks, refusing a mismatch or an unknown key with 400, and the bot decodes every answer with it. The backend owns the domain rules. It trusts actor, permission, membership and private-conversation facts only because the bot's key vouches for them, so these fields never authenticate a browser user
Chat commands carry no revision numbers. Where a write needs the revision it changes, the bot reads it from the feature's query right before the write, so of two chat changes the later one wins. Dashboard saves keep their revision checks, as the dashboard guide describes
| Status | Meaning |
|---|---|
400 | Invalid input, or a request value JSON cannot carry |
401 | Missing or wrong key |
403 | Authorization denied, or a scope denial carrying code: "NEONFLUX_SCOPE_DENIED". Some refusals carry a reason code, see below |
404 | A missing record, or an installation function in single mode |
409 | Conflict, such as an existing name or a stale revision |
413 | Request over the path's limit |
429 | A remaining capacity bound was reached |
503 | Missing configuration or an unexpected backend failure |
Failures are Convex errors whose data holds the status, a fixed error message and, for scope denials and the refusals
below, a code. Unexpected failures answer 503 and are logged without request bodies or keys. Each path's body limit is
set in botService.ts
A refusal the bot can explain with a fix carries a stable reason code. For every code except REFUSED the bot reads
the code and never the message, and turns it into a reply that says what to change, using the native facts it read for
the request. A REFUSED message is already a sentence for members with its next step, so the bot shows it as it is
| Code | Meaning |
|---|---|
BOT_PERMISSION | The bot lacks the native permission for a moderation action or a role change |
BOT_BELOW_TARGET | The bot's highest role does not rank above the target member's |
ACTOR_BELOW_TARGET | The actor's highest role does not rank above the target member's |
ACTOR_PERMISSION | The actor lacks the native permission for the action |
TARGET_PROTECTED | The target is the bot, the server owner, an Administrator or the actor |
ROLE_NOT_ELIGIBLE | A role is not below the bot and the actor, carries more than ordinary member permissions or is a staff role |
REFUSED | A refusal a member can act on, such as a name already taken, a feature that is off or a closed vote. The error message is the sentence the bot shows |
Checks
Run these from projects/ after configuring the deployment
| 1 | pnpm --filter @neonflux/backend run codegen --typecheck disable |
| 2 | pnpm run check |
| 3 | pnpm run deploy:dev |
Codegen uses the existing deployment and writes convex/_generated/ without publishing functions. Keep those generated files in version control and regenerate them when the schema or function interface changes. pnpm run check checks formatting, then runs the contracts, backend, bot and web checks. pnpm --filter @neonflux/backend run check runs only the backend typecheck and its Node tests, which call the bot's public functions through convex-test with synthetic credentials and need no deployment credentials. pnpm run deploy:dev runs convex dev --once --typecheck disable, which publishes one development update and exits. Use pnpm --filter @neonflux/backend run dev --typecheck disable to keep watching files
Retention cleanup runs as one chain that a Convex cron starts every ten minutes, so an idle deployment runs it 144 times a day. Each run visits every feature's cleanup in bounded batches and repeats a feature while its batch is full. A run stops after about 2,048 documents or 4 MiB and schedules the next run at once, so a backlog drains in back-to-back runs. A feature whose full batch changed nothing waits for the next run instead of repeating. While a run is scheduled, the cron leaves it alone. Expired rows wait at most ten minutes, and nothing depends on an earlier run. A timeout or ban recovery whose known end has passed stops restricting its member at once, because role participation, leveling, tickets, message cleanup and backup restore ignore it before retention deletes it. A feature whose cleanup fails runs in its own sub-transaction on later runs until it succeeds, so other features keep their retention. Analytics keeps its own hourly prune, and the hourly purge of removed servers is described in server data after removal
Opt-in live smoke runner
The script is described in the bot guide
Bot foundation
Threads and channel rules
For a message in a thread, the bot sends the thread's parent channel as parentChannelId with /moderation/evaluate, /responses/evaluate, leveling candidates and metadata message events. It is validated like any other ID and must differ from the message's channel. Channel rules then match the thread or its parent: automod channels and exemptions, honeypot channels, response channel restrictions, leveling's onlyChannelIds and excluded channels, and metadata logs' message channels, excluded channels, log destinations and ticket channels. automodWindows keeps the parent with each message, so a rule scoped to a channel counts its threads' messages too. Without parentChannelId, rules match only the message's own channel
Prefix
generalSettings stores one row per server with the command prefix, the optional reply style, a revision, and the update time and actor. The prefix is one to five punctuation characters and defaults to !. The reply style is embed or text, and a row without it means embed. Changes require Manage community evidence and the expected revision, and the prefix and reply style share that revision. A chat change sets one of them, and the website saves both. The audit log records each one that changed, the reply style under the replies feature
The same row stores the desired bot nickname, absent when the bot's username should show, and the result of the last explicit change: pending, applied or failed with a reason. Nicknames have 1 to 32 UTF-16 code units, with no control characters and no surrounding spaces. Chat changes through /general/nickname and dashboard changes through the nickname configuration family share one family revision. The bot applies each change natively and reports the result through /general/nickname-result, which keeps only the result for the latest revision and nickname
AFK
afkStatuses stores one active record per server and member: Member ID, trimmed reason of 1 to 200 UTF-16 code units, and a backend timestamp. Setting AFK replaces the reason and timestamp. The member's next ordinary message deletes the record, and the same mutation looks up at most five mentioned members, deduplicated and excluding the author. There is no automatic expiry or message history. Reasons are visible to anyone who mentions the member
Custom commands and autoresponders
responseDefinitions stores content, matching rules, channel and role restrictions, cooldown, priority, enable state and timestamps. responseSettings stores separate module switches for custom commands and autoresponders, both enabled by default. New definitions are enabled, unrestricted and have a five-second per-user cooldown
- Names: 1 to 32 letters, numbers, underscores or hyphens, starting with a letter or number, lowercase and unique per kind. Every bot command namespace, such as
prefix, is reserved, except the DM-onlymydata - Cooldown: A stored wait ends early when its definition's cooldown is set to 0
- Limits: 100 definitions across both kinds, ten per list page, 2,000-unit text, 256-unit embed title, 4,000-unit embed description, 200-unit literal trigger, 20 channel and 20 role restrictions, cooldowns from 0 to 3,600 seconds and priorities from -100 to 100
- Matching: Custom commands compare the whole first token case-insensitively. Autoresponders compare trimmed content as exact or contains, never match prefixed messages, and pick by higher priority, then exact over contains, then name
- Test: The
testoperation of the autoresponder/responses/manageroute picks among the definitions with the same selection as evaluation, for a sample, a channel and the sender's roles. It reads the sender's cooldowns, writes no cooldown, configuration revision or audit entry, and stores no sample text. Only the command message's source receipt is reserved, like the other management reads - Rendering: Placeholders are
{user.name},{user.id},{user.mention},{channel.id},{server.id}and{args}. Unknown placeholders are rejected, substitution runs once, limits are rechecked afterwards and all replies disable mentions
responseReceipts stores source message IDs and the reservation, without source content, usernames or rendered replies. responseCooldowns stores per-definition, per-user eligibility deadlines. Source events must be at most 15 minutes old or one minute in the future. Evaluation first reads the module switches and the prefix. A command then reads only the custom definition of its name and other text only the autoresponders, so most messages read few or no definitions and write nothing. Only a reply reserves the source message and cooldown, atomically, so a redelivered event that replied never gets a second reply, while one that matched nothing may reply after a matching definition appears. The bot sends roleIds only after it has read the author's member, from its member cache when it holds one, which member events keep current, and without them the backend answers { send: false, memberRequired: true } when a definition could reply. A custom command that exists but does not reply, for example during its cooldown, answers { send: false, defined: true }, so the bot suggests no built-in command for it. The bot does not retry an uncertain send. Receipts expire after 24 hours and expired cooldowns are removed by the cleanup cron
Moderation, protections, DEFCON and appeals
The backend owns settings, validation, permission policy, action reservations, numbered cases and appeals. The bot owns fresh native permission and hierarchy checks and the platform actions. Configuration requires the server owner or an administrator, and other staff need a configured role for each operation
Manual moderation covers warnings, timeout and clearing, kick, permanent and temporary ban, unban, bounded message deletion, slowmode, and channel lock and restore. It starts enabled. Automod and security detection start disabled and in dry-run mode. Each case records source, actor, target, reason, action outcome, correction history and separate staff-log and member-notice outcomes. A reason is optional and stored as empty text when none was given. A warning or timeout grants its member notice with the succeeded outcome, and a kick or ban grants it with the dispatch claim, in the same transaction, so the bot sends it before the action. A notice carries the action, reason, length and whether appeals are on. A case whose action context marks the target as a bot, stored as targetBot, gets no notice, and neither do quarantines. A grant belongs to one source and case and is never replayed after a lost response or uncertain write. Actions, logs and notices still pending when the bot starts are marked uncertain once
Case, watchlist and recovery reads and recovery checks answer only a request that carries privateChannelVerified, for a one-to-one DM the bot verified, or staffChannelRoleIds, the roles other than Administrator roles that can view a server channel the bot read fresh where neither a member overwrite other than NeonFlux's own nor the everyone role shows it. The backend accepts that channel only when each of those roles is a staff role of the read, as the bot guide defines it. Both are native evidence, so in multi mode they need originServerId
- Automod: Message frequency, repeated content, mass mentions, mentions and links over time, literal whole words with an optional
*at either edge, domain allow or block lists, invite patterns and deceptive links, with channel scopes and exemptions. Detection uses message text and metadata only. One source message reserves at most one action. Repeated-content checks read only the member's recent messages with the same content hash. A rule holds up to 1000 patterns and a server's rules up to 2000 together, so each message's rule read and match work stays within the earlier ceiling of 100 rules of 20 patterns. A rule's channel lists hold up to 500 IDs and its role list up to 250, Fluxer's channel and role limits per server, and so do honeypot channels and each area's staff roles.rule-updatetakesaddPatternsandremovePatterns, applied in the transaction that saves the rule - Rolling limits:
automodWindowsrows of kindmentionorlinkhold one message's mention or link count incount, and are written only while an enabledmention-rateorlink-raterule exists. A rule reads the member's rows of its kind throughby_server_user_kind_time, newest first, and stops once the counts reach its threshold, so it reads at most 100 rows of its kind. Message frequency reads the member'smessagerows through the same index - Deceptive links: moderationLinks.ts compares a masked link's label with its target and each linked host with the built-in protected domains and the rule's patterns, as the bot guide describes. It decodes
xn--labels itself and uses a small built-in table of lookalike letters, with no dependency or network lookup - Bot messages:
/moderation/evaluatetakesauthor: "bot" | "webhook"for a message from another bot or a webhook. WhileautomodBotMessagesEnabledor automod is off, such a request returns at once and writes nothing. Otherwise the message gets no honeypot check, its grant has no target member,warnbecomeslogandtimeoutbecomesdelete, and the case reason names the author./moderation/gatereportsbotMessageProtectionEnabled, and switching it off stays available at DEFCON 1 - Gate with evaluation: A member message's
/moderation/evaluatemay carrygate: { actor, command }, the same fields/moderation/gatetakes, and then answers the gate asgatetoo. While message protection is off, such a request returns at once and writes nothing./moderation/joinanswers the settings, from which the bot derives the gate for a join - Warning limit:
warningPenaltyEnabled,warningPenaltyCount,warningPenaltyDaysandwarningPenaltySecondsin the moderation settings.warningLimitreads an absent value as off, 3, 30 or 3600, so stored settings need no migration. The first report of a warning's success answerswarningPenaltyDuewhile the member's warnings reach the count, and a repeated report stops before it counts. Only warnings with thesucceededoutcome that are not voided, within the window and numbered after the member's last case with originpenaltycount, read newest first throughby_server_user_actionandby_server_user_origin, stopping at the count or the window's start. The bot then reads the member fresh and sends/moderation/warning-penaltywith the action context and the member's role IDs. That mutation counts again and reserves the case in one transaction throughreserveAction: Atimeout, or alogcase when the mode is notenforce, the member is protected or staff, the bot may not act or a longer timeout stands. The case has originpenalty, sourcewarnings:<case>and links the warning. Since it ends the count, a repeated request or another warning of the same moment finds nothing due and answers empty. A lost answer leaves no case, and the member's next warning counts again - Protections: Join bursts, an opt-in honeypot channel that quarantines through a native timeout, and a local watchlist each create a classified case (
join-burst,honeypotorwatchlist) shown through the case commands. One join-burst case covers a burst window - Recovery: Owned timeout release and channel restore link a new case to the original action. Channel lock changes the
everyone role's
SendMessages,SendMessagesInThreads,CreatePublicThreadsandCreatePrivateThreadsoverwrite bits, and the bot first allows itself in the channel the bits it is about to deny, unless it is an Administrator. Unlock leaves that allow in place. The bot reports the posting bits it holds server-wide asbotPostingPermissionsin the action context, and a lock ownsSendMessagesplus only those thread bits, because Fluxer lets a bot stop denying only permissions it holds. The lock's recovery record and the lock and unlock grants carry the owned bits asownedPermissions, and unlock restores only them - DEFCON: Durable and restored after restart. Level 3 is normal, level 2 blocks public commands while staff work and private appeals continue, and level 1 allows only critical owner and administrator controls. Changing DEFCON does not lock channels
Member appeals use verified one-to-one DMs and reveal only the member's own cases and appeals, so banned users can appeal where Fluxer allows private messages. Staff review requires fresh authorization. A decision records the outcome, and any reversal is a separate explicit moderation action
The server owner can name one private data role in moderationSettings.privateDataRoleId, outside the backed-up settings, through the private-role operation of /moderation/manage or a dashboard moderation job. Only the owner may change it, the everyone role is refused and the change is recorded like other moderation settings. Its members and the owner may view cases, appeals and member history on the website after a live check, see private cases on the website
Cases and closed appeals are kept until erased by default. caseRetentionDays in the moderation settings, 1 to 3650 or null, sets a period from a case's creation and from an appeal's closing. A kept row's expiresAt is Number.MAX_SAFE_INTEGER, so it never enters the retention range. A change schedules moderationRetention.restamp, which stamps the server's cases and then its closed appeals in pages of 128 with the setting it reads for each page, and the retention pass rereads the setting before it deletes a row, moving its expiry instead when the setting keeps it longer. Records needed for active recovery or an appeal are excluded from expiry. Explicit owner erasure removes a case's private text, including corrections and appeal decisions, and keeps a minimal tombstone. Erasure does not remove messages already sent to staff channels, DMs or Fluxer's audit log
Publishing and scheduled publishing
Publishing
Publishing stores named drafts and templates (publishingDrafts), tracked messages with their latest confirmed content (publishingPosts), immutable send and edit attempts (publishingAttempts) and management receipts. The module starts enabled. The destination must be a text or announcement channel in the server
Content is up to 2,000 UTF-16 code units of text and one rich embed with title, description, URL, color, timestamp, author, footer, image, thumbnail and up to 25 fields, within the 6,000-character embed total. URLs use HTTP or HTTPS without credentials, and mentions are disabled. An edit verifies the exact tracked message, bot author, channel and preceding confirmed content first. The provider has no conditional edit, so an external change can still race
A send or edit grant expires after 180 seconds and needs a one-time dispatch claim, followed by a native request bounded to five seconds. Only an explicit SDK notDispatched result proves a request was not sent. Other failures stay uncertain and are never replayed. Staff can resolve a post with an unknown outcome by stating that it was sent with a given message ID or that it failed
Suggestion and event cards may go to a forum or media channel. Their send attempts carry forumPostName, so the bot creates a post with that name whose first message is the card. Such a send's outcome names the post in threadId along with messageId, which only an attempt with forumPostName may do. The attempt keeps threadId, and the tracked post's channelId becomes the post, so later edits, reads and reconciliation act in the post. Generic !publish sends stay limited to text and announcement channels, and !publish resolve cannot record a forum post as sent
Drafts, templates and tracked posts persist until deleted or forgotten. Event, schedule and milestone posts are forgotten with their history once it expires, unless their outcome is unresolved or a role panel uses them. Lists hold 10 rows: Drafts and templates in name order, where afterName continues after the last name of a page, and posts newest first, where beforePostNo continues before the last post of a page. Terminal attempt history is retained for a fixed 180 days, and management receipts for 24 hours
Scheduled publishing
Schedules copy the exact revision of a named draft or template and store a civil plan: Local time, IANA zone, fold policy for repeated minutes and daily or weekly recurrence with any whole interval from 1, that ends after a count, after a local date or never. Local minutes have four-digit years, so a repeat ends after 9999-12-31 at the latest, and a count whose last date, or a repeat without an end whose second date, would fall after it is refused with that reason. A first date whose local minute does not exist, or repeats while the fold is reject, is rejected. The bot or website job resolves the first dates, up to 26 within 180 days of the first and ending before a later local minute that does not resolve, and the backend checks each against its zone and that it is in the future. A repeat stores at most 26 dates that have not come due, each at most 180 days ahead unless none is stored. The retention chain's schedule pass adds the next dates when extendAt comes due, which is the soonest stored date's due time or when the horizon reaches the next date, 20 schedules per pass through schedules.by_extend. It resolves them with the same civil resolver, and skips a later local minute that does not exist or repeats while the fold is reject, recording it in lastSkipped. Saved UTC instants stay frozen. Schedules start disabled. Content and destination changes store the same instants again without resolving them, and a plan change stores its new first dates
Automatic sends act as the bot. They need the bot's channel permissions, the schedule, scheduling module and publishing switches, and an allowing DEFCON level. Administrators are checked when configuring. A late occurrence still sends until local midnight after its due time. While DEFCON is below 3, or while the schedule, the scheduling module or publishing is off, list holds a due occurrence instead of returning it, so the bot reads nothing from Fluxer for it and nothing checks it every minute. The occurrence is checked again at that midnight, when it is skipped as late. Turning a switch back on cannot make a held occurrence sendable, since the activation skips occurrences due before it, so turning it on wakes nothing and the occurrence is skipped as before the activation at that check. An occurrence with an open reservation is checked again earlier, when the reservation's grant ends, so list can close the reservation. Setting DEFCON to 3 schedules a wake that makes the held occurrences due again. It reads 20 due active occurrences per transaction through scheduleDeliveries.by_server_due, schedules the next page and stops if DEFCON falls below 3 again. Delivery reuses the publishing claim, outcome and reconciliation routes with scheduleContext
A server keeps at most 50 schedules. A schedule counts while it is not cancelled and has a date left to add or post, and released marks one that stopped counting. Terminal history is kept for 180 days. A content, time or destination update deletes the future occurrences it replaces that have no attempt or claim, and keeps the others as superseded
Role panels, reaction verification, autorole and reservations
Role panels, rules verification and autorole start disabled, and configuration requires the server owner or an administrator. Enabling a module does not scan the roster or assign roles retroactively
roleSettings: Module switches, humans-only autorole, up to 250 default autoroles and up to 200 per-user autorole reservations of up to 20 roles each, applied with default autoroles when that user joinsrolePanels: At most 50 reaction panels and one verification panel per server, each bound to an exact published message with up to 20 mappings that may list up to 100 prerequisite and 100 exclusion roles each. A panel keeps to 20 mappings since each reaction reads every mapped emoji, and Fluxer allows 30 reaction reads per channel every 10 seconds. A role change sends a panel's mappings, or the whole reservation list of up to 200 users, with the snapshots of up to 1,000 server roles in one bot request of at most 262,144 characters, which these bounds fit with the longest IDs. Support roles that tickets protect count as staff roles in every role check, which reads up to 1,000 of them, as many roles as a role request carries snapshots of. A server past that refuses role changes rather than risk giving a staff role, which takes more than 750 support roles replaced while tickets that name them are kept, since a server has at most 250 roles at once.published.pendingClearlists up to 40 emojis whose role changed under the posted message and whose reactions the bot has not reported cleared yetroleAcknowledgments: Rules acknowledgment, kept separate from delivery of the access roleroleOwnershipandroleReferences: Which roles the bot added for each member and membership epoch and which features still need themroleAttempts,roleWithdrawals,roleParticipationReceiptsandroleReactionJobs: Grants and outcomes, explicit withdrawals, source deduplication and bulk reaction-removal progress
Each command, reaction or join is evaluated as its own source, and a participation receipt only records that the source was applied, so a redelivered event grants nothing twice. The bot rechecks membership, role permissions and hierarchy before every assignment and never assigns the everyone role, privileged roles or roles above its own. Removal needs confirmed bot ownership in the same membership epoch and no other feature reference, so pre-existing roles are never removed. Grants use a one-time claim within 180 seconds and a five-second native request, and uncertain writes are not replayed
A reaction on the current verification panel acknowledges the rules. Configured verification gates autorole and
self-service roles, while native timeouts and unresolved quarantine block participation. A panel-update with inPlace
changes a posted reaction panel under its posted message and revision, so the grants its reactions gave stay covered by
its references. It needs a panel posted at its current revision with at least one mapping and refuses a switch to
exclusive. Each emoji whose role was added, changed or removed joins pendingClear, a reaction evaluation ignores those
emojis, and a reaction job enqueue with clearedEmojis removes them first. Such a change also raises
published.clearGeneration, and an enqueue whose clearGeneration is older removes nothing, so a clear that ran before
a newer change of the same emoji never lets its old reactions count. A reaction evaluation names the clearGeneration the
bot read its reactions under, absent meaning 0, and another one is refused with the code PANEL_CHANGED before any role
reference changes. Its continuation and the dispatch of its grant are refused the same way, so reactions read before a
change never give a role under the new mapping. After a refused evaluation the bot reads the panel and the reactions
again. A reaction evaluation also releases a role
the member holds through the panel's current key that no mapping gives anymore, with the usual ownership rules.
Configuration references of unmapped roles are deleted. Without inPlace, and for the verification panel, changing
mappings or the mode takes a new revision that needs a new published message. A panel-bind of a fresh message for a
reaction panel already posted at its revision takes a new revision, so the earlier message keeps its grants and gives no
more. The current reaction panel's post may be edited through publishing, and a confirmed edit becomes the panel's
posted content. Withdrawal and history are available through chat commands only. Each revision of a
panel keeps its own configuration references and its own withdrawal, a withdraw or autorole-withdraw operation is
deduplicated by its message and revision so one command can withdraw several, no autorole revision is withdrawn while
the current autoroles or reservations still name a role, and an exclusive choice treats the grants of every revision of
the panel as its own. Settled role history is retained for a fixed 180 days, while active and unresolved ownership
stays. When a later membership epoch records its first acknowledgment or ownership, settled rows from the member's
earlier epochs are released, and unresolved ownership stays until it is reconciled, which also finds it after the member rejoined
Role picker and member access
memberAccessLists keeps one row per server and feature name with allowed and blocked role and user IDs, up to 500 roles and 5,000 users in each list. A website save checks both role lists' roles natively and sends the server's role names, which fits one bot request of 262,144 characters with 500 roles each, and the four lists, read on every member request, stay under half of one 512 KiB backup segment. The role picker uses the feature name rolepicker. A block always wins, and empty allow lists admit every member who is not blocked
rolePickerSettings keeps the switch and up to 100 menus per server, which hold up to 1,000 roles together, and a role belongs to one menu. 1,000 is as many roles as a role request carries snapshots of, and one menu may hold all of them, since a single-choice pick checks every role of its menu in one transaction and stays within Convex's 4,096 index reads up to about 2,000 roles. With 100 menus the whole document stays under one 512 KiB backup segment even with the longest names and descriptions. A chat change sends the snapshots of the roles it adds, and a dashboard menu save those of the menu's roles. Chat changes through /rolepicker/manage need the owner or an Administrator, like other role settings, and dashboard saves use the rolepicker configuration family. Both share one family revision. Every role placed in a menu passes the same self-service checks as reaction panel mappings against fresh native role snapshots
Website member requests are dashboardConfigurationJobs rows of the member family, so they expire and are retained like other dashboard jobs, and a queued request that has not expired lists its server under the dashboard work kind of /service/work and raises the work signal. The public rolePicker:request mutation rechecks the dashboard session, the installation and the switch, then queues a claim, a drop or a lookup. It allows 10 claims or drops and 10 lookups a minute per member and server, 3 pending requests per member and 50 queued requests per server, and answers with 429 above them. A request fails after two minutes without the bot, and its record keeps only IDs, the operation and the outcome for one day
The bot reads queued requests through /rolepicker/ready and sends a fresh native member read with the server's role names and colors to /rolepicker/start. A lookup ends there and stores the member's role IDs and the names and colors of menu roles only in rolePickerSnapshots, which are deleted ten minutes later. Menu saves from chat and the dashboard also send the bot's current role names, and each menu keeps the names of its own roles as a display fallback. The website never reads roles with the member's sign-in. A claim or drop continues through /roles/evaluate with a pick operation and the usual dispatch and outcome routes under the consumer key picker:<menu>, so role ownership and other features' references decide what may be removed. /rolepicker/complete records applied or failed from the member's roles after the change and the recorded attempts, and an uncertain outcome is never replayed
Temporary roles
temporaryRoleGrants holds member data: One row per member and role while a temporary role is active or waits for its removal, bound to the latest membership epoch it was given in or moved to, with the user and role IDs, the epoch, the staff member who last set it, the end time, the next check time and an optional problem code. A row is deleted once its grant settles, so no history of ended grants is kept there. The role changes themselves are roleAttempts under the consumer key temporary, kept for the usual 180 days. temporaryRoleSettings holds up to 1,000 role defaults per server, as many roles as a role request carries snapshots of, each with an optional default and longest duration in seconds. Both tables are purged with their server
/temproles/manage gives, sets, ends and changes defaults. Grants need an actor with Manage roles, which the bot reads fresh and sends as nativePermissionAuthorized, or the owner or an Administrator. Defaults need Manage community in the same field. Giving and setting take the member's fresh context, need DEFCON 3 and check the role with the shared self-service rules on fresh snapshots, including the actor's rank. Giving also refuses a role the member already holds, because NeonFlux removes only roles it adds, and runs the shared grant checks before the row is kept. Setting counts the duration from now, and ending sets the end time to now at every DEFCON level. Every staff change of a grant raises its generation, so its source temp_<grant>_<generation> changes and dispatch fences role attempts of an older version. Default changes share the temproles configuration family revision with the dashboard
The role change runs through /roles/evaluate with a temporary operation and the grant's source. Before the end time the grant adds a desired temporary reference and reserves an addition when the role is missing. After it, the grant reserves a removal only when NeonFlux owns the role in the current epoch, the member holds it and no other reference wants it. Otherwise it releases the reference and deletes the row. A removal dispatches with the same bot-only checks as level rewards, and an unresolved attempt blocks the grant until reconcile
/temproles/work lists a server's due grants, ten at a time, closes a grant without a role change when its role was deleted, and records a problem code. A member end with explicit absence evidence before the end time keeps the grant until its end time and answers held, and after the end time it releases the reference and deletes the row. A rejoin with the bot's fresh member read moves every one of the member's grants of an earlier epoch to the new one, at most one per role and so at most 250, with a new generation and an immediate check, releases the old epoch's temporary reference, deletes grants whose end time passed and answers whether the server holds any grant. The role then comes back through the usual /roles/evaluate, whose member-state refusals for DEFCON, timeout, quarantine and missing rules acceptance carry the code MEMBER_NOT_READY. The bot records them as the problem waiting, which moves the next check to ten minutes later, or to the end time when that is sooner, and a rules acceptance moves it to now. Other problems move the next check to ten minutes later, or to the end time when that is later. A problem sent with retryAfterMs, the wait Fluxer's rate limit named for a change it refused before it was sent, records no problem code and moves the next check to after that wait, at most ten minutes. Every work operation names the grant's source and is ignored when the grant changed since
A member's grants can be deleted on request once their roles are removed. Deleting a row of an active grant would leave its role on the member, since nothing would remove it later
Newcomer checklist
onboardingSettings keeps one row per server: The switch, the greeting route that carries the checklist (welcome or dm), up to five ordered steps and an optional completion role. A step is rules, panel with a reaction panel name, menu with a role picker menu name, or link with a channel and a line of at most 100 characters. Two steps cannot name the same rules, panel, menu or channel. It is the onboarding configuration family, so chat and dashboard changes share its revision and reach the audit log. Changes need the owner or an Administrator, like other role settings, and turning it off still works at DEFCON 1. Adding a panel or menu step needs an existing reaction panel or role picker menu of that name, and the completion role passes the shared self-service role rules on fresh snapshots
Progress comes from the features' own records, with no progress table: A rules step is done when the member accepted the current published rules in their current membership, and a panel or menu step when the member holds one of its roles. A link step never needs finishing. A step whose panel or rules verification is not published, enabled and switched on, or whose menu is missing or empty or whose role picker is off, is left out until it is available again. The checklist is finished when every remaining step is done and at least one of them needs finishing
onboardingCompletions holds member data: One row per member and membership epoch that finished the checklist, with the completion time. A member's next /onboarding/member call deletes the rows of their earlier memberships, so a rejoined member keeps at most the current one. A delayed call for an earlier membership is refused with 409 and changes nothing. /onboarding/member takes the member's fresh native context and returns each step's state. While the checklist is on, it records the first completion of a membership and adds one to the day's onboarded count in analyticsDays while analytics counts. Bots never complete it. It names a completion role change with the source onboarding_<completion> while the member lacks the role and no earlier change for that completion succeeded or is unconfirmed. /roles/evaluate with an onboarding operation then adds a desired onboarding reference and reserves the addition with the shared checks: DEFCON 3, no timeout or quarantine, the self-service role rules and accepted rules when verification is configured. A change Fluxer refused or that was never sent may be tried again, and any other earlier attempt is never repeated. Onboarding never removes the role, so changing or clearing the completion role keeps the old one on members
Greeting admission appends the checklist to a new welcome or DM delivery of the configured route after rendering the template: A bold title, the numbered steps that are available and a line naming <prefix>onboarding. When the result would pass 2,000 characters, only that line is added, and nothing when even that does not fit. Greeting previews show the same text
/onboarding/get returns the settings, the revision and, for each step a member finishes by a role, the roles that finish it. The bot keeps this in memory
Setup presets
presetsDomain.ts defines the six presets that the bot guide lists. They change only the settings in their row, and only values that differ
A preset rule is created when no rule has its name. An existing rule of that name and type gets the preset's action, threshold, window, timeout duration and enabled state, and keeps its priority, patterns, channels and exemptions. A rule of that name with another type is the manager's own and stays unchanged. Presets never delete rules or other definitions, never touch channels or roles and leave every setting they do not name unchanged, so a lower security level keeps the rules a higher one added
A preview lists each change with its current and new value and a token, an eight-character hash of the preset name and the changes. Applying computes the preview again in the same transaction and fails with 409 when the token differs, so it applies exactly what was confirmed. Each changed family goes through changeConfiguration with the operation preset <name>, so the audit log has one entry per family. Applying needs the owner or an Administrator and is refused at DEFCON 1. The dashboard applies through the presets configuration family with the same token, and its job moves only that family's revision, since each changed family records its own change
Welcome and goodbye
Channel welcomes, optional DM welcomes and channel goodbyes are independent routes that start disabled and accept human members only. Each route follows a publishing template by name and keeps a copy of it from its last configuration. Admission and preview render the template's latest content and record its revision on the delivery, and fall back to the saved copy when the template is deleted or no longer valid for the route. A delivery waiting for rules verification keeps the text rendered at admission. Text fields accept {user.name}, {user.id}, {user.mention}, {server.name}, {server.id} and, for channel routes, {channel.id}, with display text escaped. Only the greeted member can be notified, through {user.mention}
Welcome timing is join or verified. A join must be a genuine event within 15 minutes whose native joinedAt matches fresh membership. Verified timing needs the current rules acknowledgment and fresh access-role presence. A goodbye needs a fresh typed member 404, after either a retained presence observation or a removal event for a human account the bot had not recorded. Enabling a route never backfills earlier joins
While DEFCON is below 3, pending hands out no candidate, because every reservation would be refused, so the bot reads
nothing from Fluxer for a greeting. It sets nextCheckAt ten minutes ahead while any greeting waits, so the bot checks
once per ten minutes. The greeting is handed out at the first check after DEFCON is 3, up to ten minutes later, if its
24 hours have not passed. While rules verification is not usable, which means the setting is off or the verification
panel is disabled, being withdrawn, unpublished or edited but not republished, discover moves a waiting verified
greeting's check ten minutes ahead instead of one. It goes back to one minute at the first check after verification is
usable, up to ten minutes later. Pending work expires after 24 hours, grants after 180 seconds, and native requests are
bounded to five seconds. Claimed sends are never replayed. One server-wide budget spaces claims across the three routes,
ten per minute by default and configurable from 1 to 60. Workers read deliveries and members in bounded pages. A member
record expires 365 days after the join it records, or one day after the member leaves, and a later presence check does
not extend it. Terminal history defaults to 30 days, configurable from 30 to 3,650
Tickets
Tickets start disabled. Owners and administrators configure any number of categories, each with visibility, an optional parent, up to 250 disclosed support roles, up to 25 intake questions and canned replies, each naming a publishing template. Intake asks one question per DM reply, and a ticket stores every answer of up to 2000 characters, so 25 questions keep the 26 tickets a ticket list reads within Convex's 8 MiB read limit. A ticket channel snapshot holds up to 500 overwrites, which keeps a transcript append with its channel under the 262,144-byte request limit. A category's canned replies are stored with it and hold at most 256 KiB of JSON together, so a page of 20 categories stays within Convex's 8 MiB read limit, and a reply past that is refused with the reason. The categories query answers 10 categories in name order with nextAfter, after a name, or only those that are on. Submitted tickets keep snapshots of their category without its canned replies, which are read from the category when one is sent. Deleting a category keeps its canned replies in a ticketRetiredCanned row under its name, which its open tickets read instead. Creating a category of that name removes the row, and deleting one again replaces it. A canned reply sends its template's latest content, or the copy saved with the reply once the template is deleted or no longer valid. Staff can also open a ticket for a help post's author, see forum help desk
Intake writes and draft reads run in a verified one-to-one DM. The bot may start one from a server message or a panel reaction, after it opened and verified the member's DM, and sends the questions there. Drafts expire after 24 hours, and each requester can have at most three drafts
and three active tickets. A plain DM names no server, so /service/ticket-intakes takes { userId }, binds no server
and answers up to 10 of that member's live drafts as { serverId, intakeNo }, limited to the configured server in
single mode. The bot then reads and changes the draft through the server's own intake functions, which keep every
membership, DM and policy check. A clear intake operation empties one answer, so a plain reply can step back to that
question. Private answers, staff notes and transcripts need fresh membership and role authority, and either a verified DM
or a destination: a fresh snapshot of the server text channel the command came from. ticketAudienceWithin in the
ticket contracts accepts a destination whose everyone overwrite denies ViewChannel and whose every overwrite allowing
it names one of the audience's roles or members. Staff notes and intake answers need the staff audience, the ticket's
support roles and the bot. Entries and transcripts need readers, which adds the requester, so the private ticket
channel passes for them and never for notes. Outside a DM the tickets list keeps only the tickets whose readers
include the destination and sets hidden when it left some out, and an attempt answers without its posted text.
Category, question and canned reply changes need an Administrator, in a DM or not. The ticket query also takes
{ channelId } and answers the ticket of that channel through tickets.by_channel. Creation
sends the full permission set in the initial request. Close and reopen change only the everyone and requester
SendMessages, SendMessagesInThreads, CreatePublicThreads and CreatePrivateThreads bits. A close owns
SendMessages plus the thread bits the ticket context's botPostingPermissions reports, records them as the ticket's
ownedPermissions until reopen completes, and each close or reopen grant carries the bits it owns. Another overwrite
allowing an owned bit blocks the close, and deletion needs explicit confirmation on a closed channel. The bot first
allows itself the owned bits in the channel, because Fluxer lets it lift a denial only of bits it holds there. A
reconcile that finds a first close or reopen step unchanged restores the ticket's state before the command (open or
closed, with its slot and body expiry), and one that finds an established channel gone retires the ticket, starting body
retention if none is running. It needs no attempt when retention already removed the last action, and an unconfirmed
creation or delete keeps its own rules. An unknown creation is never replayed or adopted. !ticket abandon releases the
requester's slot for such a ticket while native and support-role protection stay
Each ticket keeps one automatic transcript. Every close completion, including one settled by reconcile, and every transcript-capture manage operation set transcriptDueAt, while bodies are alive and the channel is known. A capture needs staff or the requester with history access, not a DM. The tickets work kind lists a server while one of its tickets is due, through tickets.by_transcript_due, and /tickets/work answers { type: "due" } with up to 10 due tickets of the server, { type: "cursor", ticketNo, sourceId } with the last saved message of the ticket channel or one public thread, and { type: "panels" } with the server's ticket panels
/tickets/transcript-append takes { serverId, ticketNo, dueAt, botId, channel, source, after, messages }: one chunk of at most 100 messages from one source, oldest first, which the bot keeps under 200,000 serialized bytes below the 262,144-byte body limit. It checks that a save is due, bodies are alive and the bot and channel snapshot match the ticket, then that after equals the source's cursor in ticketTranscriptCursors. A chunk the cursor already passed answers duplicate, and any other gap is a 409. The first chunk creates the ticket's transcript row with automatic set and records it in automaticTranscriptNo. Each chunk renders one line per message with the author's name and ID, the message ID and time, a thread name for thread messages and an indented line per attachment, embed and sticker, adds 1,500-character ticketTranscriptPages rows, raises the message count and moves the cursor in one transaction. A message keeps up to 8,000 characters of text, 100 attachments and 100 embeds of 6,000 characters, a validation bound above any real Fluxer message
/tickets/transcript-done takes { serverId, ticketNo, dueAt, outcome } and settles only the save whose dueAt is still current, so a capture asked for during a save runs again. saved and absent clear the due time. failed retries 10 minutes later, and after 6 failures clears the due time and sets transcriptFailed until the next capture. manage delete refuses with REFUSED while a save is due and the bodies are alive. The transcript-pages query answers up to 100 page texts from fromPage on, with nextPage while more remain, under the readers rule, for a transcript file. Lists read only transcript headers and a page read loads one page. Erasure clears the due time, hides every transcript at once and deletes pages and cursors in bounded batches, and purge deletes transcripts, pages and cursors the same way. Notes, replies and transcripts have no count limit
A ticket panel is a ticketPanels row of { categoryName, channelId, messageId }, at most one per category. /tickets/work { type: "panels" } answers 500 of them in category order with nextAfter, and the bot reads every page. The panel-save and panel-remove manage operations need an Administrator and run through changeConfiguration on the tickets family. A save answers the panel it replaced, and a category delete removes its panel and answers it, so the bot deletes the old message once. Backups do not carry panels, because each is bound to a live message
Closed-ticket private content expires after 30 days by default, configurable from 1 to 365. Explicit erasure hides private content immediately and then removes it, without deleting provider messages or the channel. Terminal attempt history and settled ticket tombstones expire after 30 days
Message leveling
Leveling starts disabled with 15 XP per message and a 60-second cooldown, configurable from 1 to 100 XP and 15 to 3,600 seconds, with up to 500 excluded channels and 250 excluded roles, Fluxer's channel and role limits per server. The optional onlyChannelIds, up to 500 channels, lets only messages in those channels or their threads earn XP, and excluded channels and roles still apply. A settings patch with an empty list removes the field, so every channel earns XP again. Backups keep the list with its channels as checked references, and restoring a backup without it lets every channel earn XP. The optional levelUp setting turns level-up messages on, with a channel or null for the channel of the message, and rewardsOnly. A settings patch of levelUp: null turns them off, which removes the field. An award that reaches a new level returns levelUp with that level and the channel, when the setting is on and, with rewardsOnly, the level has a reward role. Backups keep the setting with its channel as a checked reference, and restoring a backup without it leaves the current setting as it is, which its preview shows as no change. Level N begins at 100 * N² XP, capped at 100 million XP and level 1,000
Profiles store account XP and survive rejoining. Leveling stores no message bodies, names or avatars. Duplicate content is detected with an HMAC digest keyed by the bot API secret, keeping up to 64 recent digests per account for ten minutes. Events older than ten minutes or before the current membership earn nothing. Chat commands take no revision numbers
Owner and administrator corrections set absolute XP and apply in source command order. Resets need explicit confirmation, and a server reset hides old scores immediately. Credited receipts expire after a day and correction audits after 180 days. Leaderboards return 10 profiles per page. Three count tables serve the rank of the current score epoch. levelingLevels counts the profiles with XP at each level, levelingBlocks at each block of 1,000 XP within a level, and levelingScores at each exact XP, with the profile's rankXp recording what it is counted under. A rank is one plus the members with more XP, the sum of the higher levels, the higher blocks of the member's level and the higher scores of the member's block, at most about 2,200 small rows, and the member's own score row says how many others share the rank. Awards, corrections and imports move a profile's counts, and a count changes only where the level, block or score does. A server reset starts counts of a new epoch and marks the old ones to delete, 500 rows per retention pass. A server that kept scores before these tables existed has countsReady unset, answers counting for a rank and gets its profiles counted 200 per retention pass by user ID, with countsAfterUserId as the place reached. A profile awarded or corrected meanwhile is counted at once and skipped by that pass. A server first used afterwards starts ready. Up to 250 reward roles, Fluxer's role limit per server, are applied through the shared role ledger. A reward pass lists up to 500 of the member's level references, twice the reward limit, so one pass holds every reference of the current membership, and evaluates only the rewards the member's level earns and the roles of those references, since a reward not reached and never given needs no change. Awards, corrections, resets and mapping changes mark accounts, and the worker clears a mark only after a fully settled pass. An account whose pass did not settle is tried again a minute later. The bot's done operation carries held when the backend refused its role changes, which DEFCON does for additions, and nothing else was left unsettled, so not a removal that failed another way, not another target that is blocked and not retained references beyond one pass. While DEFCON is below 3, which refuses new reward grants, the backend waits an hour for such an account instead, and it checks DEFCON itself. A removal refused for another reason while DEFCON is below 3 also waits the hour, and any other failure is tried again after a minute. Returning to DEFCON 3 schedules a wake that makes the waiting accounts due again. It reads only accounts due more than a minute ahead, which leaves out the minute retries, since they come due on their own within a minute, makes 20 accounts due per transaction through levelingProfiles.by_reward_due, raises the work signal, schedules the next batch while a batch is full and stops if DEFCON falls below 3 again
Events, birthdays, anniversaries and suggestions
These features share publishing's protected posts and claim lifecycle. Their automatic sends act as the bot and need the bot's channel permissions, the module and publishing switches, and an allowing DEFCON level. Administrators are checked when configuring
Events and RSVPs
Events start disabled. A title has up to 256 code units and a description up to 1,000, the same bound in chat, the dashboard and the contracts, so the event detail reply fits one message. Each definition has a calendar with the same civil rules as schedules, with durations from 1 minute. A date of a repeat lasts up to 180 days (259,200 minutes), the window repeats store dates in. A repeat's dates are at least a day apart, so an event has at most about 200 dates running at once, which one change reads and updates in one transaction. A single date runs alone, so it may last until 9999-12-31, the last date a calendar supports, and a change that makes it a repeat checks the 180 days again. mine reads a member's replies 200 at a time in event and date order and answers each page's 20 soonest with nextCursor, and the bot reads every page and shows the 20 soonest overall. A published event stores at most 26 open dates and gets its next dates with their reminders from the retention chain's event pass, through events.by_extend, as schedules do. Its endsAt follows the last stored date, and it completes only once its repeat has no date left to add. Live reads use eventOccurrences.by_event_state, so they never read cancelled or completed dates. A calendar change on a published event maps the dates that have not started to the new dates in order, continuing past the end of the first dates with the plan's next ones, keeping their numbers, replies, seats and waitlist order, adds new dates and cancels open dates past a shorter end. Started dates never change, and a draft replaces its dates. Once a published event's first date has started, its answer carries resume: The local minute of the plan's first date after now and, under a count, the dates left from there, 0 once every counted date has started, when the minute is where the series would come next, which chat and the dashboard use as the start of a changed repeat. A schedule that is not cancelled answers the same once its first date came due. move changes one date that has not started after the backend resolves its local minute in the event's zone. A change that moved or cancelled a date with replies stores notice with the changed dates and sets noticeDueAt. The work route's notice-claim takes up to 50 members in member order across the changed dates from the notice's member cursor and claims up to 10 who replied Going or Maybe, each listed once with up to 5 changed dates and the joinedAt of their first such reply, which the bot compares with the member's current membership before it sends, and moves the cursor in the same transaction, so a member is never claimed twice for one notice, even after changing a reply between pages. notice-outcome adds the sent and failed counts. A change before a notice's first claim joins it, and a later one waits in the notice's next and becomes the next notice once the current one is claimed to the end. Notices wait while events are off or DEFCON is below 3. When a date starts, its reminders that never began sending are closed. RSVPs store one record per account and occurrence with the membership token, without names or message bodies. An RSVP without a date number answers for the earliest date that has not started and is not cancelled, and its source receipt keeps that date, so the same message sent again returns its first answer. Capacity is off or any number of seats from 1, with a first-in waitlist. An event has up to 20 reminders, so a change cancels and queues at most 520 reminder rows for its 26 stored dates, well inside Convex's per-transaction limits. Reminders default to 1,440 and 60 minutes before start and are skipped once five minutes late or when the event starts. A single date and its reminders are stored when it is set, however far ahead, so its reminders take any lead within the calendar's range, and one whose time has already passed when the date is stored or the reminders change is not queued. A repeat's reminders can be up to 257,760 minutes (179 days) before a date, since a later date and its reminders are stored once the date is 180 days ahead, and a calendar change that makes a single date a repeat is refused while a reminder is longer. A repeat with more than 26 dates gets each later date with its reminders when an earlier one starts, 26 of its steps ahead, so a reminders or calendar change is refused when a reminder would come earlier than 26 steps less one day before its date, such as 36,000 minutes (25 days) for a daily repeat, with a reason that names the stored dates. While events or publishing are off or DEFCON is below 3, list returns no reminder, so the bot reads nothing from Fluxer for one and the work dispatcher does not list it. A reminder stays due, and is listed again, with a work signal, when events or publishing are turned on or DEFCON returns to 3, if its five minutes have not passed. At the end of its window it is listed once more so that list closes it like any late reminder
A forum destination stores the post that holds the card in postId once the card's send settles, and later card edits and reminders target that post. eventSettings.threads turns discussion threads on. While it is on, a sent card in another channel sets threadDueAt, and /events/delivery lists due thread work with its list answer as threads: open with the card message, or close with the thread or post once the last occurrence ends while its repeat has no date left to add, or the event is cancelled. The bot answers with the thread operation: opened with the thread's ID, which must equal the card's message ID because a thread started on a message takes its ID, closed once the event is over, or deferred, which tries again a minute later. A thread already open keeps its close time when threads are turned off. /setup/status lists events in threadFeatures while threads are on, so the bot's check requires Create public threads
A server keeps at most 50 definitions that are not cancelled or completed. Source receipts are kept for 24 hours. Each ended or cancelled date is deleted 180 days after it ends, with its settled reminders and their posts, once its replies are gone, and terminal event history goes after 180 days
Birthdays and membership anniversaries
Two annual routes are configured separately, each with a template, destination, IANA zone and local time. A route follows its template by name and keeps a copy of it from its last configuration. Reserving a celebration saves the template's latest name, revision and content on the delivery in the same transaction, so the publication fence matches, and falls back to the saved copy when the template is deleted or no longer valid for the kind. Members opt in privately through DMs. Birthdays store month and day only, never a year or age, and February 29 maps to February 28 in non-leap years. Anniversaries keep the exact native joinedAt and count complete years. Leaving the server or changing the destination revokes consent. A birthday enrollment's optional showOnProfile, absent for off, is the member's choice to show its month and day on their profile, never the year, as Showcases and profiles describes. Every new enrollment starts without it, so a removal, a new date, leaving and consent given again all turn it off. A date that already passed when a member signs up waits for next year and records no skipped delivery. The staff deliveries query leaves out a birthday delivery's due, check and claim times, its offset and a clock-change skip reason, so staff cannot read birthdays from it
A late delivery still sends until local midnight, and a missed day does not consume that year's birthday. While DEFCON is below 3, or while the route, the milestones module or publishing is off, list holds a due delivery instead of returning it, so the bot reads nothing from Fluxer for it and nothing checks it every minute. The delivery and its enrollment are checked again at that midnight, when the delivery is skipped as late. Turning a switch back on cannot make a held delivery sendable, since the activation skips deliveries due before it, so turning it on wakes nothing and the delivery is skipped as before the activation at that check. Unlike schedules, an open reservation does not end the hold early, since the milestones list does not close reservations, so an earlier check would change nothing. Setting DEFCON to 3 schedules a wake that makes the held deliveries due again. It reads 20 due active deliveries per transaction through milestoneDeliveries.by_server_due, makes each one's enrollment due, schedules the next page and stops if DEFCON falls below 3 again. Removing enrollment deletes it immediately. Settled deliveries retire after 30 days, and body-free fences that prevent a second celebration in the same year stay for 400 days. Limits are 1,000 enrolled accounts, 4,000 retained deliveries, 1,000 staff receipts and 10,000 member receipts per server
Suggestions
Each suggestion stores its text, status, vote counts and a protected card. Each account has at most one vote per suggestion, and votes take no revision numbers. Status keeps only the latest reason, actor and time. Voter IDs stay out of public projections but are visible to database administrators. Card updates coalesce for five seconds before an edit is queued. In a forum destination the first card send creates the suggestion's post, the row keeps the post in threadId, and later edits target that post. Card work rows carry threadId and the suggestion's state as suggestionState, from which the bot sets the post's status tag. Replacing a missing card starts a new post
suggestions.reaction takes a 👍 or 👎 change on a card as the bot read it: The card's channel and message, the member's context in the destination and the choice the member's current reactions give. A message that is no current card of an open suggestion answers not-card and writes nothing. Otherwise it applies the command's checks, the module switch, DEFCON 3, the member's visibility, timeout, quarantine and rules verification and closed voting, and the same membership and observedAt fences, then writes the vote with via: "reaction" through the same applySuggestionVote as a command. A vote names the card message and the suggestion's creation time as its source, so a later command still orders after it. A clear changes only a vote a reaction set, so a command vote stays. Work operation card-index lists the posted cards of open suggestions while suggestions are on, reactions-cleared clears the reaction votes of one choice or both that were set before a moderator cleared a card's reactions, and reaction-sync takes one page of up to 100 users holding one emoji from !suggest recount. It looks up each user's vote, returns the reactors whose vote differs and is no command vote, and marks the reaction votes it confirms as observed at the read. Once every reactor of the emoji was read, reaction-sweep clears that choice's reaction votes that no reaction-sync confirmed since the recount began. reactions-cleared and reaction-sweep go through the suggestion's votes 500 at a time and answer a cursor while more remain, which the bot sends back
Limits are 1,000 staff receipts and
10,000 member receipts a day. A server keeps any number of suggestions and a suggestion any number of votes, and reaction votes write no receipts. card-index answers 200 cards a page with a cursor while more remain. Terminal suggestions expire after 180 days. Forgetting removes backend data without deleting
posted cards. A configure with a null channel clears the destination and turns suggestions off, and its revision check
works as for any other configuration
While DEFCON is below 3, list returns no cards and the work dispatcher does not list the server for suggestions, as while suggestions or publishing are off. Cards keep their changes and stay due, and returning to DEFCON 3 raises the work signal, so the bot lists them at once
Message cleanup and metadata logs
Automatic message cleanup
Cleanup starts disabled at module and channel level. Each channel policy sets an age from one hour to 365 days and can
exclude up to 8,192 authors and 8,192 messages, Convex's array limit, with up to 500 policies per server, Fluxer's limit of channels. A server keeps up to 20,000 excluded IDs across its policies, since a backup, a restore and every cleanup change read all of its policies in one transaction, about 650 KB at that total. The dashboard saves both lists of a policy whole with exclusions, and chat adds or removes several IDs with exclude. Enabling a policy needs explicit
confirmation because existing old messages may be deleted. Turning the module on or off stops the policies' sweeps 10 policies a
transaction, the first ones in the switch and the rest right after it, since each can cancel a page of 50 waiting deletions. Automatic work runs under the server automation policy: The
bot's permissions, the module and policy switches, and DEFCON. The atomic backend claim is the final check before each
delete. A claim of a queued target reserves it in the same mutation, so each deletion costs one claim and one outcome. The bot deletes a page it read moments ago with one bulk request, so a claim-batch of up to 50 targets of one channel or thread, under one claim token and with the message facts of that read, reserves them together, and one outcome-batch records the bulk request's outcome for all of them. Targets that turned ineligible are settled as skipped and left out of the grants, and a target another claim holds stays with it. The backend refuses message facts older than a minute. A batch is never sent twice. Every target expires 30
days after it settles, also one whose deletion failed or has an unknown result, because a message delete is safe to
repeat once its record is gone. Retention keeps an expired target that is still active and checks it again a day later,
so kept targets never hold up later expired ones. A policy can be deleted once none of its targets is active. A sweep
that reached the end of a channel sets the policy's next check 15 minutes ahead. advance of a page with history left sets it to now, so the channel is due again at once, unless a deletion of that page failed or has an unknown result, which waits a minute
A sweep also covers the policy channel's active threads. cleanupSweeps, cleanupPages and cleanupTargets carry an optional threadId for the thread whose history is read, while the binding's channelId stays the policy channel. An advance after an empty page may name nextThreadId, which must be greater than the current thread's ID and below the cutoff's ID boundary. The sweep then reads that thread from the cutoff boundary instead of completing, so thread IDs only grow and every sweep ends. The bot picks the oldest such thread from the server's active threads, and a sweep completes after an empty page with no next thread. Publishing and panel protection is checked against the message's own channel or thread
Pinned, system, webhook, bot and unclassifiable messages are skipped, as are protected publishing and panel messages. No message bodies or attachments are stored. Delete grants expire after 120 seconds with a five-second native request, and uncertain deletes are not retried. Settled audit expires after 30 days
Metadata logs
Metadata logs record server events, such as configuration, member, channel and role changes, message edits and deletions and all 38 audit-log actions Fluxer lists, into configured log channels. Settings hold module and category routes, per-event overrides, whether message events come from every channel or only listed ones, the listed channels and channel exclusions, up to 500 of each. Records keep at most 20 resource IDs and optional details, which the contract allows per kind of record: message author, text and earlier text up to 4,000 characters each, Fluxer's longest message, up to 10 attachments with names and links up to 512 characters, and the authors and counts of a bulk deletion. Member, resource and audit records keep up to 20 changed values of up to 300 characters, or 600 for lists, and count the rest. Audit records keep their reason up to 512 characters and at most one resource ID, none for an entry without a target. Invite records and invite audit records keep their code. A message record that keeps details stores its author, and a membership record and an audit record about a member, actions 20 to 27, that member, as the top-level authorId, indexed for member data rights. The member who made an audit change is not indexed, as moderation cases do not index their staff member, and security alert records, such as a possible impersonation, are security records that stay out of member data like the watchlist. Each author a bulk deletion counts has a row in metadataLogAuthors, removed with the record. The post text renders in the contracts and always fits one embed description of 4,096 characters, with message text in code blocks and member-chosen names escaped. Thread events are the resources types thread-create, thread-update and thread-delete, which require parentChannelId. A thread-delete record for a deleted parent carries the count of the threads the bot knew, with up to 20 of their IDs
Each server retains at most 10,000 records, and the oldest are evicted at capacity. There is no daily cap. While no
channel can be logged for messages, or neither the messages category nor a message event override is routed, the admit
answer for a message event is messages-off and writes nothing, and the bot skips message events and stops keeping
that server's message text for a minute or until a !logs change. A message event whose own route is off answers
excluded. A new settings row logs every channel, and a row without the field keeps listed mode. Settled records expire after 30 days. Delivery runs
as the bot under the automation policy with a 120-second grant and five-second request, and uncertain sends are not
replayed. !logs metadata status reports the bot's current permissions in each enabled destination
The bot reports a destination that Fluxer answered does not exist with the work operation destination-missing. It
settles an unclaimed queued, reserved or retried delivery as failed with noDispatch and problem: "channel", which
is never discovered, reserved or deferred again, counts among the failed deliveries the recovery inbox shows and expires
with its record. A repeated report returns the settled record, and a claimed delivery is refused, so its unknown outcome
stays open. Any other failed read of the destination is deferred by a minute. A claimed delivery that a retryable
failure such as a rate limit stopped before it ran is reported as an outcome of failed with unsent, which settles
it as failed with noDispatch and due a minute later, without its claim, so a fresh generation may reserve it. Every other unsuccessful
send stays uncertain and is not replayed, and such a send that returned no message may be forgotten once its window has
passed
The webhook-message-create, webhook-message-update and webhook-message-delete types sit in the messages category and follow its channel rules. Their records carry webhookId and webhookName, never authorId, so member data rights do not find them, and authorBot is false. A webhook-posts operation sets webhookPosts on the settings row, which starts absent and reads as off, and a webhook-message-create admitted while it is off answers excluded. The switch is a setting of the backup's metadata item and the export's logs family. Audit entries about webhooks and webhook-change and alert-action records may carry webhookName, ready to show
The messages work operation answers whether the module is on and a message event can reach a log channel, and whether webhookPosts is on, which the bot reads when a server starts and after each logs change, so it keeps message text at once and forgets it once message events are no longer logged. Every page of a discover walk reads up to the time of its first page, which its cursor carries, because Convex accepts a cursor only for the query that made it, and the bot starts a new walk after a failed pass. discover returns a waiting delivery only while DEFCON is not 1 and the module and the delivery's category or event route are on. Otherwise it sets the record's nextCheckAt to its expiry, so neither discover nor the work dispatcher sees it again before then. Turning the module, a route or an event route on wakes the waiting deliveries whose module and route are now on. Changing DEFCON from 1 to 2 or 3 schedules the same wake. Nothing wakes while DEFCON is 1. Each transaction reads 100 records in number order and schedules the next batch. A delivery still waiting at expiry is cancelled like any other
The counters report reads three settings rows. Retained moderation cases are the cases numbered so far minus casesRemoved, which retention increments for each case it deletes. ticketSettings.activeTickets changes with every ticket that becomes active or inactive
The security category holds the event types invite-create, invite-delete, bot-join, webhook-change, privilege-change, impersonation and alert-action, each with a count of one. A privilege-change or webhook-change record may carry its own audit entry as source, and only then an audit actor. An invite-create record may name its creator as an event actor, the account the invite event itself names. Other security records have unknown attribution. The security route starts disabled like every other category's
Security alerts and invites
alertSettings keeps one row per server with the five alert switches, which default to off, the three optional action switches kickBots, deleteWebhooks and removePermissions, which read as off while absent, up to 8,192 expected bot IDs and 8,192 expected webhook IDs, the most values Convex keeps in one array, and the invite list the bot last read for the dashboard. Chat changes carry the actor's fresh native evidence and managerAuthorized, like sticky messages, and dashboard changes use the configuration family alerts, so both share one family revision and reach the audit log. The operation { type: "expect", kind, ids, expected } marks one or more bots or webhooks expected, or stops expecting them, and the dashboard's { type: "expected-set", kind, ids } replaces one whole list. Each writes its list once and refuses a list past 8,192 IDs. The operation { type: "action", action, enabled } turns an action on or off. Turning one on needs an owner or Administrator actor in chat, and on the dashboard the job's native target asks for one. Turning an alert or an action off counts as a critical change at DEFCON 1
alertActions records the native actions the bot claims, one row per server and key, where the key is audit:<entry ID> or join:<user ID>:<joined at>. alerts/claim-action refuses a known key and rechecks that the action and its alert are on and that neither the target bot nor the actor is expected. The row starts pending, and alerts/action-outcome sets succeeded, failed or uncertain once and admits a security record of type alert-action, whose source is derived from the key. At a server's startup alerts/observe-actions turns up to 100 leftover pending rows into uncertain and records them. Nothing retries. The retention pass alerts deletes rows 24 hours after their claim, since they only stop a redelivered event from acting twice and the posted record keeps the result. /setup/status lists in alertActions the actions that are on with their alert, so the bot's check requires Kick members, Manage webhooks or Manage roles for them
The dashboard operations invites-refresh and invite-revoke run natively in the bot, which revokes the invite whose reference matches and then sends one page of the remaining invites as the execution context: Up to 100, newest first, from the operation's optional offset, with more when older invites follow. An offset past the end gives the last page, and the stored list keeps its offset. Each stored invite has a 16-character reference derived from its code, which dashboard revocations name it by, its code when the code has Fluxer's usual form of up to 64 letters, digits, _ or -, its channel, creator, uses, maximum uses, expiry, creation time and temporary flag. Chat commands read and revoke invites in the bot without a backend call
The overview reports alerts as off while every switch is off, as needing setup while metadata logs are off or neither the security category nor one of its event types is routed, and as on otherwise. Both tables join the purge of removed servers. memberData.ts exempts them, since alertSettings holds server settings and an invite list that names creators as Fluxer shows them to staff and that the next refresh replaces, and alertActions is a short-lived security record
Server-wide lockdown
lockdownSettings holds the channels a lockdown leaves out, lockdowns the server's latest lockdown and lockdownChannels one row per channel of it, which the next lockdown replaces. Fluxer's limit of 500 channels per server bounds them. A channel row holds what the bot read when the lockdown started: The everyone overwrite (present or absent, allow, deny), the posting bits it denies, NeonFlux's own overwrite and the one it sets. lockdowns.counts keeps a count per channel state, so a status reads one row and at most 20 problem rows
lockdown/manage needs the staff rule of !security lock, through authorize with the security class, and treats off as critical at DEFCON 1. Its on carries the plan the bot read. A lockdown already on queues its failed channels again, and one still restoring, or an ended one with failed or uncertain channels, refuses a new start, since only those rows know what to give back. A website job fails with that refusal as its reason, instead of showing as applied. off skips channels never written, and queues the rest, including failed and uncertain ones and queued ones a claim already reached, since the worker reads each channel before it writes. Dashboard changes use the configuration family lockdown, where on takes the plan from the job's context, settle runs in the bot and exempt-set replaces the list. Both reach the audit log. lockdown/auto starts a lockdown for anti-nuke when its settings allow, with no staff member behind it
lockdown/work takes claim, report and problems. A claim first turns writes whose five minute lease ran out into uncertain, then hands out up to 20 queued channels as writing. A report sets locked, restored, failed, uncertain, or skipped for a deleted channel, and a retry gives a claim back when its write is known unsent or Fluxer answered 429, up to 5 tries from 10 seconds and doubling, after which it fails. An explicit repeat and a lift start the tries again. A report also settles an uncertain channel from the bot's read. Nothing queues an uncertain write again. Channels written while staff lift the lockdown go back to the queue to be restored when they report. Queued and written rows sit in by_global_due, which WORK_SOURCES reads at every DEFCON level, so a restart goes on and an idle server costs nothing. moderationActions.ts refuses a channel lock while the lockdown holds the channel. Start and end each admit a security record of type lockdown-change, and the worker receives each staff log note once. The tables join the purge of removed servers, the exempt list joins backups and memberData.ts exempts them, since they name staff and channels. The overview reports a lockdown as on from start to end. Failed and uncertain channels are recovery source lockdown
Jail
jailSettings keeps one row per server with the role, the channel and how far the channel pass got, which jail/report replaces. jailRecords keeps one row per jailed member, with the role IDs they get back, at most 1,000 per server. reserveAction writes a first jail's row, before the bot sends anything, in state jailing. A later jail changes only releaseAt, its reason stays on its own case, and its grant carries no jailRoleId, so the bot writes nothing. The record holds no reason, so erasing a case leaves none behind, and recording an outcome removes the role IDs from the case's stored grant. The outcome moves the row to active, deletes it on failed or makes it jail-uncertain, and an unjail goes through releasing and release-uncertain the same way, deleting the row once confirmed. moderation/observe makes one in flight uncertain at the next start. Both refuse until moderation/reconcile, given the member's role IDs in its observation, settles the doubt from whether the member holds the jail role, without keeping those role IDs on the case. A case stays past its retention while its jail runs
jail/memory answers the settings, the IDs of active jails, which NeonFlux sets back to the jail role, and every jailed ID including doubts, which the command gate reads, once when a server starts, also while the module is off, and the moderation staff for each channel pass. jail/list follows privateRead, the rule of case lookups. participationProtection in roleClaims.ts refuses a member with a row with MEMBER_NOT_READY, so every role feature skips them with one more indexed read inside its own transaction. dropEndedFromJail takes a temporary role out of the stored list when it ended, from evaluateTemporaryRole and the end work, and on a rejoin of any grant, since a rejoin ends the old membership's ownership and a running grant gives its role back itself after the release. It reads before the reference goes, and only drops a role NeonFlux added and no other feature still needs. Showcase and profile applies, voice memberStart and opening a public ticket refuse a member with a record. A row with a length has timed and nextCheckAt, which WORK_SOURCES reads as kind jail. jail/due hands out what ended and pushes each nextCheckAt ten minutes on, so one that cannot be released never holds up the rest, and jail/release opens an unjail case with origin jail from the bot's fresh read at any DEFCON level. jail/held admits a security record of type jail-change for a rejoin or a stripped role
Changes need the owner or an Administrator, through jail/manage or the dashboard's jail family, with an audit entry. The dashboard takes settings only. Both tables join the purge of removed servers. jailRecords is in MEMBER_DATA, shown with its role IDs and kept on deletion as a moderation record. Uncertain jails, ends that could not run and channels the pass could not change are recovery source jail. Jail stays out of backups, since !jail setup makes the role and channel again and jailed members are moderation records. The export holds the settings
Bot-only staff rights
rightsSettings keeps one row per server: Whether rights are on, which roles hold which rights, at most 50 roles, and each right's limit. rightForAction in the rights contract maps each moderation action to its right. rightFor in rightsStore.ts is the one decision: For an actor whose nativePermissionAuthorized is false, on a server with rights on, whether a role in the bot's fresh read of the actor, among the roles the bot read below itself in rightRoleIds, holds the action's right, with a channel action also needing actorViewsChannel. moderation/manage asks it first, and on a yes passes the rest of the handler an actor with the native check met for that one action, so authorize, DEFCON, the staff area, reserveAction's target and rank checks and the bot's own permission all still apply. An actor who has the real permission never reaches it. moderation/query asks it for the one read an unlock, release or unjail needs first
spendRight counts the action in rightsUsage, in the transaction that reserves it, from an index range over the window. A later refusal in that transaction throws and takes the count back, so only an action that was reserved counts, and neither an unknown outcome, a reconcile nor a redelivered message counts again. Going over the member's limit or the server-wide ceiling answers right-refused instead of throwing, so its rightsSuspensions row and security record of type bot-rights commit. A suspension is read in the same transaction and holds whatever the member's roles do, until clear deletes it and the usage in each right's active window. rights/suspend writes one when anti-nuke fires, on a server with rights on. The case and grant carry viaRight, and the grant rightRoleIds, which the dispatch claim rechecks with rightStillStands, answering rightWithdrawn when rights were turned off, revoked or suspended since. rightsUsage rows last a day, the longest window, and a retention pass removes them
Who may change what is checked in rights/manage and for the dashboard in configurationNative.ts, from the bot's fresh read of the member, with revoke and turning off reachable at DEFCON 1. Everything else needs the owner. The everyone role is refused, and the dashboard's proof refuses a role NeonFlux cannot see. No dashboard operation can moderate. All three tables join the purge of removed servers, and rightsUsage and rightsSuspensions are stated exemptions from member data as security records. Suspensions are recovery source rights, as a count, since any manager reads the inbox and the dashboard section. Jail entries there name the case, not the member. Rights stay out of backups by design, and the export holds the settings
Anti-nuke
antiNukeSettings keeps one row per server, all off until a server changes it, and antiNukeIncidents a server's newest 200 incidents, with what was observed, what was done and how it ended. A new incident past that deletes the oldest, so they need no retention pass. The bot reads the settings with antinuke/get once when a server starts, so an audit entry costs no backend call. Changes need the owner or an Administrator, through requireAdministrator, and turning protection down and restoring roles count as critical at DEFCON 1. Dashboard changes use the configuration family antinuke, whose native target always asks for an owner or Administrator. Both reach the audit log
antinuke/open claims an incident before the bot acts. It claims nothing while the module is off or the same account has an incident from the last five minutes, and records an alert response in dry-run or for a trusted account. An alert never keeps a later response from claiming. antinuke/finish records the outcome once, admits a security record of type anti-nuke-incident and names the staff log channel for the bot's note, and may also settle an uncertain incident from the bot's read of the member. antinuke/observe runs at the startup of a server with the module on and turns leftover pending incidents into uncertain. Nothing retries. antinuke/incidents reads pages, one incident or the member's newest incident with roles to give back, for the owner or an Administrator, also while logs are off. The configuration view holds only counts, and the website reads the list through privateData.view under its live access check, with each view audited. A restore's native work comes first, in chat and on the website, and restore records its outcome with who did it
Both tables join the purge of removed servers and the settings join backups. memberData.ts exempts them: An incident's account ID is a security record, and the trusted list is a setting staff chose. The overview reports anti-nuke as on while the module is and the staff log or the security category can reach staff, and as needing setup otherwise. Failed and uncertain incidents are recovery source antinuke
Rules for built-in commands
commandRules holds at most 25 rows per server, one per command, with its channel and role lists. An empty list means every channel or role, and a rule with both empty is removed, so a stored rule always limits something. Only commands in LIMITABLE_COMMANDS in the command rules contract are accepted, which keeps a critical command from being limited by any path. A chat change, a dashboard job of the commandrules family and a backup restore share applyCommandRule, and changeConfiguration records the first two in the audit log
/general/get returns the rules with the prefix, and leaves the field out while a server has none, so a server without rules reads one index and pays nothing more. The bot evaluates rules itself and sends no request to do so
Temporary voice rooms
voiceGenerators stores each generator's channel, room category, room name template, default member limit, region and revision, with at most 10 per server, and panel: false when its new rooms get no controls card. voiceRooms stores each live room's channel, owner, generator and creation time, with at most 50 per server and one per owner, heldAllow, the bits a lock or hide took from an explicit allow for everyone until unlock or show gives them back, lockGrants, the members a lock gave Connect until unlock takes it back, and once known the message of its controls card and view, the name, member limit, lock, visibility and region the bot last read. Fluxer's overwrites stay the truth for every decision, and view serves only the room's website page. Generator names are channel names, which the bot applies natively. The backend validates them but does not store them
Website requests of a room owner are dashboardConfigurationJobs rows of the member-voice family. The public voice:request mutation rechecks the dashboard session, the installation and that the server has a generator, and follows the limits of member requests. voice:member shows the member's own room and recent requests. /voice/member-ready lists only unclaimed requests whose sign-in still holds. /voice/member-start claims one once and checks a new room name against the automod rules with the member's fresh roles, the bot runs it with the same checks as the chat command, and /voice/member-finish records the outcome with the refusal's reason. A claimed request with no report expires as unconfirmed and is never repeated. A room's permissions and name are never decided by the backend for these requests. The authority answer of /voice/query carries paused while DEFCON pauses the member's room commands, which the room's controls card and website page follow
Generator changes from chat follow the moderation staff rule for channel management: Owner, Administrator, or a moderation staff role together with a fresh native Manage channels read. DEFCON 1 leaves only Owners and Administrators. Dashboard changes use the shared configuration family voice. The bot records each room right after creating it and removes a record when its channel is deleted, so no retention job is needed. Occupancy, grace timers and voice state stay in the bot
Looking for group
lfgSettings holds one row per server once a manager changed a setting: the switch, the group channel, the voice generator, the minutes a group stays open, the largest size and the open group limits per host and per server, with the next group number. Chat and dashboard changes use the configuration family lfg, so they change the same settings and reach the settings history. Choosing a generator checks that voiceGenerators has it
lfgGroups holds member data: One row per open group with its number, host, activity, size, optional note and start time, card channel and message, and the time it closes. lfgMembers holds one row per member who joined, without the host. A group's rows are deleted when it starts, is cancelled or closes, so no history of groups is kept. The per-host limit counts the host's group rows, and the per-server limit counts the server's group rows, including those that wait for the worker to close them. All three tables are purged with their server
/lfg/manage posts, joins, leaves, cancels and starts groups and records a group's card. Member operations carry an actor without native evidence. Settings, and cancelling or starting another member's group before it is full, need managerAuthorized with a fresh native read, sent by the bot only after the backend refused the plain request. Expected conditions, such as a full group, a reached limit or a missing generator, answer refused with a reason rather than an error. A start names the room the bot just created. It records that room in voiceRooms under the host through the same rules as generator rooms, then deletes the group in the same transaction. A host who already owns a room keeps it, and the answer says so, so the bot deletes the new channel. A refused start leaves the group open, and the bot deletes the channel. A start error with a 4xx status other than 429 is such a refusal. A start whose answer has no status, 429 or a 5xx status is never sent again: The bot reads /voice/query state and deletes the channel only when no room record names it
/lfg/work closes up to ten groups whose close time has passed and returns them, so the bot can mark their cards. The lfg work source reads lfgGroups.by_global_expiry, also while the feature is off
Counter channels
counters holds at most 5 rows per server, one per channel, with a members or role kind, the name template and whether NeonFlux turned it off with a channel or permission problem. counterSettings holds the switch, and a server without a row has counters on. /counters/manage and the dashboard's counters configuration family share applyCounterManagement, and every change has an audit entry. /counters/query returns the view the bot keeps in memory, read once when a server starts and after a change, and /counters/work records a refused rename once, or a role count that became unreadable or readable again as countProblem, which a template changed since the bot read it leaves alone. A check makes no backend call. The overview reports counters as off without a row, on while one is on and setup when NeonFlux turned them all off, and the recovery inbox lists each one it turned off or that cannot read its count. Both tables join the purge of removed servers, and the backup's counters and counter items restore the switch and each counter, turned on
Personal reminders and giveaways
reminderSettings holds the switch, the per-member limit and stored, the count of the server's reminders that the 5,000 limit reads, so a new reminder does not read them all. reminders holds one row per reminder with its number, which is the member's own, its text as typed, the channel it was set in and its state. /reminders/work claims up to 10 due reminders before the bot sends anything, which sets claimed and a five-minute nextCheckAt. The bot reports delivered or skipped, which delete the row, retry when it sent nothing, because a member read failed or a rate limit or connection failure stopped the DM or the post, or uncertain or undelivered, which keep it for 30 days. A claim that never reported turns uncertain at the next claim, so nothing is sent twice. Only settings changes go through changeConfiguration, so the audit log and the configuration family reminders hold nothing about a member's reminders. check runs blockingContentRule on the stored text with the roles the bot read fresh, before a post in the channel
giveawaySettings holds the switch, the required role and the next number. giveaways holds one row per giveaway, whose phase says what it waits for. No entry is stored. The bot reads reactions only at a draw, so a reaction costs no backend call. /giveaways/manage and the dashboard family giveaways share applyGiveawayManagement, which only records what is wanted, and the worker does the native work. Refusals use the REFUSED code, so the bot and the dashboard show the sentence and a refused change records no audit entry
/giveaways/work drives the phases. Each step is claimed before its native work:
| Phase | Waits for | Then |
|---|---|---|
post | The worker, while publishing and the module are on at DEFCON 3 | reserve makes the publisher attempt, with consumer giveaway and source ID giveaway_<number>. Once the end time passed, at any level, done with the problem post-late, and the publisher's claim refuses too |
sending | The publisher's outcome, reported by syncGiveawayPublishing | wait once sent, post again a minute later when it never reached Fluxer, blocked when unknown and done with a problem when refused |
blocked | !publish reconcile or !publish resolve | wait once the card is known to exist |
wait | The end time, the module and DEFCON 3 | draw-claim moves to draw |
draw | The bot's report, or five minutes, after which the draw is free again since nothing was recorded | draw-record stores the winners once, or draw-gone ends it |
announce | The module and DEFCON 3 | announce-claim marks the new winners' DMs as being sent and moves to announcing |
announcing | The bot's report, or five minutes, after which the edit and the DMs count as uncertain | done |
cancel, cancelling | DEFCON 3 for the claim, then the bot's report the same way | done |
Only the card's post goes through the publisher. The edits that name the winners or the cancellation are the giveaway's own, claimed on its row, so winners' IDs stay out of the publisher's records, which last 180 days and which !mydata delete could not reach. A cancelled giveaway whose post is still on its way or unknown stays in that phase and moves to cancel once the card is known to exist. giveawayWinners holds one row per winner of each draw with how their DM went. The audit log reads only the giveaway an operation names, through AuditFocus, without its winners or host, since audit details outlive a member's data deletion
A giveaway's problemAt feeds the recovery inbox through by_problem, and the post with an unknown outcome is listed with the other publisher posts. Retention deletes a giveaway 90 days after it ended, with its winners and tracked post, and extends a giveaway whose post's outcome is unknown. Settings of both features are left out of the encrypted backup, as contracts/src/backup.ts states, and the readable export holds them without the giveaways themselves
Boards
boards.ts owns management and the bot's work, boardsStore.ts the publisher's sync and fence, removals and retention and boardsDomain.ts the card. boards holds at most 5 rows per server, with the name, emoji, channel, threshold, the selfReactions and bots switches, up to 25 ignored channels, a channel or permission problem and posted, how many post records it keeps. boardSettings holds the switch, and a server without a row has boards on
boardEntries holds one row per board and source message, created once. It holds the author's ID until a removal is queued, the source and post locations, the last count and a state. It never holds message text: The card's text exists only as posted, in the post's publishingPosts and publishingAttempts rows, and those go when the record ends or a removal is queued
/boards/work takes these operations:
indexpages through the records, once when a server startsobservereports a count at or above the threshold or any count of a message with a record. It refuses a board's channel, an ignored channel, a ticket throughtickets.by_channeland a message older than the author'smemberDataDeletionsrow, and otherwise queues the post. For a standing post it reserves the count edit when the count differs, a minute has passed, its channel is still the board's and no earlier attempt is unsettledlistreturns up to 10 due removals, and up to 10 due posts while the module and publishing are on at DEFCON 3. It deletes a queued row whose board is stopped or gonereservechecks the card's text withblockingContentRule, renders the card and reserves one send.deferwaits a minute after a failed read, anddropforgets a queued post that may no longer go outblockedstops a board, and anysetclears the problemsource-gonequeues the removal of the posts of deleted messages,source-channel-goneof a deleted channel or thread's, a page at a time, throughby_source_channelandby_source_parent, andwithdrawof one post whose readers may no longer see its source. A record whose outcome is unknown setsremoveWanted, and the removal runs when the publisher reports the outcome.remove-claimmoves one row toremovingbefore its delete, andremove-outcomeends it or waits a minute after a delete that never left. A claim without an outcome staysremovingfor 30 days, shows in recovery after a minute and is never sent again
The publisher consumer is board, with boardContext on its claim and source IDs of board_<boardId>_<messageId>_<generation>. A send that never reached Fluxer returns to queued, and an unknown outcome stays uncertain until staff settle it. reconcilePublishing reports a match here too, so a post read back stands as sent and its record stays. An edit's outcome changes no state, and an unsettled edit blocks further edits
Retention deletes records whose expiresAt passed: Those without a post 30 days after their creation, removals after 30 days and a removed board's records at once, with their tracked posts. A record with an unsettled attempt waits. A standing post has no expiresAt. A sent post past BOARD_ENTRY_LIMIT of 1,000 for its board forgets the board's oldest record, and its post stays on Fluxer. The boards and board backup families restore the switch and each board's settings, keeping an existing board's records
Sticky messages, dashboard link and member list order
Chat changes for all three carry the actor's fresh native evidence and managerAuthorized, read by the bot for the owner, Administrator or Manage community rule, like the prefix. Dashboard changes use the configuration families sticky, sidebar and memberlist. Chat and dashboard changes of a family share one family revision, and every saved change moves it, so the settings history covers both
stickyMessages keeps at most five rows per server, each with the channel, text of 1 to 2,000 UTF-16 code units, a repost interval of 10 to 3,600 seconds, 30 by default, the copy the bot posted last and a revision that every text or interval change moves. /sticky/list gives the bot a server's stickies when the server starts. /sticky/posted records a new copy only while the row still has the revision and previous copy the bot names, and otherwise answers the current row, so of two racing reposts one is kept and the other deletes its own copy. A removal answers the removed row, so the bot can delete the last copy
sidebarLinks keeps at most one link channel per server with a revision. The bot creates, renames and deletes the channel natively and then records it, and the backend validates names of 1 to 100 code units without storing them. A dashboard add names a category or none, and the bot sends the channel it created as the execution context, as for voice generators
The member list order lives in Fluxer, so memberlist stores nothing beyond its family revision. A set lists 1 to 250 distinct role IDs without the everyone role, and a dashboard set proves each role exists. A reset needs the owner or an Administrator in chat and in the dashboard. The bot applies the order natively before the change is recorded
Both tables join the purge of removed servers. The overview reports sticky messages and the dashboard link as on when a row exists and off otherwise
YouTube upload alerts
YouTube upload alerts come only from YouTube's WebSub push notifications through the hub in NEONFLUX_WEBSUB_HUB_URL, with no YouTube API key, no feed polling and no page reads. NeonFlux reads a channel's public feed, https://www.youtube.com/feeds/videos.xml?channel_id=<channel-ID>, once when a channel without a name is added, to learn its name and a recent video for !youtube test. A notification looks the same for a livestream, a premiere, a Short or any other upload, so all of them are announced as ordinary new videos, and upcoming streams are not announced. The hub calls back at the deployment's own CONVEX_SITE_URL, which Convex provides, or at the origin in NEONFLUX_WEBSUB_CALLBACK_BASE when that is set. The hub address and the callback origin must be HTTPS addresses without credentials, query or fragment, and the callback origin cannot have a path. Without both, adding a channel answers 503, the view reports configured: false and hub requests record that alerts are not configured
youtubeSources and youtubeVideos are shared by every server, so one subscription and one notification serve all servers that follow a channel. A source holds one followed YouTube channel: The mode NeonFlux wants from the hub, subscribe or unsubscribe, a secret and a callback token created once for the source, the channel's name from its feed or notifications, the newest upload its feed named, the next request time, the requests sent since the last confirmation, the lease end, the latest error and the latest notification time. youtubeVideos keeps each video seen in a notification with its title and publish time, for 30 days after the last notification that named it. youtubeSubscriptions keeps at most 10 followed channels per server, each with its alert channel, its switch, the problem that turned it off, when it was added and its last post. youtubeDeliveries keeps one alert per server, YouTube channel and video, with the title and the state queued, reserved, sent, failed, uncertain or skipped
Hub callback
http.ts serves one path, /websub/youtube?channel=<channel-ID>&token=<token>, at the callback origin. Each callback names its channel, so the source's secret is known before the body is read, and carries the source's random token, so only the hub that received the callback can answer a request
GETis the hub's answer to a request. It answers the challenge only with the source's token, for a request still waiting for its answer, with exactly the topichttps://www.youtube.com/xml/feeds/videos.xml?channel_id=<channel-ID>and the mode the source wants now. Each request takes one answer, so a repeated confirmation or refusal is refused. Anything else answers404and writes nothing. A confirmed subscription stores its lease, refused above 30 days, and renews a day before the lease ends, or halfway through a lease shorter than two days. A confirmed unsubscription deletes the source.hub.mode=deniedrecords the hub's reason and retries once with backoffPOSTis a notification of at most 64 KiB, and a larger one answers413. A body without a length header is read only up to that limit, and the signature is checked on the bytes read. A channel without a subscribing source answers404. A missing or wrongX-Hub-Signature, an HMAC with SHA-1, SHA-256, SHA-384 or SHA-512 under the source's secret compared in constant time, answers403. A body that is not UTF-8, not a feed, empty, has more than 20 entries, has an entry without its video ID, channel ID, title and published and updated times, or names another channel answers400and records nothing, so an empty or unreadable notification never counts as no news. A403or400logs one warning with the channel ID and the reason, never the secret or the body, so a rejected notification can be told apart from none. A feed that only deletes videos answers204and writes nothing. Every other accepted notification answers204once it is recorded
A video seen before is an update: Its title is refreshed and nothing is posted. A new video is recorded and gets an alert for each enabled subscription of an installed server that was added before the video was published, when it was published within the last seven days. Alerts are created 100 subscriptions per mutation, which schedules the next page, and each check for an existing alert and its insert share one transaction. A created alert raises the work signal
Channel feed
Adding a channel whose source has no name schedules one read of its public feed. The read gives up after 5 seconds, reads at most the feed's first 64 KiB and parses only the channel's name and the first entry's video ID, title and publish time. It stores the name on the source, where notifications later refresh it, and the entry as the source's preview, which the status shows as the newest video until a notification names a newer one. Nothing from the feed is stored as a seen video or creates an alert. A failed read keeps the channel ID as its name and is not retried, and adding the channel again reads the feed again while it has no name. A test alert uses the newest upload a notification or the feed named, with the text Test alert from NeonFlux above the embed, and without either it links the channel and names it when its name is known
Subscription leases
The lease sweep runs from the hourly cron Renew YouTube subscriptions, after each change of a channel's followers and at the retry time of each failed request. It sends one request for each of up to 25 due sources and runs again while its batch was full. Before each request it checks that a server still follows the channel. A source that no server follows unsubscribes instead, or is deleted when its lease already ended. The secret is created once, inside the action that sends the first request, and goes only with subscribe requests. Each request counts as a failure until the hub confirms it. A request the hub accepted waits an hour for its confirmation, and a failed one retries with equal jitter, half of a delay that starts at one minute and doubles up to six hours plus a random share of the other half
Delivery
Alerts reach Fluxer through the publisher. list returns up to 10 due alerts with each subscription's current alert channel, and skips alerts that are a day old or whose subscription is off. reserve takes the bot's fresh read of the alert channel and reserves a publishing attempt whose consumer, source and provenance are { type: "youtube", youtubeChannelId, videoId }, with the source ID youtube_<channel-ID>_<video-ID> and the title, cut to 100 characters, as the forum post name. The publisher's claim needs youtubeContext and checks that the subscription is still on with the same alert channel while publishing is on at DEFCON 3, and otherwise closes the attempt without a send. An attempt that never reached Fluxer is released and the alert waits a minute. A sent, failed or uncertain outcome is recorded and never retried, and a sent one sets the subscription's last post. defer makes an alert wait a minute after a failed read. blocked turns a subscription off with the problem channel or permission, but only while its alert channel is still the one the bot read. Retention deletes seen videos and alerts after 30 days, with an alert's tracked post and attempt, except while its outcome is unknown
Dashboard changes use the configuration family youtube, with add, which also moves a followed channel's alerts and turns them back on, and remove. Chat and dashboard changes share its revision, and audit log entries name the YouTube channel ID. The overview reports YouTube alerts as on while the server follows a channel, as needing setup when NeonFlux turned every followed channel off, and as off otherwise. youtubeSubscriptions and youtubeDeliveries join the purge of removed servers, while sources and videos stay. A source whose last follower was purged unsubscribes at its next sweep
Twitch live alerts
Twitch alerts use EventSub webhooks of type stream.online, version 1, only for events with type: "live". The backend needs both Twitch variables from the variables table, and the same HTTPS callback origin as YouTube, CONVEX_SITE_URL or NEONFLUX_WEBSUB_CALLBACK_BASE. No Twitch credential reaches the bot or browser. Each action obtains an app access token with the client credentials flow and never stores it
twitchSources holds one shared source per broadcaster. An unresolved login first occupies its own source, and a scheduled action resolves it through GET /helix/users?login=, migrating followers in pages of 100 to the stable numeric ID. A missing login records a terminal error visible in status and recovery. Sources retain their first random 32-byte secret as 64 ASCII hex characters, their subscription ID, current login and display name, latest notification, connection error and retry state. Notifications update renamed logins without changing broadcaster identity
twitchSubscriptions holds at most 10 follows per server. twitchStreams holds seen stream IDs and optional metadata for 30 days. twitchDeliveries holds one alert per server and stream. Configuration snapshots, backup, export and audit history include follows but exclude source secrets and tokens. Restoring a follow runs the same add operation, resolving the numeric ID through GET /helix/users?id= if needed
EventSub callback
http.ts serves POST /eventsub/twitch?channel=<broadcaster-ID> at the callback origin. The query identifies the source before parsing the body
- Bodies are limited to 64 KiB, ample for a single stream event and bounded before authentication, even without a length header
Twitch-Eventsub-Message-Signaturemust be a SHA-256 HMAC over message ID, timestamp and raw body bytes. Web Crypto verifies it in constant time before UTF-8 or JSON decoding. Missing or wrong signatures, tampered bodies, timestamps older than ten minutes and timestamps more than one minute ahead are refused- Signed verification challenges answer
200with the challenge astext/plain. Signed notifications and revocations answer204after a bounded recording transaction, without waiting for Twitch metadata or server fan-out - Notifications must match the source's broadcaster, subscription ID, type and version. Duplicate stream IDs schedule no second read or alert. Only live streams started after a server followed the broadcaster and within the last day produce alerts
- Revocations record Twitch's status. Notification delivery failures, failed callback verification and beta maintenance retry with backoff. Removed users, removed versions, revoked authorization and unknown reasons require operator or manager intervention, with the reason visible in status and recovery
An action makes one best-effort GET /helix/streams?user_id= read with two seconds for token acquisition and metadata together. Only the matching live stream supplies its title, game and thumbnail. A failure or an empty response uses the event's display name and Twitch link instead. Fan-out runs in pages of 100, with each delivery's uniqueness check and insert in one transaction. A new delivery raises the work signal
Subscription and delivery work
The hourly maintenance sweep checks 25 sources per pass, repeating full pages. Enabled subscriptions need no renewal and make no Twitch request during a normal pass. Twitch disables a subscription whose callback keeps failing, and its revocation message can be lost in the same outage, so the hourly cron Check Twitch subscriptions reads Twitch's list of enabled subscriptions, page by page, and subscribes again for any verified source missing from it. A failed read changes nothing, and a deployment with no verified source makes no request. The sweep deletes a remote subscription when no follower remains, including after a purge. Failed requests use YouTube's equal-jitter backoff from one minute to six hours, and accepted requests wait an hour for a lost confirmation before retrying. A retry recovers a lost create by listing that broadcaster's EventSub subscriptions, deleting the matching callback and creating it again with the same secret
The twitch worker, configuration family, publisher consumer and twitchContext follow the YouTube delivery rules. Publisher source IDs are twitch_<broadcaster-ID>_<stream-ID>. Fresh destination permission reads, blocked-channel notes, DEFCON and publishing holds, at-most-once dispatch, unknown-outcome recovery and 30-day retention apply, and an alert not posted within two hours is dropped. Purge removes server follows and deliveries, while shared sources and streams have their own lifecycle
Twitch's subscription limits charge a stream.online subscription one unit when the broadcaster has not authorized the application, and zero when authorization qualifies. The returned max_total_cost is the application's limit, not a per-server allowance. Webhook secrets must contain 10 to 100 ASCII characters, callbacks require HTTPS on port 443, and there can be at most three subscriptions with the same type and condition. The Get Users and Get Streams endpoints accept app tokens and up to 100 user filters. App tokens read public user and stream fields, not email, which needs a user token and user:read:email. Stream notifications contain neither title nor game, and stream thumbnails may show a frame from the last five minutes
Bluesky and X feeds
Feeds poll, since neither service offers NeonFlux a push. One shared system serves both: feed.ts owns management and the bot's work, feedPolling.ts the poll chain, feedDomain.ts the shared rules and rendering and feedStore.ts state. Each service has one connection file, feedBluesky.ts and feedX.ts, with the same resolve and read. A read answers items, empty, unreadable or shape-change
feedSources holds one row per followed account, whichever servers follow it, with the newest seen post ID, the next read time, failures and the last error. An unresolved handle first occupies its own source as pending:<handle>, and the lookup moves its followers in pages of 100 to the stable ID, a Bluesky DID or an X user ID. feedSubscriptions holds at most 10 follows per server. feedItems holds posts that passed selection, at most 5 per source per read, for a week. feedDeliveries holds one post per server, account and post, for 30 days with its tracked post, longer while its outcome is unknown. Backup and export include follows and exclude source state. A restored follow runs the same add operation, so an account no server follows any more starts with a first read that posts nothing
feedItemPosted in feedProviders.ts decides which posts go out, with the rules in the bot guide, and the detector evals score it as feed-posts
Polling and limits
No cron starts polling. The first follow schedules a tick with ctx.scheduler.runAt, each tick schedules the next one before it reads, so a failed read cannot end the chain, and the chain ends when no source is left. A deployment that follows nothing has no tick and no function call. The retention pass restarts a chain whose scheduled tick was lost, which reads one row. A tick reads at most 50 due sources, 5 at a time with 8 seconds per read, and ticks start at least a minute apart
- A Bluesky source waits 5 minutes between reads and an X source
NEONFLUX_X_POLL_MINUTES, 30 by default and 5 at least. Both widen to one minute for every 50 sources in the deployment, so a whole round fits the ticks that read it NEONFLUX_FEED_SOURCE_LIMITbounds the deployment's sources, 1,000 by default. An add that needs a new source beyond it is refused. At the default, a round takes 20 minutes- A failed read waits its interval times two per failure in a row, up to 6 hours or one round, and a 429 waits at least until the service's
Retry-Afteror reset time. A 429 also holds the tick's other reads of that service - While the bill guard pauses optional work, a tick reads nothing and the next one comes an hour later
- A source with no enabled follow on a served server is not read, so a server that removed NeonFlux and waits for its purge spends nothing. A claim checks at most 100 enabled follows and goes on from there at the next tick, and only a served server counts. The source is checked hourly and forgets its newest post, so a follow that comes back starts with a first read and gets no backlog. A new add reads it at once
The technology guide lists the worst-case daily calls
Bluesky
GET https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile looks an account up and gives its DID, handle and display name in one call, so com.atproto.identity.resolveHandle is not needed. app.bsky.feed.getAuthorFeed with filter=posts_no_replies and limit=25 reads it. No key is needed. A post's ID is its record key, and a publication time is the earlier of the service's indexedAt and the post's own createdAt, so an imported old post does not look new. A page holding only reposts says nothing about the account and counts as empty. tests/feed-bluesky-live.test.ts runs resolve, read, selection and rendering against the real service when NEONFLUX_FEED_LIVE=1 is set, and the aggregate check skips it
X
X is untested against the real service. feedX.ts follows X's OpenAPI document version 2.173, read on 2026-11-01, and its test drives a real local HTTP server that refuses parameter values the document does not list. It uses GET /2/users/by/username/{username}, GET /2/users/{id} and GET /2/users/{id}/tweets with max_results=5, exclude=replies,retweets and since_id. The document lists author_id and referenced_posts as expansions and not as post.fields values, so they are requested as expansions. Selection also reads the older name referenced_tweets
The key stays in the Convex deployment and only inside actions. Without NEONFLUX_X_BEARER_TOKEN, status says X is off and an add is refused. NEONFLUX_X_API_ORIGIN exists for tests and must be HTTPS except on localhost
X's pricing page, read on 2026-11-01, charges per resource returned, $0.005 for a post and $0.010 for a user, from credits bought upfront, deduplicated within a UTC day and capped at 3 million post reads per billing cycle. By that page a poll that returns nothing costs nothing, which has not been measured. NEONFLUX_X_MONTHLY_POST_READS, 5,000 by default or about $25 a month, caps what one deployment reads. A user read counts as two post reads, deduplication is not credited, and the count follows the UTC calendar month because X's billing cycle cannot be read. A tick reserves 12 reads per poll, the most one can spend, before it reads, and settles them with what X returned, so overlapping ticks cannot spend the same reads. An answer whose shape changed still counts what it returned. After that X polling waits for the next month, status says so and Bluesky goes on
Keyless scraping was rejected and no scraper exists. X sent Nitter cease-and-desist letters in August 2026, claiming that getting around its API breaks its terms
Feed delivery
The feed worker, configuration family feeds, publisher consumer feed and feedContext follow the YouTube delivery rules. Publisher source IDs are feed_<provider>_<account>_<post>, with the account's colons replaced. Fresh destination permission reads, blocked-channel notes, DEFCON and publishing holds, at-most-once dispatch and unknown-outcome recovery apply, and a post not sent within a day of publication is dropped. Audit log entries name the account ID. The overview reports feeds as on while the server follows an account, as needing setup when NeonFlux turned every followed account off and otherwise as off
Forum help desk
Chat and dashboard changes use the configuration family helpdesk, so they share one family revision and reach the settings history. /helpdesk/manage carries the actor's fresh native evidence and authorized, which the bot sets to manager for the owner, Administrator or Manage community rule or to staff for help desk staff, who also include Manage threads. Settings changes need manager, and saved answer changes accept either
helpDeskSettings keeps one row per server: Up to 10 forum or media channels, a greeting of 1 to 500 UTF-16 code units or none, a solved tag name of 1 to 50 code units, Solved by default, a reply reminder wait of 1 to 168 hours, 24 by default, or none, a staff channel for thread warnings or none and the auto-archive switch. A server without a row reads the defaults. /helpdesk/get gives the bot the settings when a server starts. helpDeskAnswers keeps at most 50 saved answers per server, each with a name of 1 to 32 lowercase letters, digits, - and _, other than list, set, remove and help, a title of 1 to 100 code units and text of 1 to 2,000. /helpdesk/answers answers one answer by name or the whole library
/helpdesk/opened records a new post of a help desk forum in helpDeskPosts once, with its thread, its forum and the time its reply reminder is due, while reminders are on. The row holds no member ID, since the bot reads the post's author from Fluxer when the reminder is due. /helpdesk/work claims at most 25 due reminders by deleting their rows, so each post gets at most one reminder even when sending fails, drops reminders of forums that left the help desk or after reminders were turned off, and says whether more are due
The thread budget guard runs while a warnings channel is set or auto-archive is on. Its next pass time starts at once when the guard turns on, and /helpdesk/work claims a due pass by moving it an hour ahead. The bot then reports with /helpdesk/guard only a pass that counted at least 900 active threads or left auto-archive changes for later. The answer says whether to warn staff, at most once every 24 hours, and a pass with changes left runs again ten minutes later
All three tables join the purge of removed servers. The overview reports the help desk as on while it serves a forum or the guard runs, and off otherwise
Escalation adds the escalate operation to /tickets/manage. It names a ticket category, the post's author, the author's join time the bot read just before and the post. The actor must be ticket staff of that category, the owner or an Administrator, the category must be enabled and the author must have fewer than three active tickets. The ticket has no intake and records the post in escalatedFrom, and its create grant carries the post too. Its creation runs as the staff member, so /tickets/dispatch checks their staff authority instead of the requester's, and the bot reads the author's membership again right before it creates the channel. The introduction links back to the post
Showcases and profiles
Both are member features that their members use on the website. Chat and dashboard changes use the configuration families showcase and profile, so each shares one family revision and reaches the audit log. /showcase/manage and /profile/manage need the actor's fresh native evidence and managerAuthorized, which the bot sets for the owner, Administrators and Manage community. The member access lists use the feature names showcase and profile. Each feature shows in !setup and the overview: showcases need setup while they are on without a channel, and profiles are on with their switch. Member sign-in lists a server under its member features while either switch is on
showcaseSettings keeps the switch, the showcase channel, an optional per-member limit of 1 to 50 and an optional wait of 1 to 10,080 minutes between a member's showcases, and the next showcase number. The limit counts showcases that still exist, and the wait counts from the member's newest showcase that still exists. profileSettings keeps the switch and an optional !profile cooldown of 1 to 3,600 seconds per member
Website requests are dashboardConfigurationJobs rows of the member-showcase and member-profile families. The
public showcases:request and profiles:request mutations recheck the dashboard session, the installation and the
switch, and allow 5 requests a minute per member, server and feature, 2 pending at once and 50 queued per server and
feature, with 429 above them. A request fails after two minutes without the bot, and its record is kept for one day.
profiles:remove deletes the member's own profile at once with the member's profile saves still queued in that server,
so a save the bot handles later cannot bring the profile back. /profile/apply refuses a request that no longer exists
with 403 and writes nothing. showcases:member and profiles:member show the member's own showcases, profile and
recent requests. showcases:member pages showcases 50 at a time with an opaque cursor, and nextCursor is null on
the last page
A showcase has a title of 1 to 100 UTF-16 code units on one line, text of 1 to 1,000 and up to 3 HTTP or HTTPS links of at most 500 characters each, stored in their normalized form. A profile has a bio of up to 300, up to 3 links and an accent color or none. /profile/show adds the level and rank while leveling is on and the member has XP, and the birthday's month and day only when the member has a birthday enrollment from the joinedAt the bot just read, the birthday route still has their consent and the enrollment's showOnProfile is set. profiles:member also returns birthday, { show } for such an enrollment without the joinedAt check, or null. profiles:birthday sets showOnProfile on that enrollment for the signed-in member, and refuses with 409 without one. Control and text direction characters are refused. NeonFlux hosts no member files and never fetches a link
The bot reads queued requests through /showcase/ready and /profile/ready and sends a fresh read of the member: roles, bot flag, timeout and display name. /profile/apply stores the profile after the switch, the access lists and automod. /showcase/start checks the sign-in grant, the switch, DEFCON 3, the publishing switch, the access lists, a timeout, the channel, the limit and the wait for a new showcase, ownership for an edit or deletion and automod, then reserves a publishing post as the bot with the source showcase and a dispatch window that ends with the request, and records the attempt on the request. The showcase row is written with the reservation, so a send in flight counts at once. Dispatch rechecks the request, its sign-in grant and the switch. /showcase/complete settles the request from the attempt: A sent attempt applies it, an edit that may have reached Fluxer keeps its new content, a failed send removes the new showcase, and an uncertain one tells the member that staff can check it with !publish reconcile. It is never sent again. A request whose attempt is still in flight is settled by its expiry, which runs ten seconds after the dispatch window and the native deadline closed. A deletion needs no publishing, since deleting the bot's own message is safe to repeat, and removes the showcase and forgets its tracked post when the bot reports the message gone
A showcase's status follows its latest attempt: posting while it is pending, unconfirmed while it is unresolved, posted with a message and failed when staff recorded a send as failed. Edits and deletions wait while the status is posting or unconfirmed. !publish forget and !publish edit refuse a showcase's tracked post, while !publish status, reconcile and resolve work on it
Automod reads the title, text and links or the bio and links with the enabled words, domains, invites and deceptive-links rules while automod is on, in dry run too. Exempt roles apply, and a showcase honors channel scopes for its channel. A profile is checked without a channel when saved, and again in the command's channel and the parent of its thread when !profile shows it, so a later rule still blocks it. The refusal names the rule. Posts and profile replies neutralize mention syntax and send no mentions
!profile reads both members fresh through /profile/show. The access lists apply to the member who asks and the member shown. The cooldown is kept in the bot's memory, so a restart clears it
Showcases and profiles are member data, as member data rights lists. All four tables join the purge of removed servers
Selective backup and restore
Backups export selected authored configuration, effective XP and channel structure. Private history, participation, receipts and live ownership are never exported. The bot encrypts archives with AES-256-GCM using NEONFLUX_BACKUP_KEY. Recovery keys and archive bytes never reach the backend. Owner commands run in a verified DM
Structure export covers categories, text, announcement, voice, forum and media channels, where an announcement channel
keeps a text channel's fields, and skips other channel types, including threads and forum posts. A forum or media item
may also carry tags of at most 20 with unique names of up to 50 characters, defaultReaction,
defaultAutoArchiveMinutes of 60, 1,440, 4,320 or 10,080 or null, sortOrder, requireTag and, for a forum only,
layout. Other channel types refuse these fields, and a forum or media topic may have 4,096 characters. An overwrite
is archived exactly as the server has it, with any allow and deny bits of up to 64 bits that do not overlap. A channel
that a ticket or a temporary voice room made is archived with managed set to ticket or voiceRoom, which the bot
learns from the backup:query operation managed (at most 100 channel IDs, each looked up in the by_channel index of tickets and of voiceRooms), because NeonFlux
forgets those rows later. The label is not part of what a channel restores to. Configuration that names an announcement,
forum or media channel counts it as a message channel reference. An export reads the database through
/backup/snapshot-page, the backup:snapshotPage service query, which checks the owner again on each page and answers
one family a page, at most 100 settings items, 100 drafts and templates, events, schedules or cleanup channels, 20 ticket categories, or 500
XP profiles, with an opaque cursor. Events and schedules are read in pages too, since a server keeps its cancelled and finished definitions
beside the live ones it limits, and a cancelled one stays out of an archive. A posted role panel is archived with its definition only, never its message, publication, reactions to clear or the roles it gave. Structure covers every
channel, up to the 500 Fluxer allows in a server. The bot encrypts the manifest, format version 2, in parts of at most 4
MiB and at most 10, 40 MiB in all, since a restore reads every part from one DM message, and refuses a larger export.
A part is the version byte 2, the archive's 16-byte ID, the part's number and the number of parts, a nonce, a tag and
the ciphertext. Its first 21 bytes are AES-256-GCM additional data, so parts cannot be swapped, reordered or mixed with
another archive's, and archiveDigest hashes every part in order. An archive of version 1 is refused by name
A preview and a restore plan are one thing. The bot sends the archive in segments. /backup/preview-start carries the
header, the digest of every segment and the archive digest, and makes the plan in state building. Each
/backup/preview-segment carries the next segment with fresh native proof, which the backend checks against its digest
and decides with backupPlanSegment in backup.ts. Categories come first with a
summary of every archived channel, which a category's cascade needs, then channels, then one segment with the match
deletes and the order item, then configuration, then XP. A segment holds at most 500 items, 100 channels and 512 KiB,
so each one is decided in one transaction. The capacity and automod pattern checks of a segment count what the settings
of earlier segments write, so a later segment decides each item as its step will find the server. A schedule that ran out of dates no longer counts toward its limit, so restoring it takes a place like a new one, at the plan and when its step runs. The last segment sets the plan ready with its planHash and an expiry a
day later. A check that receives no segment for 10 minutes is stale, the dashboard shows it as failed and the next
check replaces it. backupPlans keeps the archive hash, the owner binding, the counts by decision, the permissions and
switches the plan grants, the expiry and the counts of items by state and with a warning, so a page and a progress line
read no other item. backupItems keeps every item of a plan with its decision, reason, changed fields, a warning for an
item that deletes or posts, a rank that sorts problems first and the archived object.
backupChanges keeps one row per item with its complete list of changes, as leaf paths with the value before and after,
a mark on a setting that turns on and, for a new channel, each overwrite with the permissions it gives. An expected bot
or webhook list is one row with the IDs it drops and adds, so restoring both lists at 8,192 IDs fits unless both
also drop 8,192 other IDs. Values are never
cut. An item whose changes would pass 512 KiB is blocked as too large to show. A server has at most ten plans that are
not finished, so old checks cannot pile up: a check being built, one nobody confirmed that has not expired, or a
confirmed plan whose run has not finished. Forgotten plans do not count, and past ten a preview answers 429. A newer
preview marks the server's plan that was never confirmed as forgotten, and retention removes it in pages. A preview of
the same archive whose plan comes out with the same hash keeps the earlier plan, with its ID and hash, and moves its
expiry a day ahead, so an open page and the chat binding stay valid. A confirmed plan stays for seven days after its
expiry, its last step or !backup forget, whichever comes last, and longer while one of its items is unresolved. Confirmation binds the exact owner, plan, archive and mode. Each item
is created, updated, deleted, skipped as identical or blocked, and a step that finds the server changed since the
preview ends as a conflict. The permissions an overwrite gives are highlighted by one rule, the bits it newly allows
plus the denies it lifts, which is Fluxer's own rule for overwrite edits. The start route accepts a request whose serialized
JSON is at most 262,144 UTF-16 code units long, and the segment route at most 4,194,304, which carries a segment of at
most 512 KiB, up to 100 channel snapshots, the references, the server's list of up to 500 channels and the owner's
evidence
A channel is decided by backupNativeDecision in backupStore.ts from the
bot's fresh evidence: each observation carries the channel and the permissions NeonFlux has in it, and the proof lists
every channel of the server with its category, whether its permissions equal its category's (synced) and whether
NeonFlux manages it. The decision runs at the plan and again at the claim of a create or update and at the
apply of an identical archive channel, on fresh evidence, so a channel that changed or is gone since the preview is a
conflict. A channel that a match restore leaves alone needs no evidence. A missing channel is a create, one that differs
in any restored value is an update, one that matches is a skip, and one that tickets or voice rooms own, found by the
by_channel indexes of tickets and voiceRooms or by the archive's managed label, is a skip that is never written.
A role or member that is gone is dropped from the permissions by backupEffectiveChannel, which every comparison, grant
check and read-back uses, and it comes back as a dropped change row, so a channel whose only difference is dropped
overwrites is a skip. An overwrite for such a target that the server's channel already holds stays as it is and is no
change. What NeonFlux may write is Fluxer's own rule. A create needs Manage channels and Manage roles, since it always
sends a permission list, and no allow beyond NeonFlux's permissions in the category, or in the server without one. An
edit needs Manage channels, and for a changed permission list Manage roles and no gain beyond NeonFlux's permissions in
that channel over every old and new target. A blocked reason names the permission and the fix. Fluxer copies a
category's permission change to every channel whose permissions equal the category's, with no way to skip it, so
backupCascade allows that change only when each such channel ends with the new permissions anyway: an archived channel
that the archive gives the same permissions, or a channel of a type the archive does not hold, such as the dashboard
link, which the category's row names. Any other channel blocks the category with the move-out instruction, and a channel
that match mode deletes first asks for a second check. The category's expectedHash binds the IDs of those channels,
and a channel the cascade will reach accepts a second state, its permissions already replaced, which is stored as its
cascadeHash. Items run in this order: category creates, category updates, channel creates, channel updates, channel
deletes, category deletes, then configuration and XP. Creates run before deletes, so a full server fails safely, and a
category changes before its channels
Each archived channel keeps position, its place among its siblings in Fluxer's order, which is not part of what a
channel restores to. When an archive holds places, one order item with order set comes after every other channel item,
whenever the order differs now or the plan creates a channel. Its claim runs once no other channel item is planned,
reserved or claimed, and decides on the fresh proof, whose channel list is in Fluxer's order: each category and the top
level keep the places their archived channels hold, those places are filled in the archive's order, and
backupOrderMoves picks the fewest moves with the structure editor's movedChannels, never moving a channel NeonFlux
cannot manage or that tickets or voice rooms own. The grant carries the moves, and the bot sends them in one reorder
request and answers updated, failed with how many did not land, or uncertain. Nothing left to move settles the item
as skipped with no write
Match mode adds one thing, the deletion of the channels and categories of the six archived types that the proof lists
and the archive does not hold. They are items with extra set, and the archive must have selected structure. A
channel that tickets or voice rooms own is a skip, one that NeonFlux cannot manage is blocked, and a category that would
still hold a channel after the plan is blocked. The mode is part of planHash. An update or delete is claimed straight from planned, with no reservation and no origin.
The claim decides again, so a channel that already has the wanted values settles as updated with no write, one that
changed since the preview is a conflict, and one NeonFlux lost the permission for is blocked. The grant carries the
action and from, the channel as the claim read it, which the bot must still find right before it writes. The bot
answers updated, deleted, failed with what applied, or uncertain, judged by reading the channel back. An
update or delete that stays claimed too long ages to uncertain like a create does, but it is not an anchor: it never
keeps a plan from being forgotten, since a new check compares the server itself. Every created, updated or deleted
channel writes an audit entry under structure
A restore step writes a configuration item through the feature's own save, such as the moderation, response, role,
ticket, leveling, milestone, cleanup, greeting, metadata, publishing, general settings, analytics, voice generator,
looking for group, role picker, member access, temporary role, newcomer checklist, sticky message, command rule, security alert, help
desk, showcase, profile, YouTube, Twitch and feed operations, so revisions, role ledgers, pending deliveries, activation times and
worker wakes happen as they do for a change from chat or the dashboard. An event is written by restoreEventDraft in
events.ts as a draft made or changed by name, with its occurrences replaced as
drafts, and a schedule by restoreSchedule in schedules.ts with deliveries
for the dates ahead. backupTarget keeps a calendar whose every date passes the feature's own calendar check. A repeat
whose first date has started begins again at its first date after now through civilRestart, with a count reduced to
the dates left, and with no date left an event loses its calendar and a schedule is paused. The step writes that same
value, so the preview's hash binds what is written. A
general item records the nickname as pending under its own revision, and the bot applies it after the step and reports
the result. The moderation item also carries privateDataRoleId, which sits beside the moderation settings in its row,
and setting it is a warning. A YouTube item follows the channel again through the feature, which makes a new secret, and
it is blocked while the deployment has no WebSub hub. A Twitch item follows the broadcaster again and is blocked without Twitch credentials. A feed item follows the account again, and an X account is blocked without an X key. A counter item adds the counter again, turned on, and the running bot renames its channel at the next check. Looking for group and the newcomer checklist are blocked when the
voice generator, role panel or role picker menu they name is neither on the server nor earlier in the same plan Every on/off
switch is written as archived, and a role setting the archive leaves out is written as what absent means. A cleanup
policy that turns on, a log route that turns on or moves, and the module switch that resumes policies or routes that
stayed on are written too, since the verified owner's confirmation is the authority the feature's native step stands
for. What that step reads of live Fluxer state is checked from the bot's fresh permissions in the channel, at the plan
and again at the step: View channel, Read message history and Manage messages for cleanup, and View channel, Send
messages, Embed links and Read message history for logs. The cleanup module's confirmed plan also binds the policies it
resumes, so a policy that changes after the preview ends the module as a conflict. A channel the bot's fresh read does
not cover, such as a policy that stays on in a paused module and is not in the archive, is left to the worker, which
checks it again. The owner, DEFCON and quarantine checks run for every step, and a cleanup policy or log route that an
administrator set up restores as archived for the owner who confirms it. The plan carries a warning that says what the
item will delete or post. A role panel that is missing returns unposted with a warning to post it. A posted panel whose archived roles differ changes under its message through the same in-place edit as a staff change, so the emojis whose role changed wait for their reactions to clear, which the step's answer hands the bot with the panel to do at once, and it is blocked with the reason when that edit cannot apply: A panel that is not a reaction panel posted at its current revision, a switch to one choice, no role left or more than 40 emojis waiting to clear. A panel being withdrawn is blocked until that finishes. The step checks the
plan's hashes, the references, the capacity of a new item and the feature's rules again right before it writes and ends
as a conflict when the server changed, and a refusal from a feature's rules undoes the whole step. An XP item holds up to 100 members
and the XP season the check read. It sets each member's XP through the leveling correction, which orders by time, moves
the rank counts and audits the change, and it queues no reward roles. A member whose XP changed after the check is left
alone and the item's reason counts them, and a new season since the check makes the item a conflict. A member with a
memberDataDeletions row from on or after the archive's database read is left out at the check and at the step, and the
reason counts them without naming them. backupOrigins keeps body-free mappings from an archive channel to the channel a restore
created for it, for channels only, with no limit on how many. A channel that a restore made and somebody deleted since is made again, and its
mapping and the settings that name it point at the new channel. The bot looks up only the mappings of the archive
channels a check or a step names, up to 100 a request, through the by_origin index. A restore step checks a plan's unresolved items through an index instead of reading
every item
backupPreviewJobs keeps one row per server: the owner, the DM channel and message that carry the archive,
whether the plan deletes what the archive does not hold, the plan the latest preview made, createdAt, which is when
the latest request was made, and a state. queued waits for the bot to read the archive and the server again, running
waits for the bot to run the next items of a plan the owner confirmed, waiting holds a restore whose only remaining
items are open claims, done is a finished check or restore and failed carries owner, archive, key, refused,
error, unanswered, paused for DEFCON 1 or expired for a run that made no progress for 10 minutes. notify marks a
run confirmed in chat, whose outcome the bot posts in the DM. The archive must sit in the
owner's DM named by the request's context. A preview from chat is a newer request and replaces a queued one, and every
answer to a website request, /backup/preview-start and /backup/preview-failed, carries the requestedAt it answers and is
rejected unless that is still the latest request. A preview and a website request are refused while the job is running
or waiting
backup:restoreView returns the job and the plan to the session of the owner who made them: counts, gain, how many
items start work other than a delete, the items with a setting that turns on, so the page names them, planId,
planHash, the last moment the website may confirm, and for a confirmed plan how many items have an outcome and the
items by state, and building while the check is still being built. Once the job's plan is forgotten or removed by
retention, it returns nothing, as that plan is gone from !backup status too. settled counts every item that is not
planned, reserved, claimed or uncertain, from the plan's counts by state. backup:restoreItems pages 25 items in by_plan_rank order,
problems first, each with its stored changes, where a channel's category that the plan creates is named by its archive
name, and lists identical items and items left alone only when asked. backup:restoreRequest queues a refresh for that
owner at most every 10 seconds and not once the job's plan is forgotten or removed, and answers whether it did, raises
the work signal and gives the bot 60 seconds, after which a scheduled function records unanswered. The bot answers
with its own reads, rechecking that the sender still owns the server, or records owner, archive, key, refused or
error. owner also deletes the plan that was never confirmed
backup:restoreConfirm takes the session, a planId and a planHash. It needs the owner who made the check, the job's
own plan with that hash, ready and not forgotten, a done job and a check that has not expired. It sets confirmedAt,
starts the run and raises the work signal. A repeat answers the same confirmedAt. A chat confirmation through
/backup/manage starts the same run with notify, and on a confirmed plan whose run stopped it starts the run again. One
run goes at a time on a server, so confirming another plan meanwhile answers 409. The bot's previewReady then returns the confirmed plan with the
job, and one pass per wake runs up to 20 items with the same owner, DM and DEFCON checks a chat confirmation makes, on
Owner and DM evidence the backend accepts for 60 seconds. A blocked item, an identical setting or XP profile and a
channel a match restore leaves alone write nothing, so the bot sends their apply with no native evidence.
/backup/run-step then reports how many items the pass recorded, or that the sender no longer owns the server. It ages
claims past their dispatch window and settle time to not confirmed with the retention sweep's own helper, and the job
stays running while items wait to start, which the dispatcher sees as due work. It goes waiting when only open
claims remain and schedules runWake for the time the first one ages, which is not due work, so the bot does not poll.
runWake acts only for a job still waiting on the same plan. A pass that records an item renews the run's 10-minute
lease, and a pass that records nothing tries again after 30 seconds. The job ends done when nothing is left, which sets
the plan's settledAt and frees its place, and failed when the sender no longer owns the server or DEFCON 1 pauses it.
/backup/run-step answers with ended when its pass ended the run, so the bot posts the outcome of a run with notify.
Forgetting the plan with !backup forget, or retention removing it, ends a queued, running or waiting job that holds
it, so a late answer to that job is rejected. A scheduled previewExpire ends a running or waiting job whose lease
ran out as expired, so a run is bounded by its progress and never by the check's expiry. A run with notify that ends
this way also gets outcomeDue, which the dispatcher lists through the by_outcome index. previewReady then returns
the job with its plan and ended, and the bot takes it once with /backup/outcome-claim, which clears outcomeDue,
before it posts the outcome in the DM and runs nothing more. A new check or confirmation clears it too. The request carries no archive and no key: they stay in the bot. The row is purged with the server
Server analytics
Analytics stores aggregated counts only, with no member IDs. analyticsSettings keeps one row per server with the switch, a revision, the last change and reloadDue while the bot has not read a change the website made. A server without a row counts as on
| Table | Row | Retention |
|---|---|---|
analyticsChannelDays | Server, channel, UTC day start, message count and 24 hourly message counts | 35 days |
analyticsMessageDays | Server, UTC day start, message count, 24 hourly message counts and the message count of each channel, for at most 1,000 channels a day | 35 days |
analyticsDays | Server, UTC day start, joins, leaves and newcomer checklist completions | 400 days |
analyticsFlushes | Server, bot worker session and the highest batch number applied for it | Two days after its last batch |
/analytics/record takes a session, a batch number and 1 to 500 hour and day buckets in one mutation. It adds each hour bucket to its channel day row and its server message day row, adds each day bucket to its server day row and creates missing rows. Hours and days must be aligned to their bucket and inside their retention window. A server day lists at most 1,000 channels, and messages in further channels still count in the day's total and hours. When analytics is off, it stores nothing and returns { enabled: false, recorded: false }
A session is one run of a server's bot worker, which numbers its batches from 1 and sends them in order. A batch at or below the session's highest applied number was saved before and only its reply was lost, so it returns { enabled: true, recorded: true } without counting again. The bot resends a batch for at most a day, and session rows stay two days after their last batch, so a resent batch always finds its session
Reads take at most one row per UTC day, newest first, so a bound never drops recent days. !stats reads at most seven server day and seven message day rows. The dashboard reads at most 30 of each, plus 30 channel day rows when it shows one channel's hours
The hourly retention cron deletes at most 512 expired rows per table and 128 message day rows in one run, and schedules one immediate follow-up while a batch is full. A row is deleted once its whole bucket is older than its retention, and a session row two days after its last batch
Checklist completions are added to the day row when a member finishes the newcomer checklist, and !stats shows their seven-day total. The dashboard's analytics:dashboard query returns a zero-filled 30-day series of joins, leaves and completions, a 14-day message series, the top ten channels for 7 or 30 days and the messages per UTC hour for each day of that range. Hours cover every channel, or the one channel named by the optional channelId. analytics:save rechecks provider permission and writes the switch directly with the expected revision, like the prefix. A change it saves sets reloadDue and rings the work signal, so the dispatcher wakes the server's dashboard worker with the analytics pass. That pass calls /analytics/reloaded, which returns the switch and clears reloadDue, and applies it to the running counter at once
Multi-server scope
A deployment runs in single mode, where it serves the server in NEONFLUX_SERVER_ID, or in multi mode, where it serves the servers the bot registers. Multi mode has no server list or server limit. The deployment owns the mode, so changing it means updating the deployment and restarting the bot, which adopts it. The bot environment cannot set the mode or server ID while it uses this deployment
/service/scope checks the key and returns { scope, websiteUrl }. scope is { mode: "multi" }, or { mode: "single", serverIds } with exactly one server in single mode, and websiteUrl is the origin in NEONFLUX_WEBSITE_URL or null. The bot adopts both before starting any server runtime
serverInstallations keeps one row per server the bot has joined, with an active or removed status, joinedAt and, after removal, removedAt and the purge's purgeLeaseUntil. The bot calls these when it starts, joins a server or is removed from one. They bind no server, have a body limit of 4,096, return 404 in single mode and leave the same state when repeated. A join answers dueIn: 0, so the bot looks for work the server kept
| Path | Body | Purpose |
|---|---|---|
/service/installations/list | { cursor }, optional | Lists active servers, 500 per page, with nextCursor or null |
/service/installations/join | { serverId } | Marks the server active. A removed server becomes active again with the data the purge has not deleted. The join that starts an installation, the first or one after a removal, also answers welcome: true, so the bot posts its install note once per install |
/service/installations/leave | { serverId } | Marks the server removed and records removedAt. Its data stays for 30 days |
Every feature request selects its server with the serverId argument, which single mode may omit. It must match request.serverId and name the configured server in single mode or an active installation in multi mode. Each bot service function checks the installation in its own transaction before any domain work, so a removed server is rejected with its data kept. Otherwise the function answers 403 with code: "NEONFLUX_SCOPE_DENIED". Native evidence names the server it was read from in originServerId or memberOriginServerId, which must match the selected server. In multi mode, authority and membership facts without an origin are rejected
All servers share one service secret and so one key. Scope checks prevent accidental cross-server use but do not protect one server from a compromised holder of that secret or key. Server administrators cannot change credentials or registrations
Server data after removal
In multi mode the backend deletes a removed server's data 30 days after removedAt. An hourly cron purges one server at a time, the oldest removal first. Each run deletes at most 256 rows per table, ends early after 2,048 rows or about 4 MiB, and schedules the next run until every per-server table is empty. The installation row goes last. Moderation corrections are deleted through their case, whether or not they carry its server ID. Dashboard sessions are shared by all servers and expire on their own, and the one-row work signal is shared by the whole bot. YouTube sources and seen videos are shared by every server that follows a channel, see YouTube upload alerts. Twitch sources and streams are shared too, see Twitch live alerts. The purge makes no Fluxer requests, and single mode never purges
Every run first rechecks the installation, so a server that joins again stops its purge. Joining again after the purge finished starts with no data, and joining while it runs keeps the rows not yet deleted. Leaving again starts a new 30 days for what is left. Only one purge runs at a time, and a stopped purge resumes on a later cron run once its 10-minute lease ends
Every table with a serverId field needs an entry in PURGE_INDEXES in installationsPurge.ts, which names an index that starts with serverId. Typechecking fails until a new table is listed, and the purge tests also fail for a table without a server ID that is neither purged through its parent nor listed as shared
Background work dispatch
/service/work tells the bot's one work dispatcher which servers have due work for each background worker. It checks the key, binds no server and works in both modes. The body is { cursor, held, requestedAt }, with a 4,096 body limit, and the answer is { kinds, dashboard, cursor, nextDueIn }. kinds lists for each worker the servers with due work, oldest due first and at most 100 per worker. In multi mode only active installations appear, and in single mode only the configured server. The bot returns the opaque cursor with its next request. Due checks use the backend clock, and the bot's requestedAt only keeps each call distinct, so a cached query result never hides work that became due since. nextDueIn is the time until the earliest row of any timed source becomes due, or null. It reads one row per timed source and ignores servers and settings, so it can only be early
Each worker's rows are read from global indexes in due order, at most 100 rows per index range and request, so a server without due rows costs no reads. One request reads at most 12 MiB of rows in total, in chunks no larger than the remaining budget holds at Convex's 1 MiB document limit, and the sources it did not finish continue on the next request. Later requests of the same pass read only the sources the cursor names. The bot goes on with a cursor at once only after a pass that found work. When new work, a due time or the two-minute check starts a pass, its first request reads every source and sends the earlier cursor as held. Each source that request leaves unfinished goes on from the further of its new and held positions, so a cursor never hides new work. Due rows that no worker will act on, such as those of removed servers or paused features, are still read on each request until they change or are purged. A range that filled its page continues after its last row on the next request, so such rows delay but never hide other servers' work. A server is listed only when the worker's own function would act, so settings that pause a worker, a held lease or work due later keep it off the list
| Worker | Listed when | Index |
|---|---|---|
dashboard | A job waits for the bot and has not expired, or the website changed the analytics switch. Every dashboard job table is read by state. dashboard names for each listed server the worker passes its jobs need, such as roles, messages, configuration or analytics, so the bot reads only those job kinds, and a new job table needs its pass named | by_state on each dashboard job table, analyticsSettings.by_reload |
verification | A solved or redeemed proof has no outcome, while advanced verification is on at DEFCON 3 | verificationLinks.by_global_ready |
events | A queued, blocked or unclaimed reserved reminder is due while events and publishing are on at DEFCON 3 or its window has ended, or a waitlist occurrence, a discussion thread to start or close or a notice to members is due while events are on at DEFCON 3 | eventDeliveries.by_global_due, eventOccurrences.by_global_work, events.by_global_thread_due, events.by_global_notice_due |
schedules | An active delivery's due time and check time have passed | scheduleDeliveries.by_global_discovery |
milestones | An enrollment's check time has passed | milestoneEnrollments.by_global_discovery |
suggestions | A changed card is due while suggestions and publishing are on at DEFCON 3 | suggestions.by_global_work |
cleanup | An enabled policy is due while cleanup is on and DEFCON is not 1 | cleanupPolicies.by_global_due |
metadata | A record with delivery work is due | metadataLogRecords.by_global_work |
temproles | A temporary role grant's end time, or its retry time after a problem, has passed. DEFCON does not pause removals | temporaryRoleGrants.by_global_due |
levels | A dirty level profile's reward time has passed, or a reward sweep is pending | levelingProfiles.by_global_reward_due, levelingSettings.by_sweep |
helpdesk | A reply reminder is due, or a thread budget pass is due while the guard is on | helpDeskPosts.by_global_due, helpDeskSettings.by_guard_due |
tickets | A ticket's transcript save is due | tickets.by_transcript_due |
lfg | An open group's close time has passed | lfgGroups.by_global_expiry |
youtube | A queued YouTube alert is due while publishing is on at DEFCON 3 | youtubeDeliveries.by_global_due |
twitch | A queued Twitch alert is due while publishing is on at DEFCON 3 | twitchDeliveries.by_global_due |
feed | A queued feed post is due while publishing is on at DEFCON 3 | feedDeliveries.by_global_due |
board | A queued board post is due while the module and publishing are on at DEFCON 3, or a board post is due for removal at any level | boardEntries.by_global_due |
reminders | A reminder's time came while reminders are on at DEFCON 3, or a claim ran out at any level | reminders.by_global_due |
giveaways | A card, draw, card edit or lost claim is due, under the gates of its phase | giveaways.by_global_due |
The bot learns about new work in three ways, so it needs no short poll. workSignal holds one row with a counter. Website writes that create bot work raise it in their own transaction: queued dashboard configuration, message, metadata and role jobs, role picker member requests, permission check requests, private case access checks, backup preview refreshes, structure editor reads, closed thread requests and saves, a solved web verification and a saved dashboard prefix, which leaves a settings log record. Scheduled wake batches raise it too when they make held work due: metadata log deliveries, scheduled posts, birthday and anniversary posts and level rewards. So does returning to DEFCON 3, for the suggestion cards and event reminders it held, and turning events or publishing on, for the event reminders that came due while they were off. So does a new YouTube video that creates alerts. The bot subscribes to /service/work-signal, a key-checked query that returns only { version }, and dispatches when it changes. A bot mutation reports dueIn for the rows it wrote to these tables that its sources would read, by the same prefix and due order, so the bot's own writes do not touch the shared row. Each dispatch reports nextDueIn for later work. The bot still dispatches every two minutes, which also picks up work that becomes actionable without a write, such as an expired lease or a reopened setting
Bill guard
Convex bills query, mutation, action, HTTP action and file storage calls as function calls, and counts explicit client calls, scheduled executions and subscription updates, as its limits and usage limits pages describe. Convex documents no way for a deployment's own functions to read its billed usage, so NeonFlux counts the calls the bot causes itself. The Convex documentation does not say whether a query answered from its cache is billed, so the bot counts every call it makes
The bot counts each function it calls and each work signal update it receives. At startup, every five minutes and on a normal shutdown it reports the calls counted since its last accepted report to /service/usage, a key-checked mutation that binds no server and works in both modes. The body is { calls }, a whole number of at most 100,000,000, with a 4,096 body limit. The backend adds it to the current UTC month's row in usageMonths, the window on which Convex monthly usage limits reset, and answers { month, calls, budget, state, warn }. The report costs one call every five minutes, about 8,900 a month per bot process, and the bot counts it in its next report. A failed report keeps its calls for the next one. A report whose answer was lost is counted again, which errs toward pausing early. Each bot process reports its own calls, so the month's total covers all of them
NEONFLUX_MONTHLY_CALL_BUDGET sets the budget in function calls, not money, because NeonFlux does not hard-code plan prices or included amounts. Convert a spending budget with the Convex plan's price per call. Without a budget the state is always normal, and reports still record the month's calls. With a budget the state is:
| State | From | Bot behavior |
|---|---|---|
normal | Below the warning share | Everything runs |
warning | NEONFLUX_BUDGET_WARNING_SHARE of the budget, 0.65 by default | The month's first report at or past the warning share answers warn: true, and the bot logs one warning |
paused | 90 percent of the budget | The bot pauses optional work, as the bot guide describes, until a report answers another state |
The state follows each report, so raising the budget resumes optional work at the next report, within five minutes, and a new UTC month starts at zero. A malformed setting answers 503 Usage budget not configured correctly with the code USAGE_BUDGET_INVALID and logs the variable to fix. The report is not counted, so the bot keeps its calls for the next report and pauses optional work until a report succeeds
The count leaves out calls the bot does not cause: the website's dashboard and verification functions and their subscriptions, which grow with dashboard use, and scheduled functions. The scheduled jobs are the ten-minute retention chain, which continues itself while expired rows remain, and the hourly analytics cleanup, installation purge and YouTube lease sweep, so at least about 6,500 runs a month. Feed polling adds up to 4,320 calls a day while any account is followed, as the technology guide lists. YouTube's hub causes calls too: Each notification runs one HTTP action and one mutation, and each subscription request runs one action and two mutations, plus one HTTP action and one mutation for the hub's confirmation. Every followed channel sends a request about once per lease, and each upload or change of its videos sends a notification. Set the budget with room for these, and keep Convex's own warning and disable thresholds, set in the team's spending limits or the deployment's usage limits, well above the bill guard as a last resort. A disable threshold stops the whole deployment, moderation included
Dashboard and web verification
The dashboard uses separate public Convex functions with its own Fluxer OAuth sign-in, checked against FLUXER_CLIENT_ID, and a revocable session that ends after 30 days without use and at most 90 days after sign-in. Sign-in lists the servers where the user is the owner or has Manage community or Administrator, limited to installed servers, and every dashboard request rechecks the installation. Writes recheck provider permission and queue a short-lived job bound to the session and the family revision. A job's operation holds at most 524,288 characters, which fits the largest lists the families allow and keeps the job well inside Convex's 1 MiB document limit. The bot then executes it with fresh native evidence through the /dashboard-configuration, /dashboard-messages, /dashboard-metadata and /dashboard-roles functions. Browser input never supplies native permission proof, and bot credentials never reach browser code. See the web guide
The bot claims each request whose native work comes before the backend records it, such as a dashboard link, voice
generator, member list or invite revocation change, through /dashboard-configuration/claim before it touches Fluxer.
The claim rechecks the grant, the family revision and the DEFCON rules as the execution does, and turns an outdated,
revoked or forbidden request into a conflict or failure before any native work. For a dashboard link change it also
names the channel the link is recorded as, read together with the revision check. A chat change that lands while the bot
is applying a claimed request can still end it as a conflict
Reads are live queries, one per dashboard view, so the website subscribes only to what the open section shows. dashboardViews holds the general view with the prefix and reply style, the role view with role settings, panels and recent role jobs, the recent message jobs, the overview and the template choices. The overview reports each feature as on, needing setup, such as a missing channel or first entry, or off. setupCheck.ts computes these states for both the overview and the bot. Template choices carry each saved template's and draft's kind, name and revision, never its content, in pages ordered by kind and then name. Each page holds up to 100 drafts and templates together, or fewer once it has read 4 MiB, with a cursor for the next page. Configuration families, logging and analytics keep their own queries
Every dashboard query reads the session row, so a write to it reruns all of that session's live queries. Read access lasts five minutes after it was last extended, and each extension moves the session's idle end to 30 days later, never past 90 days after sign-in. A session refresh or a write extends it only once it has run down by at least a minute, and changed server lists and names are written at once, so routine saves and refreshes leave the session row and its queries alone
Queries and mutations need live read access. A session refresh, the save actions and dashboard:rotate accept a session whose read access ran out, because each checks the stored access token with Fluxer first, so a tab that returns after a break regains read access with that check. A sign-in that would give a user a sixth live session deletes the one used least recently. The retention chain deletes sessions past their idle end, which never lies past the absolute end. The web server refreshes the Fluxer access token itself and stores the new one with dashboard:rotate, which refuses a token of another user or application
Sign-in also stores member servers: Servers the user joined without managing them, where NeonFlux is installed and the role picker, showcases or profiles are on, or a private data role is named. The session answer lists the member features of each: rolepicker, showcase, profile and private. A session refresh recomputes them, and manager writes leave them unchanged. Member functions accept a managed or member server and recheck the installation and the switch or role on every request, while manager functions keep accepting managed servers only. See role picker and member access, showcases and profiles and private cases on the website
Web verification needs advanced verification enabled and DEFCON 3. It issues a link that is valid for ten minutes, with at most 500 new links per server per hour and a 60-second reissue cooldown. Starting a challenge requires a Turnstile token, which Convex checks through Siteverify for the expected action and an exact configured hostname. It fails closed when configuration or the provider is unavailable. The challenge is a motion CAPTCHA with a 90-second deadline and two attempts. A solved proof reserves the verification role, and its grant never outlives the proof. See the CAPTCHA notes
Setup and permission checks
The bot's !setup and !health and the dashboard's permission check read the same data through these functions, with a body limit of 4,096 for the reads and 262,144 for the answer
| Path | Body | Purpose |
|---|---|---|
/setup/status | { serverId } | Each feature's state, as the overview reports it, and the roles each feature assigns: autorole roles and reservations, reaction and verification panel roles, role picker roles, temporary roles, the newcomer checklist completion role and level rewards, every role each feature names, and the moderation staff roles of each staff area |
/setup/ready | { serverId } | { queued }, whether the website waits for a check |
/setup/record | { serverId, problems } | The bot's answer to a waiting check. Returns { recorded: false } when no check waits or it expired |
setupCheck:request is a dashboard mutation for a manager's session. It queues one check per server in dashboardSetupJobs, raises the work signal and gives the bot 60 seconds to answer, after which a scheduled function marks it failed. A request while a check waits, or within 10 seconds of the previous one, changes nothing, so the refresh button cannot keep the bot reading Fluxer. setupCheck:view returns the latest check. A problem is a missing set of permissions for a feature, roles a feature assigns that rank at or above the bot, or a gateway state other than connected, stored as permission keys, role IDs and names and the state. The safety audit adds dangerous-role with the role, its dangerous permission keys and its member count, absent for the everyone role, staff-permissions with the staff area, the role and the keys it lacks, and verification-bypass with the role features that are on. A check stores at most 50 problems. The bot reads Fluxer with its own token, so the check never uses the manager's sign-in
Recovery inbox
recovery.ts reads failed, stuck or uncertain work from the records features already keep, for the dashboard query recovery:inbox, which needs a manager's session, and for the bot's /recovery/list with { serverId, removalsBefore? } and a body limit of 4,096. With removalsBefore, either answers only the next page of stopped role removals, those created before it. It adds no table and no failure tracking. An entry is a work entry with its source, an optional time, a summary and the next step, a setup entry with a problem of the latest dashboardSetupJobs check, or a feature entry for a section in the setup state. Current state comes first, then the newest entries
| Source | Read |
|---|---|
| Posts of every feature | publishingAttempts.by_pending: Up to 50 uncertain attempts, newest first, kept while unresolved, and up to 10 failed attempts of the last seven days |
| Role changes | roleAttempts.by_server_pending: Up to 50 uncertain attempts without an observation |
| Role removals | roleWithdrawals.by_server_status: The 10 newest blocked removals by creation time, and nextRemovalsBefore with the creation time of the 10th when more exist, so pages reach the last one |
| Temporary roles | temporaryRoleGrants.by_server_due: Up to 50 grants, kept with a problem other than waiting |
| Tickets | tickets.by_number: The 50 newest tickets, kept when uncertain |
| Message cleanup | cleanupTargets.by_recovery_unresolved: Up to 10 failed or unconfirmed claimed deletions of the last seven days, and cleanupPolicies.by_blocked: Up to 10 enabled policies that stopped |
| Greetings | greetingDeliveries.by_server: The 50 newest deliveries, kept when uncertain or failed within seven days |
| Blocked deliveries | scheduleDeliveries.by_discovery: Up to 50 active deliveries, and milestoneDeliveries.by_route: The 25 newest of each kind, kept when blocked |
| Metadata logs | The failed and uncertain counters of metadataLogSettings |
| Help desk | helpDeskSettings.warnedAt within seven days |
| YouTube alerts | youtubeSubscriptions.by_server: The server's followed channels, at most 10, kept when NeonFlux turned them off or their source's latest hub request failed |
| Giveaways | giveaways.by_problem: The 10 newest with a problem, other than a post with an unknown outcome, which the posts of every feature cover |
| DEFCON and features | The moderation settings and the overview's section states. Custom commands and autoresponders are left out, since they start on |
| Permission check | The problems of the latest finished dashboardSetupJobs row |
Each source shows its newest 10 entries, and the inbox shows at most 100 with truncated set when there were more. The newest 10 stopped role removals are always among those 100, and the rest go on in pages of 10 from nextRemovalsBefore. A source whose index cannot select only its problem rows reads its 50 rows and filters them, so an older problem behind 50 healthy rows is not shown. Event reminders without a post, suggestion cards waiting for a channel, level rewards, moderation case and log recovery, backup restore items and dashboard jobs are left out
Private cases on the website
privateData.ts shows cases, appeals and member history to the server owner and to members holding the private data role. Administrator permission and staff roles grant nothing here. A session reaches a server it manages, or a member server while that server names a private data role, and the installation is rechecked on every request
Every view needs a live access check in dashboardPrivateAccessJobs, one row per viewer and server. privateData:view is a dashboard mutation for one view: The cases list, one case with a page of 25 of its corrections, oldest first, and its appeals, the appeals list, the open appeals, or a member's cases with their newest 25 appeals. Lists are newest first in pages of 25, and each page names the case or appeal number that the next older page starts before. A case's corrections continue after the creation time of the last one shown. The open appeals are oldest first, and each page names the appeal number that the next page starts after. While the viewer's passed check is younger than two minutes, the view returns its data and records a private-data-viewed entry in the audit log under the private-data feature: The viewer's ID and name, the kind of view and the member it concerns, never case or appeal text. Otherwise it answers checking and queues a check, raises the work signal and gives the bot 60 seconds to answer, after which a scheduled function marks the check failed. A refused or failed check stands for 10 seconds, during which views answer refused or failed without a new check. privateData:access is the viewer's live query of their latest check and whether a role is named. The row is deleted when its answer's two minutes end, at most three minutes after the request
The bot answers with its own Fluxer reads, never the viewer's sign-in. It reports whether the viewer owns the server, is a member and which roles they hold. The backend then passes the owner, passes a member holding the current private data role and refuses everyone else, so a role removal takes effect at the next check. A passed check also keeps owner, whether the bot found the viewer to own the server, which the server export needs. Erased cases and appeals keep only their erasure marker
| Path | Body | Purpose |
|---|---|---|
/private-data/ready | { serverId } | The viewers whose checks wait for the bot, at most 10 a call, with a body limit of 4,096 |
/private-data/record | { serverId, userId, originServerId, isOwner, present, roleIds } or { serverId, userId, failed: true } | The bot's answer to a waiting check, with a body limit of 65,536. Returns { recorded: false } when no check waits or it expired |
Server export
serverExport.ts builds the readable export that the export guide documents, format version 2. It reads in pages, one transaction each, and a page answers { section, cursor } with one of: One settings family as its dashboard view shows it, with at most 20 items of each paged list and every custom command and autoresponder, up to 100, in one list, up to 500 leveling profiles by member ID, up to 200 showcases by number, up to 500 member profiles by member ID, up to 100 cases by number, up to 500 case corrections by creation time, or up to 200 appeals by number. A family with longer lists continues on later pages that carry only the lists that continue. Settings come from the same views as the dashboard's configuration families plus the prefix, reply style and nickname, the analytics switch, role settings and panels and the channel log routes, without the live state those views also show. Cases and appeals that the owner erased answer null for their text, and erasing a case deletes its corrections. cursor is an opaque string, or null after the last page. The export creates no table and stores nothing but its audit entry
Only the server owner may export. The website's serverExport:start mutation runs the private cases check and answers ok only for a fresh passed check whose owner is true, refused for anyone else and otherwise checking or failed like a private view. It records a server-exported entry under the export feature, and with resume records that the export continued after a new check. serverExport:page is a query, so a page read never conflicts with the server's writes, and answers expired once the owner's check is older than two minutes. The bot's functions take the same fresh owner and one-to-one DM evidence as /backup, which the backend accepts for one minute
| Path | Body | Purpose |
|---|---|---|
/export/start | { serverId, context } | Record the export in the audit log and answer { version: 2 }, with a body limit of 4,096 |
/export/page | { serverId, context, cursor } | One page, starting with cursor: null, with a body limit of 8,192 |
Server structure editor
structure.ts serves the website's server structure editor, and structureDomain.ts holds its plain structure lists and the three-way merge. The diff that the merge starts from is in the structure contracts, so the website's live view of a draft shows the same changes. dashboardStructureJobs keeps one row per manager and server: The latest request and its state, the latest read for that manager, up to 10 channels' closed threads, whether a channel changed after the read, and the latest save with each change's outcome. A row is deleted a day after its last request and purged with the server
A structure lists categories and channels in sibling order: Top-level entries in order, each category followed by its channels, at most 500. A read adds up to 1,000 active threads and a closed thread page up to 100. A draft keeps every channel and its type and changes only names, parents and order. Its changes are a rename for each changed name and a move for each channel that changed category, plus, within each category, the fewest channels whose moves explain the new order. When several such sets are equally few, the one that leaves channels the manager cannot manage in place is used, so moving a channel past one the manager cannot manage counts as a move of the channel that can be managed. A move names its place by the category and the sibling right before it
The merge decides each change against the current structure: skip when it is already so, conflict when the name changed elsewhere or the channel was moved elsewhere, counted the same way, blocked when the channel or the category it moves into is gone, refused without Manage channels in the channel, and apply otherwise. An applied move goes right after the nearest earlier sibling in the draft that will share its category. The website's preview and a save run the same merge, the preview against the latest read
structure:viewreturns the manager's row.structure:requestqueues a read at most every 10 seconds, andstructure:threadsqueues one channel's closed threads. A row runs one request at a time, raises the work signal and gives the bot 60 seconds, after which a scheduled function recordsunansweredstructure:previewis a query that merges a draft with its starting structure and the latest readstructure:savequeues the draft with its starting structure, at most 100 changes. The bot claims it with a fresh read, and the claim merges and stores every decision, marking each change to write as uncertain until the bot reports it. Only a waiting save can be claimed, so a repeated claim gets nothing to write. The bot writes for at most 90 seconds, and a save it does not report within 30 seconds after that turnsuncertainas a whole. Each change reported applied or uncertain records an audit entry. A recorded save queues a new read- A channel event after a read marks every row of the server that holds a read as changed, and the next read clears the mark
| Path | Body | Purpose |
|---|---|---|
/structure/ready | { serverId } | Up to 10 waiting requests, fewer when the rows read pass 8 MiB, each with the manager, the request time and read, threads with its channel, or save, with a body limit of 4,096 |
/structure/answer | { serverId, userId, requestedAt, work, originServerId } with read or threads, or { serverId, userId, requestedAt, work, failure } with access or error | A read, a closed thread page or why the bot could not answer, with a body limit of 524,288. Returns { recorded: false } for a request that no longer waits |
/structure/claim | { serverId, userId, requestedAt, originServerId, current } | Claims a waiting save with the bot's fresh read and answers { claimed, applyUntil, apply }, the writes in order, with a body limit of 262,144 |
/structure/record | { serverId, userId, requestedAt, results } | The outcome of every claimed write, applied, failed or uncertain with an optional reason, with a body limit of 65,536 |
/structure/changed | { serverId } | Marks the server's reads out of date, with a body limit of 4,096. Rows are marked 8 MiB at a time, and the rest continue in a scheduled run |
Audit log and member data rights
Audit log
auditLogEntries keeps one row per recorded change: The server, a kind, the source (website or command), the actor's user ID, the signed-in name for website changes, the feature, the setting or operation, a summary of at most 500 characters, detail while the entry has stored values, and the creation and expiry times. The kinds are setting, member-data-deleted for a member's deletion of their own data, private-data-viewed for a website view of private cases and server-exported for the owner's server export
Setting changes are recorded where they are written, so chat commands and the website share one path:
- Configuration families: Every chat
managefunction and every dashboard configuration job applies its change throughchangeConfigurationin configurationChange.ts. It reads the family's dashboard view before and after the change, bumps the family revision and records the difference, so a new family or operation is recorded without code of its own. Of a list that has no bound on its count, the watchlist, drafts and templates, events, schedules and ticket categories, it reads only the entries the operation names, by their key, so a change anywhere in such a list reaches Details. Drafts and templates, and custom commands and autoresponders, are named by kind and name in Details, since one name may be both. Other lists are read whole, since none holds more than 1,000 entries - The prefix and reply style, the analytics switch, metadata log settings, and role settings and panels have their own write functions that chat and the website share:
writeGeneral,writeEnabled,applyMetadataConfigurationandchangeRoles. Each records its change - A confirmed backup restore records each imported item
- A member's
!mydatadeletion records the features and counts it removed, never the deleted content - Each website view of private cases records its viewer, its kind and the member it concerns, as private cases on the website describes
- Each server export records who started it, from where and whether it continued after a new access check, never its content
- Each change a structure editor save applied, or may have applied, records the channel names with the manager who saved it
A summary names each changed setting with values of up to 40 characters, such as enabled: off → on, and lists items added, removed or changed by name, up to eight changes. A longer value is named as changed. auditLogChanges keeps one row per setting entry with every changed leaf, its path and its before and after values, list entries keyed by the field that names them as in the summary, or by index. The values come only from the reads the change was compared with, which are the same dashboard views the log's readers see, without revisions, update times or document IDs, so no stored detail holds a session token, a YouTube hub secret or callback token, the backup key or a web secret. A restored item keeps the field changes of its restore check, and a restored channel keeps each changed permission overwrite of a role or member that still exists as permissions for <@&id> with the allowed and denied permissions by name, as the restore check shows them. A value over 8,000 UTF-16 code units, longer than any single Fluxer text field, keeps its first 8,000 and its full length in cut. A row holds at most 512 KiB of changes and 8,192 changed leaves, below Convex's 1 MiB document limit and within its 8,192 values per array, and counts the rest in more. Private data views, member data deletions and exports never get a detail, so no entry holds a case, an appeal or a member's deleted data. A redelivered command or an unchanged setting save that produces no effective field difference records nothing, while explicit actions such as resets, member list changes, private data views, member data deletions and exports still record. Commands carry only the actor's ID, so their entries have no name
These are not recorded: DEFCON changes that security detection makes on its own, which have no member actor and appear as cases, leveling XP corrections and resets, which keep their own correction audit, moderation actions and cases, and steps the bot takes on its own, such as role withdrawal pages and binding a panel the website just published
The dashboard's auditLog:page query rechecks the session and the installation, then reads 25 entries newest first, optionally for one feature, and returns a cursor for the next older page. auditLog:entry answers one entry's { changes, more } after the same checks, and null for an entry of another server or one without a detail. Entries and their details are kept for 180 days and pruned by the retention chain in batches of 256. The purge of a removed server deletes both with its other data
Member data rights
Every table that stores data about a member under their user ID has a by_member_data index that starts with that ID, so a member's data in every server is found without scanning a server. memberData.ts lists each table with its decision, and a test fails for any table with a top-level member, actor or staff ID field that is neither listed nor exempt. Deletion keeps data only where a stated rule needs it
| Table | Feature shown to the member | On deletion |
|---|---|---|
afkStatuses | AFK status | Deleted |
responseCooldowns | Custom command cooldowns | Deleted |
levelingProfiles | Leveling XP | Deleted. The profile leaves its level, block and score rank counts and the server's profile and reward counts |
levelingAwardReceipts | Leveling message receipts | Deleted |
levelingAudits | Leveling corrections | Deleted when they name the member |
greetingMembers | Greeting membership record | Deleted. A later departure still gets a goodbye, as for a member the bot had not recorded |
greetingDeliveries | Greetings | Deleted when settled. One still being sent stays until it finishes |
roleAcknowledgments | Rules acknowledgment | Deleted. The member acknowledges the rules again before gated features work for them |
rolePickerSnapshots | Role picker role check | Deleted |
milestoneEnrollments | Birthday and anniversary enrollment, with whether the profile shows the birthday | Deleted like a removal, which cancels an unclaimed delivery |
milestoneMembers | Birthday and anniversary command order | Deleted |
milestoneReceipts | Birthday and anniversary commands | Deleted. A receipt still counted toward the day's commands leaves that count |
ticketIntakes | Ticket drafts | Deleted |
eventRsvps | Event RSVPs | Deleted. A seat or waitlist place is released like a departed member's, so the waitlist moves up |
suggestionVotes | Suggestion votes | Deleted. The suggestion's counts change and its card is queued for an edit |
suggestions | Suggestions | A closed suggestion is forgotten with its votes, as staff forgetting does, and retention finishes a large one. An open suggestion stays until it is closed or withdrawn |
milestoneDeliveries | Birthday and anniversary posts | Kept. Each is tied to a message the bot sent and retires 30 days after posting |
milestoneConsumed | Celebrated years | Kept for 400 days, so a year is never celebrated twice |
tickets | Tickets | Kept as a support record shared with staff. Closed-ticket private content expires under the ticket retention, and staff can erase it |
moderationCases | Moderation cases | Kept for the period the server chose, or until erased, to protect the server. The owner can erase a case's text |
moderationCorrections | Case corrections | Kept with their case |
moderationAppeals | Appeals | Kept with their case |
voiceRooms | Temporary voice room | Kept while the room exists |
lfgGroups | Groups the member hosts | Kept while the group is open and deleted when it starts, is cancelled or closes. The host can cancel it |
lfgMembers | Groups the member joined | Deleted, which leaves the group. Its card shows the change at its next update |
reminders | Reminders | Deleted |
boardEntries | Board posts of the member's messages | The post is queued for removal, the record keeps only where it is and its text goes at once. A later reaction does not repost a message sent before the deletion. A post with an unknown outcome stays until staff settle it |
giveawayWinners | Giveaways the member won | Deleted, which removes only the member's ID and keeps the giveaway. The card already in the channel stays, as with other messages NeonFlux sent |
giveaways | Giveaways the member hosts | Kept while the giveaway runs. Once it finished, the host's ID and its tracked post, which names them, are removed, unless the post's outcome is still unknown |
roleOwnership | Roles NeonFlux gave the member | Kept while the member may hold the roles, because the bot removes only roles it can prove it gave |
temporaryRoleGrants | Temporary roles | Kept until the role's time ends, so NeonFlux can remove the role or give it back after a rejoin. Settled grants are deleted |
onboardingCompletions | Newcomer checklist completion | Deleted. The member can finish the checklist again and is counted again. A completion role already given stays with role ownership |
metadataLogRecords | Message and member logs | Deleted. The log post stays in the log channel, as with other messages NeonFlux sent. One whose post is being sent stays until it finishes |
metadataLogAuthors | Bulk deletion logs | The member is removed from the bulk deletion record, which keeps its other authors. The log post stays in the log channel. One whose post is being sent stays until it finishes |
showcases | Showcases | Deleted with their tracked post and its settled publishing attempts, which hold the showcase's text. The message stays in the channel, as with other messages NeonFlux sent, so members delete a showcase on the website to remove its message too. One being posted or whose post is unconfirmed stays until it settles |
profiles | Profile | Deleted. Profile saves still queued in that server are deleted too, even when no profile is stored yet, and are counted as Profile saves waiting for the bot |
These tables hold a member's ID but are left out, and the member is told about security records in general:
| Table | Reason |
|---|---|
automodWindows, securityRecoveries, verificationLinks | Security records with their own expiry. Showing them could defeat their purpose |
securityWatchlist | A security record staff keep until they remove it. Showing it could defeat its purpose |
roleAttempts, roleReferences | Part of the role ledger kept with role ownership |
ticketEntries, ticketTranscriptPages, ticketAttempts, ticketTranscripts | Part of a ticket, kept with it |
memberAccessLists, roleSettings, generalSettings, analyticsSettings, stickyMessages, sidebarLinks, helpDeskSettings, helpDeskAnswers, youtubeSubscriptions, twitchSubscriptions, milestoneRoutes, schedules, counters, boards, feedSubscriptions, antiNukeSettings, jailSettings, rightsSettings | Server settings staff chose that name members or who last changed them, kept until staff change them |
levelingSettings | Server leveling settings and internal reward sweep cursors cleared once a sweep finishes |
auditLogEntries | Server audit log entries kept for 180 days so staff can review settings changes and data actions |
dashboardSessions | A website sign-in, not server data, which ends at sign-out, after 30 days without use and at most 90 days after sign-in |
dashboardPrivateAccessJobs | A website check of the member's own access to private cases, deleted within three minutes |
dashboardConfigurationJobs, dashboardMessageJobs, dashboardRoleJobs, dashboardMetadataJobs | Short-lived website request records kept for a day. Pending profile saves are also removed on deletion |
metadataLogReceipts, cleanupReceipts, suggestionReceipts, scheduleReceipts, eventReceipts, levelingManagementReceipts, ticketReceipts | Short-lived command receipts that stop redelivered commands from running twice, expired after a day |
publishingAttempts | Server message delivery history kept for 180 days. Settled showcase attempts are removed with their showcase |
backupPlans, cleanupSweeps, dashboardStructureJobs, backupPreviewJobs, metadataLogCoreFences, lockdowns, lockdownSettings | Name the staff member who runs a server task, not data about them as a member |
cleanupPolicies, cleanupTargets | Message cleanup settings and tasks staff run. They name message authors only to skip their messages or to track a deletion. Settled tasks expire after 30 days, and a setting stays until staff change it |
alertSettings | Server security settings and the invite list staff last read from Fluxer, which names each invite's creator and is replaced at the next refresh |
memberDataDeletions | Only the server, the member and the time of their last deletion there, so a restore of a backup made before leaves their data out. A backup can be restored at any time, so it stays until the server's purge |
Records that name a member only as the sender of a command or inside their content are not indexed by member and keep their own retention: Other metadata log records expire after 30 days, audit log entries after 180 days, and command receipts and dashboard jobs on their own schedules. Staff actor fields, such as the actor of a case or a correction, stay with the server's records
The bot calls these functions for a member in a one-to-one conversation it verified, so the key vouches for the member's ID. They bind no server and work in both modes, because a member's data spans every server, including removed servers whose data waits for the purge. Each has a body limit of 4,096
| Path | Body | Purpose |
|---|---|---|
/service/member-data/list | { userId, serverId? } | Counts per server and feature, reading at most 51 rows per table, in one server when serverId is given. complete is false when a table held more, and servers past those rows can then be missing |
/service/member-data/servers | { userId, cursor } | The servers that hold the member's data, found with one index read per server and table and at most 200 reads per call, with a cursor of the table and the last server found while more remains. A later page can repeat a server. The bot's export of every server pages it up to 20 times |
/service/member-data/export | { userId, serverId, cursor } | Up to 100 records of one server in table order, with a cursor for the next page |
/service/member-data/delete | { userId, userName, serverId, cursor } | Deletes up to 100 rows of one server from at most 200 reads, reports what was deleted and what was kept with its reason, records the deletion in that server's audit log and returns a cursor while more remains |
An export or deletion cursor names a table and the creation time of the last row read, so paging relies on creation times being distinct within a table