projects/sdk/tests/live/README.md

Live sandbox checks

These opt-in checks run the built SDK against the hosted Fluxer service, using one designated test bot, application and sandbox server. They are excluded from pnpm check, CI, schedules and unattended runs. A passing run establishes only its checked scenarios, not complete replay, prolonged-outage recovery or production readiness

Setup

The Git-ignored projects/sdk/.env.test.local must provide FLUXER_TEST_GUILD_ID, FLUXER_TEST_APPLICATION_ID and FLUXER_TEST_BOT_TOKEN. The harnesses verify bot, application and server identity before live requests. Never print credentials or private payloads when diagnosing a failure

Run a package script from projects/ as pnpm --filter @neontechspace/fluxerly <script>. Most package scripts build the SDK first. Run a direct harness command from projects/sdk/ after building with pnpm --filter @neontechspace/fluxerly build

Some checks need a target ID or opt-in value from the process environment. Values marked process-only are never read from the env file. Where a harness also accepts the env file, the process environment takes precedence. A stored value is never authorization for a new run

Authorization

Each check below lists one of these levels, derived from its target and outside effects

LevelMeaning
SDK workAutomated runs may perform the check during authorized SDK work. It uses the designated sandbox and test-owned resources only
Per runEach invocation needs specific authorization for its target or effect, supplied through the listed environment values
Person presentA consenting person must act or stay available during the run, for example to approve consent, change status, type or rejoin

No level authorizes other servers or accounts, publication, schedules or unattended reruns

If a check fails

A failed check can leave a .env.test.*.local journal in projects/sdk/. Do not delete it. Rerun the same script. That run only cleans up and stops before the second API mode, with exit code 3. When cleanup is verified, run it again for a real test. A reported conflict needs manual inspection of the sandbox first

The sandbox lock prevents conflicting harness runs, not sessions started by other tools. After a crash, confirm that the process recorded in a .env.test.local.lock or .env.test.local.lock.<check> file has stopped before removing that stale file. Never bypass a live owner's lock or stop unrelated processes

OAuth checks keep tokens only in memory, and leaving a guild cannot be undone by a harness. Follow OAuth consent and leaving a guild for their manual recovery. The journal rules explain where each harness documents what its journal records and restores. Report the scenarios that ran and any mutation paths left untested

Running checks together

Each harness scenario declares a lock class in check classes, and a harness refuses to start without one

ClassMeaning
read-onlyNo writes to the sandbox
test-ownedCreates and changes only its own temporary resources, and reads nothing that other checks change
shared-stateChanges state other checks can observe, such as server settings or the bot's roles, or asserts over guild-wide state that other checks change

Read-only and test-owned checks share the sandbox lock, so several can run at once. Each one holds its own .env.test.local.lock.<check> file, which also keeps a second run of the same check, and its journal, out. A shared-state check holds .env.test.local.lock exclusively and starts only when no other check holds a lock. A refused check fails with sandbox_lock instead of waiting

The runner, pnpm --filter @neontechspace/fluxerly test:live:all <category or check>..., runs categories, named checks, the categories that changed files need, or for a release every SDK-work check below, including the SDK-work direct harness commands except gateway-capture.js --write, which rewrites a fixture. It compiles the SDK sources once into a private copy in its log directory and runs every harness from there. It never writes the repository's dist folder, so a run holds no build lock and a rebuild during the run cannot change code under a running check. Only the compile, a few seconds, reads the sources, and --build-lock <file> holds an flock on a coordinating file for just that long. Locks, journals and pacing stay in the SDK folder. It runs the shared-state checks one at a time first, then the others on two lanes unless --concurrency says otherwise. Every check shares the one pacer, so a second lane sends no more requests a minute. The first lane starts with the checks that mostly wait on Fluxer, such as recovery-window and the forced resumes, and the other lane's paced requests fill those waits. Before the run starts any check, it verifies bot, application and server identity once. Harnesses that need only the bot ID accept that verification for the same env file instead of repeating the three reads, and every harness started by hand still makes them. Name categories or checks to run only those, for example test:live:all reactions uploads. A name that is both a category and a check runs the category. Package scripts are named without their test:live: prefix, test:live is sandbox, and direct commands are named after their harness file and flag, such as bot-runner or recovery-window-session-restart. The runner refuses Per run and Person present checks, and passes no FLUXER_TEST_ process values, so checks read only the env file

OptionEffect
--changedRuns the categories the files changed since --base need, by default since HEAD left the pushed main, committed or not
--base <ref>The Git ref --changed compares with
--fullRuns every category that has not passed on the same inputs within 14 days, for a release only
--build-lock <file>Holds an flock on this file while compiling the private build copy, and only then
--concurrency <n>Lanes for shared-lock checks, 2 by default. The first lane takes the checks that mostly wait
--calibrated-paceUses the pace a recent calibration stored instead of 750 ms, and refuses to start without one from the last 14 days
--timeout-minutes <n>Stops a harness process after this time, 25 minutes by default, multiplied for checks that run together and never before the harness's own watchdog plus one minute. Its lock file stays behind as a stale lock, so the runner starts no further checks and records them as skipped
--out <directory>Log directory. By default a new fluxerly-live-<time> directory in the system temp folder
--listPrints the categories and every check, or with a selection the checks it would run, and sends nothing
--helpPrints the usage

Each check writes <check>.log and the run writes summary.txt with results, durations, request counts, hosted 429s and any remaining lock files or journals. timeline.jsonl records when the build and each harness command started and ended, and <check>.stages.jsonl the time of each stage line a harness printed, with only its mode, stage name and outcome. A check whose journal existed when the run started only cleans up, so the summary lists it as recovered rather than passed, and it needs another run to be tested. The exit code is nonzero when a check fails, is skipped or only recovered, the run was throttled, or a lock file or journal remains. Every check shares one request budget. Beyond the per-route limits, Fluxer has answered any route with a plain-text 429 and Retry-After: 5 after a burst of requests, and kept refusing for a while. Its threshold and window are not known, so the harness paces itself instead of relying on them. A calibration on November 3, 2026 met it at 140 read requests a minute after a clean 130. It likely counts all traffic from one address and may cover docs.fluxer.com and Fluxer's other hosts too, so a script that downloads Fluxer's docs spends the same allowance as the sandbox bot. Runs with a concurrency of 2 and 4 reached that limit within minutes before the shared pacer existed, when each check paced only itself. With the shared pacer, more lanes add no requests a minute, only contention for paced slots, so lanes beyond two gain little. When a check fails only when run together with others, declare it shared-state instead of weakening its assertions

Request pacing and the stop rule

Every live HTTP request passes through one shared pacer in support/live-pacing.js: The raw helper's setup, readback and cleanup requests, the SDK's own requests inside harness processes, discovery, asset reads and supervised children. Requests to local loopback servers are not paced

  • Request starts are spaced by at least 750 ms, at most 80 starts a minute, with no initial burst. Set FLUXERLY_LIVE_PACE_MS to change the interval

  • The pacing state lives in .env.test.pace.json in the SDK folder, so it carries across the default and Effect modes, across the checks the runner starts and into the next run. Its .env.test.pace.json.lock file is created like the sandbox lock and never removed for another process. If one stays behind, confirm the process it records has stopped before removing it

  • A hosted 429 pauses every sender for at least its Retry-After, or one minute when it gives none, and marks the run throttled. A sender already waiting for its slot checks again before it starts and waits out the new pause too, while a request already sent cannot be held back. The running check finishes, and its cleanup goes through the same pacer or stays in its journal. The runner then starts no further check, lists the rest as skipped and reports the run as throttled. Wait before the next run

  • A sender that would have to wait more than ten seconds for a pause stops with LiveThrottledError instead. The raw helper waits out a Retry-After of up to ten seconds, in seconds or as an HTTP date, and stops on a longer or missing one, never returning the 429 as an ordinary status

  • The 429s that harnesses inject themselves, such as in test:live:rate-limits, replace fetch above the pacer, so they neither pause senders nor throttle the run

  • Each check's requests are logged to <check>.requests.jsonl next to its log, and a single harness run logs to a fluxerly-live-requests folder in the system temp folder. A line holds the start time (at), when the sender was ready (readyAt), how long it waited for its slot (waitMs), how long the response headers took (ms), the process ID, the sender (raw or sdk), the method, the host and path with IDs and tokens replaced, the status and only the rate-limit headers. It never holds tokens, bodies or other headers

  • Harness watchdogs (process_timeout) are sized in support/watchdogs.js from the pacing: The harness's base time plus every request its scenario can start, as counted from its source, times the pace interval, with a quarter more as margin and room for one ten-second pause. When checks run together, the runner passes their number and each request may wait behind five reserved requests of every other check. Update a harness's count there when its requests change

  • Checks that time SDK requests, such as the typing refresh, bucket learning and rate-limit checks, observe fetch above the pacer, so they see when the SDK called and not when the pacer let the request go. Pacing only adds to the spacing they measure. Member request pacing applies to gateway requests, which the pacer does not see

Do not send manual requests with the sandbox bot's token, or run another live suite or bot on the same account or network, while a live run is in progress. They spend the same limit without passing through the pacer

Categories

During work, run only the categories that cover the change, never the full suite. Each category finishes in about three minutes or less at the safe pace, with both APIs. test:live:all -- --changed picks them from the files changed since HEAD left the pushed main, committed or not, and --list shows the pick without sending anything. SDK source files select their area's categories, a changed harness selects the categories that hold its checks, and a source file outside every area, the live support code, the runner, messages.js, command-conveniences.js or the SDK manifest selects smoke. Changes to documentation, the website, release tooling or offline tests run nothing live. smoke is the quick confidence check: Sending, receiving and replying, filtered event waits, discovery, the SDK's own rate-limit handling and a forced resume with its heartbeat. It does not cover the other resources, uploads, long recovery windows or most failure paths

A check that alone takes longer than a category may is split by API mode, as <check>@default and <check>@effect in two categories. Selecting both halves runs the whole check, its modes one after the other. recovery-window keeps all its state in its own process and sockets, so it declares a lock per mode and its two 165-second observation windows run at once

The times below replay the request logs of a full run at 80 requests a minute through the runner's two lanes, from first request to last exit, with the shared pacer. A run adds the compile of the private build copy, 11 to 16 seconds in the measured runs

CategoryChecksTimeRequests
smokerate-limits, messages, event-waits, instance, recovery2m02s104
messagesmessages, nonce, management, batch-delete, events, typing2m54s232
message-contentmessage-fields, embeds, optional-tools, search2m22s190
consumer-featuresconsumer-features0m50s64
historyhistory, pagination, pins2m40s212
cleanupcleanup@default1m40s133
cleanup-effectcleanup@effect1m40s133
own-historyown-history, text-validation1m39s130
reactionsreactions@default1m55s146
reactions-effectreactions@effect1m54s146
channelschannels, gateway-capture, guild-events, voice2m43s216
threadsthreads, voice-notes2m57s232
rolesguilds, administration, message-members2m48s222
server-settingsconsumer-operations, guild-features2m25s160
membersmember-search, member-chunks, guild-lifecycle1m37s98
webhookswebhooks, announcements2m16s182
uploadsattachments, attachment-sources2m22s188
cache-collectorscache, collectors2m27s194
commandscommand-arguments, command-help, command-groups, event-waits1m31s122
connectionsandbox, sdk, application, diagnostics, bot-runner, recovery-window-session-restart1m33s66
recoveryrecovery, recovery:cancel1m44s28
recovery-windowrecovery-window@default, recovery-window@effect2m52s16
shardingsharding, supervisor0m26s28
oauthoauth:no-consent, application0m22s30
rate-limitsrate-limits0m18s22
expressionsexpressions1m32s118
discovery-invitesdiscovery, invites, vanity1m17s102
typed-rawtyped-raw0m17s22

Release runs

Before a release, and only then, run the whole suite with pnpm --filter @neontechspace/fluxerly test:live:all -- --full. It runs only the categories that have not already passed on the same code, and prints for each category whether it runs and why, or which earlier pass it reuses. Every run that passes all of a category's checks records that pass in the ignored .env.test.passes.json in the SDK folder, with a hash of the category's inputs: All SDK source and compiler settings, because --changed picks likely categories rather than every category whose checks run a file, its harness files, the live support code and runner, the SDK package manifest, the lockfile and the Fluxer pin. Documentation and website files are never inputs. A pass counts only while that hash matches the current files, committed or not, and for at most 14 days, so changes on Fluxer's side are still caught. A failed, timed-out, recovered-only or skipped run of a category removes its pass, and a throttled run removes the pass of every category it touched. Outside a Git checkout nothing is reused or recorded. Add --fresh to run every category regardless of earlier passes. A release run that reuses nothing sends about 3,300 requests at 80 a minute, so it takes about 42 minutes, and two lanes keep the checks that wait from adding much to that. Only the recover scenario waits for a heartbeat acknowledgement after its forced resume, since the SDK sends the first heartbeat about 41 seconds after each Hello. The other resume scenarios prove the resume itself

Pace calibration

The 750 ms pace is measured safe: Runs of several thousand requests at that pace met no hosted 429. A faster pace needs a measurement, never a guess or a probe. node tests/live/calibrate-pace.js measures one, only with process-only FLUXERLY_LIVE_CALIBRATE=1 and only when a maintainer decides to. It holds the exclusive sandbox lock and sends only read-only requests, rotating over five reads the checks already make. It starts at 80 a minute and adds 10 a minute every two minutes, up to 160 a minute or process-only FLUXERLY_LIVE_CALIBRATE_CEILING, about 2,200 requests over 18 minutes when nothing refuses one. It stops at the first 429, front door or route, and that 429 pauses every sender and marks the run throttled as above. It stores 80% of the highest rate that finished without one in the ignored .env.test.pace-calibration.json. A run uses that pace only with --calibrated-pace, and the stored result counts for 14 days. Wait at least the Retry-After after a calibration that met a 429

Package scripts

ScriptPurposeOutside effectsAuthorization
test:liveHosted protocol discovery, readiness and heartbeatsNo server-content changesSDK work
test:live:allNamed categories or checks, --changed or --fullThose of the checks it runsSDK work
test:live:sdkBuilt default/native client connection, the READY self lookup, a raw bot-self REST read and shutdownNo server-content changesSDK work
test:live:applicationCurrent-bot application and installation linksRead-only. Requests the installation link once without following its redirect. No navigation, authorization, or server-content changesSDK work
test:live:oauth:default, test:live:oauth:effectManual authorization-code exchange, bearer reads, introspection, refresh and revocationInteractive identity, guild-list and connections consent, temporary tokens and an owned localhost callback listener. No bot installation or permission changesPerson present
test:live:oauth:no-consentOAuth URL construction and rejection without consentShared sandbox lock and read-only application, bot, guild, OAuth and connection checks. No browser navigation, consent, callback listener, token issuance, refresh or revocationSDK work
test:live:instanceInstance discovery and bot-self readRead-only unauthenticated bootstrap and bot-self REST requests. No server-content changesSDK work
test:live:diagnosticsDiagnostics and cache clearingRead-only with the shared sandbox lock, no gateway connection or remote mutationSDK work
test:live:rate-limitsGlobal and learned-bucket waiting and recovery, including raw REST requestsOne synthetic 429 and three scheduling-header overrides per API, with read-only bot-self and guild requests. No deliberate hosted throttling or remote mutationSDK work
test:live:consumer-operationsBanner URLs, attachment deletion, bot roles and countsTemporary channel/messages and one zero-permission role assigned only to the test bot, plus test-owned response loss and socket interruptionSDK work
test:live:member-chunksMember selection and streamed failure/recoveryRead-only guild/member requests, test-owned reply drops and one socket interruption per mode, no server-content changesSDK work
test:live:shardingTwo-shard routing, owning-shard counts, recovery and cancellationRead-only sandbox requests, one test-owned shard-socket interruption and one cancelled startup per mode, no content or account-presence changesSDK work
test:live:supervisorChild assignments, connections and shutdownRead-only sandbox API and gateway requests plus an owned loopback proof endpoint. No content or account-state changesSDK work
test:live:presenceInteractive presence and reconnect restorationNo account-state changes by the harness. The authorized participant performs visible status transitions and the harness interrupts only its own socketPerson present
test:live:messagesSDK receive/reply, and a text-to-speech send whose response value is checkedTemporary channel and messages, including one text-to-speech message in that channelSDK work
test:live:nonceNonce defaults, suppression and reconciliationJournaled temporary channel/messages and one test-owned response loss per API. Cleanup verifies channel deletionSDK work
test:live:optional-toolsBuilders and prefix-command lifecycleTemporary channel and test-bot command/reply messages. No human or member actionsSDK work
test:live:event-waitsFiltered event waits and failure cleanupOne journaled temporary channel and bot messages, with raw readback and verified channel removalSDK work
test:live:command-argumentsTyped commands and invalid-input recoveryOne journaled temporary channel and bot messages, with raw reply readback and verified channel removalSDK work
test:live:command-helpHelp pagination and deliveryOne journaled temporary channel and bot messages, with raw page readback and verified channel removalSDK work
test:live:command-groupsNested commands and scoped helpOne journaled temporary channel and bot messages/replies, with raw readback and verified channel removalSDK work
test:live:message-fieldsMessage projectionsOne journaled temporary channel, bot messages and a small attachment, with reply/edit/pin operations, raw readback and verified channel removalSDK work
test:live:consumer-featuresForwarding, embeds, file metadata, flags and profilesJournaled temporary channel/messages and uploads, test-owned response loss. Profile reads target only the designated bot and may trigger provider expired-premium cleanupSDK work
test:live:typingOne-shot typing, scoped refresh and completion/cancellation cleanup through both APIsTemporary channel/messages and ephemeral typing notices. Does not prove inbound typing deliverySDK work
test:live:typing:interactiveHuman-visible outgoing typing and selected-member inbound events through both APIsTemporary channel and typing notices, with awaited refresh shutdown and verified channel removalPerson present
test:live:roles:resetGuild-wide role-display reset and lost-response reconciliation through both APIsTwo temporary zero-permission roles and whole-guild display reset, with existing display assignments required to be nullPer run
test:live:recoveryForced socket loss, resume, diagnostics and subsequent receive/replyTemporary channel/messages and test-socket terminationSDK work
test:live:recovery:cancelManaged cancellation during recovery and socket cleanupTest-socket termination, no server-content changesSDK work
test:live:managementRemote fetch, edit and deletionTemporary channel/messages and test-message edits/deletionsSDK work
test:live:batch-deleteExplicit message batches, events/cache, missing IDs and lost-response reconciliationTemporary channel/messages and test-owned response lossSDK work
test:live:moderation:default, test:live:moderation:effectTimeout/clear, kick, ban expiry/unban, events and lost-response reconciliationAuthorized disposable member moderation, temporary channel/messages, test-owned response lossPerson present
test:live:webhooksWebhook management, delivery and credential revocationTemporary webhooks, channels/messages, file uploads and test-owned response lossSDK work
test:live:announcementsAnnouncement following, publishing, conversion and recoveryJournaled temporary channels, follower webhooks and messages, with test-owned response loss and verified removalSDK work
test:live:expressionsEmoji/sticker lifecycle, source-guild reads, gateway updates, partial batches and sticker messagesJournaled temporary expressions and a channel, with verified test-owned removal and no media purgingSDK work
test:live:invitesInvite lifecycle and recoveryTemporary channel and invites. No invite acceptance or membership changesSDK work
test:live:administrationServer settings and filtered audit logsTemporary sandbox server renaming, restoration, audit records and test-owned response lossSDK work
test:live:guild-featuresClone opt-ins and feature restorationTemporary sandbox cloning permissions and owner-crown visibility, audit records and verified restorationSDK work
test:live:vanityCustom-invite reads, read recovery and disabled-feature rejection through both APIsNo intended successful mutation, uses a reserved code for rejection checksSDK work
test:live:vanity:mutate:default, test:live:vanity:mutate:effectManual custom-invite lifecycle and lost-response reconciliationTemporary custom codes on an eligible sandbox with no existing codePer run
test:live:discoveryDirectory search, categories, eligibility/status and read recovery through both APIsRead-only, never submits an applicationSDK work
test:live:member-searchIndexed member search and permissionsResource reads and search requests, which can trigger provider lazy indexing. No member moderation or role/channel editsSDK work
test:live:message-membersA message dispatch refills the author's removed cached member without a member requestJournaled temporary channel and bot message, with verified removal. Drops only the bot's cached member. Holds the exclusive lock, since other checks' bot reactions or typing could refill itSDK work
test:live:gateway-captureCaptures the temporary channel's gateway dispatches and checks their scrubbing, without replacing the fixtureOne journaled temporary channel with bot messages, one reaction, one typing notice and a topic edit, with verified channel removalSDK work
test:live:membersAuthorized target-member nickname set, independent readback and restoration through both APIsTemporary nickname change for one currently authorized non-owner memberPer run
test:live:guild-lifecycleBot membership pages and bounded traversal through both APIsRead-only. Leaving requires the separate direct commandSDK work
test:live:discovery:mutate:default, test:live:discovery:mutate:effectManual directory application lifecycle and lost-response reconciliationReal review-queue submission or immediate public listing, then test-owned withdrawalPer run
test:live:users:default, test:live:users:effectPublic user reads, private conversations, bot server-profile edits and message failure reconciliationTest DMs, authorized group messages/renaming, bot profile changes and test-owned response lossPer run
test:live:eventsGateway delivery after raw API mutationsTemporary channel/messages and test-message edits/deletionsSDK work
test:live:reactionsReactions, collectors and recoveryTemporary channel/messages, reactions and guild emoji, plus test-socket terminationSDK work
test:live:pinsPin/unpin, explicit pages, pin status/events and recoveryTemporary channel/messages and pins, server-created pin notices, plus test-socket terminationSDK work
test:live:guildsGuild/member reads, role lifecycle, caches, cache-first permissions and recoveryTemporary channel/messages, two zero-permission test roles with assignment only to the designated bot, plus test-socket termination and test-owned response lossSDK work
test:live:guild-eventsGuild create delivery after READY, with the cached self member and role listRead-only gateway connection to the existing sandbox guild. Fails when it is unavailable or the bounded event wait expiresSDK work
test:live:voiceInitial voice snapshots and member mute/deaf flags through both built APIsRead-only sandbox gateway/member observations. No participant moderation, joining or mediaSDK work
test:live:voice-controls:default, test:live:voice-controls:effectManual selected-participant move/disconnect and mute/deafen controls, with snapshots, events and REST readbackTemporary voice channel and participant state changes, followed by participant rejoin, baseline restoration and verified channel removalPerson present
test:live:channelsChannel lifecycle, overwrites, audit logs, cache retention and recoveryTemporary channels/categories, overwrites targeting only the bot and test guild's everyone role, test-socket termination and test-owned response lossSDK work
test:live:threadsThreads, forum channels and webhook thread posts, with thread events and parent-deletion cache evictionThree journaled temporary channels including a forum, their threads and posts, and one forum webhook, with verified removal of the webhook, channels and threadsSDK work
test:live:voice-notesVoice notes in a channel, a forum post and a webhook, with voiceWaveform and Fluxer readbackTwo journaled temporary channels including a forum, three synthetic WAV voice notes, a forum post and a webhook, with verified removalSDK work
test:live:typed-rawclient.rest.call on a read with path parameters and a query, a message send, GET /gateway/bot, a send with a file and an edit that keeps it beside a new file, and the sent message as a documented raw MESSAGE_CREATEOne journaled temporary channel and one bot message in it, with verified channel removalSDK work
test:live:historyExplicit history pages checked against API readbackTemporary channel and messagesSDK work
test:live:cleanupGuild summaries, hierarchy and bounded message cleanupTemporary channel and test-bot messages, with one lost batch response. Uses the existing channel recovery journal and verifies test-owned cleanupSDK work
test:live:own-historyChannel and thread own-history deletion, thread-only scope and lost-response/cancellation reconciliationTwo journaled temporary channels, an active and an archived thread and bot messages, with verified removal. Guild-wide deletion requires the separate direct commandSDK work
test:live:searchBounded contextual indexed-message search, explicit indexing and cache exclusionTemporary channel/messages. May report a hosted indexing timeoutSDK work
test:live:paginationHistory/member/reactor/pin traversal and cleanupTemporary channel/messages, reactions and pins, plus test-owned transient read failure and delayed response deliverySDK work
test:live:cacheCache intake, expiry and recovery invalidationTemporary channel/messages and test-socket terminationSDK work
test:live:collectorsCollector completion, gap failure and use after recoveryTemporary channel/messages and test-socket terminationSDK work
test:live:embedsEmbed send/reply/edit, readback, events, cache and collectorsTemporary channel/messages and test-message editsSDK work
test:live:attachmentsUploads, binary readback, file edits, events/cache/collectors and recoveryTemporary channel/messages, 50 MiB file upload/download, file replacements and test-socket terminationSDK work
test:live:attachment-sourcesFile/stream uploads, URL refresh and bounded download recoveryTemporary channel/messages, one test-owned temporary file and delayed-EOF wrapper. The injected 403 targets only the current channel's unique attachment plan and does not change provider configurationSDK work

Direct harness commands

Run each command with default and then effect unless stated otherwise

CommandPurpose and outside effectsAuthorization
node tests/live/bot-runner.js defaultPublic bot runner against the sandbox. Checks synchronous misuse rejection, interrupts only its own gateway connection, cancels during recovery and fails a test-owned setup callback, then verifies client, socket and signal-listener cleanup. Read-onlySDK work
node tests/live/text-validation.js defaultLocal rejection, normalized UTF-16 boundary writes and reconciliation of an intentionally lost edit response without replay. One journaled zero-permission role per mode, with no human membership or existing role changedSDK work
node tests/live/recovery-window.js defaultGateway recovery window of at least 165 seconds per mode, interrupting only its own authenticated sockets, including one locally delayed Hello frame. No server mutationsSDK work
node tests/live/recovery-window.js default --session-restartSessionStore shutdown followed by a new client that must receive RESUMED rather than READY within the retention window. Uses only its own sockets and in-memory store, with verified sandbox identity and no server mutationsSDK work
node tests/live/sdk.js default --qualityLocal validation rejection and user/private-channel cache reads for an authorized member and group. No messages or remote state changesPer run
node tests/live/users.js default --latest-onlyLatest-private-message batch failure/recovery with marker-owned test DMs. No profile, presence or group changesPer run
node tests/live/messages.js default --attachments-smallThe test:live:attachments checks with a 1 MiB file instead of 50 MiB, a quicker way to troubleshoot them. Same outside effects otherwiseSDK work
node tests/live/calibrate-pace.jsMeasures a faster request pace with read-only requests and stores it, as pace calibration describes. Spends the address's request budget for up to 18 minutes and may meet a hosted 429. Runs once, without a modePer run
node tests/live/gateway-capture.js --writeReplaces the gateway capture fixture with a fresh scrubbed capture. Runs once, without a mode. Same outside effects as test:live:gateway-captureSDK work
node tests/live/own-history.js default --guildIrreversible deletion of every message the designated bot authored in the sandbox serverPer run
node tests/live/guild-lifecycle.js default --leaveThe bot leaves the server, with membership-list verification. Add --lose-response to discard the successful response and verify reconciliation without replayPerson present
node tests/live/voice-controls.js default --flags-onlyMute/deafen checks without moving or disconnecting the participant. Use --no-move instead to include disconnect and rejoin without creating a channelPerson present

Check requirements

Gateway captures

The gateway capture test replays scrubbed dispatches recorded from the hosted service and fails on a payload field the SDK neither exposes nor caches, unless its explicit ignore list names the field with a reason. Fields for which every replacement is rejected, such as empty lists and an ID that must match the actor, cannot be judged and sit in a separate reasoned list, so an unread field there goes unreported. Refresh the fixture after Fluxer changes a payload, or to cover another dispatch. Build the SDK, run node tests/live/gateway-capture.js --write from projects/sdk/, review the fixture diff and run pnpm exec vitest run tests/contract/gateway-captures.test.ts --maxWorkers=1. A new unread field needs either an SDK change or a reasoned ignore entry. Add a dispatch by extending triggerAndCollect in the harness

The harness writes its journal on every run, with or without --write, and writes the fixture only with it. It keeps only the bot's own dispatches in its temporary channel, and drops other members' messages, reactions and typing. Its scrubber replaces every string with a stable placeholder, passes numbers only under reviewed protocol field names, and refuses unreviewed field names and large numbers outside time fields. It refuses to continue when the result still holds the token, the server, bot or channel IDs, or an account or server name. It also refuses a captured string that survives: Strings of 8 or more characters anywhere inside other text, strings of 4 to 7 characters as a whole value only, and strings under 4 characters not at all. Digit-only strings under 8 digits are not checked either. A capture with a new field name stops until the name is reviewed and added to the scrubber. Raw payloads are never printed or stored

Presence and interactive typing

Presence checks require process-only FLUXER_TEST_PRESENCE_USER_ID, an authorized non-bot sandbox guild member. After a selected guild presence baseline, the harness reports bounded stages for that participant's visible DND and online transitions, including one test-owned socket interruption and resumed-session observation. The participant makes the status changes, and the harness sends an unacknowledged empty selection during cleanup. For the final invocation, process-only FLUXER_TEST_PRESENCE_RESTORE_STATUS can request a verified return to the participant's original online, idle, dnd or offline status. Here, offline means selecting Invisible while connected

Interactive typing requires process-only FLUXER_TEST_TYPING_USER_ID for an authorized non-bot sandbox member. The participant opens the reported temporary channel, observes the bot indicator and types without sending a message. Enter visible default or visible effect in the running terminal only after observing that mode's indicator, or stop to end the check. An authorized browser operator can enter browser default or browser effect after checking the rendered indicator, which records browser observation separately from human confirmation. Each mode waits up to three minutes for both that confirmation and the selected member's SDK typing event

Role display reset

Role display reset requires process-only FLUXER_TEST_ROLE_RESET_GUILD_ID matching the configured sandbox, and permission to reset guild-wide role display positions. The harness refuses existing non-null display assignments, then uses two journaled zero-permission roles for successful and lost-response resets through both APIs. No member assignments are changed

OAuth checks require FLUXER_TEST_CLIENT_SECRET and FLUXER_TEST_OAUTH_REDIRECT_URI=http://localhost:3000/auth/fluxer/callback in the ignored SDK env file. Register that exact redirect on the sandbox bot's application and leave localhost port 3000 free

Run one OAuth mode at a time, with fresh consent and the account owner's current permission for identity, guild-list and connections reads. The URL requests only identify guilds connections. It omits bot because Fluxer rejects adding the existing sandbox bot again. Keep the bot's membership and permissions unchanged. The no-consent check covers installation URL construction separately

Open the printed authorization URL and approve within five minutes, without sharing the callback URL or code. The harness keeps issued tokens only in memory and revokes known tokens before closing its callback listener and SDK lifetime

If the process crashes or reports uncertain issuance or unconfirmed revocation, the consenting user must revoke this sandbox application's authorization in Fluxer settings. Open personal settings, then Account → Security → Account access → Authorized apps → Manage, and revoke only the sandbox app. Tokens cannot be recovered from a journal, and successful token revocation does not remove the provider's saved consent record

Whole-history deletion

Whole-own-history guild checks require current authorization to erase all messages authored by the designated bot in the sandbox server. This deletion is irreversible and cannot be limited to messages created by the test. Supply process-only FLUXER_TEST_DELETE_MINE_GUILD_ID matching the configured sandbox, never another server

The harness verifies identity and membership and journals its test-owned channels and its two threads, one of them archived before the deletion. An existing journal triggers recovery only, without repeating whole-history deletion. Cleanup removes only the journaled threads and channels, checks that no journaled thread remains active or archived, and cannot restore deleted history. Other-author readback covers only a reported sample, not a complete inventory

Voice controls

Voice-control checks require process-only FLUXER_TEST_VOICE_USER_ID for a currently consenting sandbox member connected to one voice session. The bot needs ManageChannels, Connect, MoveMembers, MuteMembers and DeafenMembers, plus a successful hierarchy check for that participant

Run each mode separately. Keep the participant available to rejoin the original channel within 90 seconds after disconnection. The harness cannot make a disconnected participant join, and the bot never joins or handles media. Recovery uses fresh gateway and REST observations and refuses unexpected state

Custom invites and public discovery

Custom-invite mutation checks need a specifically authorized disposable server with VANITY_URL, ManageGuild permission and no existing custom code. Supply two distinct, available lowercase codes through FLUXER_TEST_VANITY_CODE and FLUXER_TEST_VANITY_SECOND_CODE, plus FLUXER_TEST_VANITY_MUTATIONS=1. Run each mutation mode separately. Successful invite inspection also needs a channel visible to everyone

Changing an existing code cannot guarantee reclaiming it, so the harness refuses that scenario. Read and rejection checks do not establish successful setting, replacement, removal or lost-response recovery

Discovery mutation checks require specific permission for real directory submission and possible immediate public listing. Use an eligible disposable sandbox with no existing application or listing, and set FLUXER_TEST_DISCOVERY_MUTATIONS=1 for that invocation. Optionally select FLUXER_TEST_DISCOVERY_CATEGORY_ID. The default is the provider's Other category. Run the default and Effect mutation scripts separately. Partial provider writes can require manual reconciliation. Search-index removal and reviewer notifications are not reversible. Read-only script success is not live application-lifecycle proof

Private conversations

User and private-conversation checks require current authorization for the recipient supplied through FLUXER_TEST_DM_USER_ID. The harness verifies the recipient's membership in the designated sandbox, preserves pre-existing open DMs and removes test-owned messages

Existing-group checks also require current permission to rename and send messages in the channel supplied through FLUXER_TEST_GROUP_DM_ID. Use a named temporary group owned by the authorized recipient, containing only that account and the sandbox bot. An explicitly authorized additional account can be supplied through FLUXER_TEST_GROUP_EXTRA_USER_ID. The harness preserves membership, restores the original group name and deletes only test-owned messages. Without a selected group, or with --without-group, the script reports group checks as skipped. That run is not group verification

The --latest-only mode uses the same recipient without group or profile changes, and restores whether the bot had the conversation open. The --quality mode of sdk.js reads the recipient and an existing group owned by that member, without sending messages

Member changes, moderation and leaving a guild

Nickname checks require the currently authorized non-bot, non-owner target in process-only FLUXER_TEST_MEMBER_ID. The harness rereads the nickname immediately before writing, deliberately loses one response after the marker write and verifies that the SDK reports an unknown outcome and evicts its member cache. It then reconciles raw state before restoration

Each moderation invocation requires current authorization for its disposable account and a person available to handle rejoining. Supply the account ID through process-only FLUXER_TEST_MODERATION_USER_ID. A missing or invalid ID fails before live requests. The account must be a current non-owner, non-administrator member without an existing timeout or ban. Run each moderation mode separately and re-add the account between runs. The checks never delete its messages and leave it unbanned, but cannot restore its membership or previous roles

Before each leave invocation, coordinate with the person who can re-add the bot, and supply the currently authorized FLUXER_TEST_LEAVE_GUILD_ID in the process environment. It must name the sandbox server, and any other ID fails before live requests. The harness preserves authored messages and checks independent membership-list removal, but cannot re-add the bot or prove continued access to its former messages. It creates no remote resources and no journal. If interrupted after dispatch, inspect bot membership and re-add the bot before further checks in that server

Coverage limits

Member-chunk checks require a sandbox with fewer than 1,000 members and compare the response with one fresh REST member page. The harness can wait once for a confirmed full-list rate limit left by a prior mode, then make a new request. It reports whether the hosted gateway actually rejects an immediate repeat. Acceptance does not verify live rate-limit handling. Multi-batch arrival, missing-batch and slow-reader behavior use local transport tests rather than a large live guild

Journals and restoration

Each journal is an ignored .env.test.<name>.local file in projects/sdk/ and never records credentials. The header comment of the owning harness states what its journal records and how an existing journal is recovered. Most journal names match their harness file. The exceptions are guild-features (guild-feature-toggles.js), typing (typing-interactive.js), role-reset (role-display-reset.js) and vanity (vanity-url.js). Scenarios of messages.js and command-conveniences.js keep separate journals, such as messages-reactions and command-conveniences-waits, so rerunning the failed script finds its own journal

Harness rules

These rules apply when writing or changing a harness. Harness source owns detailed assertions and bounded execution

  • Verify bot, application and server identity, and take the sandbox lock, before live requests. A harness that needs only the bot ID may use sandboxBotId, which accepts the runner's verification of the same env file
  • Declare every new harness or scenario in check classes. Choose shared-state when unsure
  • Use the shared harness support for the lock, env loading, process-only values, journals, identity checks, owned finalization, JSON-lines reports, result unwrapping and direct sandbox requests instead of copying them
  • Describe a new journal in the harness header comment: What it records and how recovery restores or removes it
  • Let the process environment supply or override target IDs for other people's accounts, whole-guild effects and irreversible actions. Never hardcode a real account ID or treat a stored value as authorization
  • Record test-owned markers before dispatch and returned IDs when available. Verify restoration or removal before deleting the journal
  • Journal writes and remote operations are not atomic. Reconcile lost responses through recorded identity rather than blindly retrying writes
  • Fail closed on corrupt, conflicting or unresolved state, and keep the journal for inspection
  • When a journal exists, perform recovery only. A fresh test requires a separate invocation after verified cleanup
  • Never store credentials, tokens, invite or custom codes, or message bodies in journals or output
  • Reread state immediately before a restoring write. Fluxer's PATCH has no conditional precondition, so conflict checks cannot make the read-and-write sequence atomic
  • Always include a user or action filter in audit queries. Fluxer may rewrite deletion records during an unfiltered read