Skip to content

test(bot): address the full mutation report rotation - #458

Draft
astrovm wants to merge 410 commits into
mainfrom
t3/add-amount-formatting-tests
Draft

astrovm wants to merge 410 commits into
mainfrom
t3/add-amount-formatting-tests

Conversation

@astrovm

@astrovm astrovm commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Part of #451

Scope

This PR covers three things.

  1. Tests, behavior-keeping rewrites, bug fixes and exclusions for the rotation findings listed under Changes and Bugs fixed. The rotation reports are runs 44907620979 (parts 0–15, with a local replay of part 4), 46151449675 (16–31), 42401295903 (32–47) and 43592139328 (48–63). Together they list 11,354 findings in 128 files.
  2. Every mutant on a line that this PR changes, as the Mutants / Changed code job reports it on the final commit. Each one is killed by a test, or it is listed below with a reason.
  3. The two Stryker ignorers (log text and debug trace) and the workflow paths that run the changed-code job when an ignorer changes.

It does not close Issue #451. The findings that remain open are under Left for follow-up PRs.

Left for follow-up PRs

The per-file ledger on checkpoint 5d5fd87 has 9,810 open rows. "Not yet measured" rows were never scored after their part ran. "Source changed" rows are in code that changed after the row was scored, so the row must be scored again. The same list is in a comment on Issue #451.

File Open rows Survived No coverage Not yet measured Source changed, recheck
src/utils/game.ts 1,625 1,503 58 0 64
src/bot.ts 1,275 1,214 45 0 16
src/utils/wallet.ts 639 0 0 567 72
src/handlers/game-callbacks.ts 587 372 157 0 58
src/utils/game-database.ts 319 287 15 0 17
src/evm/bot.ts 311 0 0 304 7
src/handlers/chat-defaults.ts 297 275 4 0 18
src/utils/swap-manager.ts 272 5 0 260 7
src/handlers/wallet-transactions.ts 242 225 9 0 8
src/utils/token-manager.ts 226 0 0 191 35
src/services/positions.ts 205 3 0 184 18
src/handlers/lightning.ts 196 0 0 185 11
src/utils/jupiter.ts 185 0 0 151 34
src/handlers/faucet.ts 140 0 0 139 1
src/services/buy-alerts/pool-trades.ts 138 15 1 95 27
113 other files 3,153 637 32 1,508 976
All 128 files 9,810 4,536 321 3,584 1,369

Each follow-up PR takes one file or a group of small files, runs Stryker on it, and kills or documents each row. The ledger and the scripts are in /mnt/data/agent-cache/bot-mutants/rotation/ on mr.

Also left: a known race on main. A cancel_game_setup_ callback that runs while the compact players prompt is being edited clears the setup, and storeSetupPromptSession then writes it again. A fix needs a check that the setup still exists after the edit.

Changes

  1. Check amount, token, percent, rate, and duration strings: signed zero, signed large strings, bigints, and carry-boundary rounding. Compare 3,328 old formatter cases with main.
  2. Bound compact suffix scaling and map concurrency so a removed loop body cannot hang tests. Check trade amount validation, fee reserves, safe integer boundaries, and fallback amount display.
  3. Check missing-account errors, player limits, challenge deduplication, coinflip arguments, callback routing, and error replies.
  4. Check fee budget refresh and keys, distinct default formulas, confirmed fee estimates, priority percentile, cached buffer values, contract version selection, and default finance backfill intervals. Contract capital requires expected addresses and confirmed commitment.
  5. Check immediate and timer-driven cache expiry, timer cancellation, and expiry after clock rollback. Cancel each cache timer once and never pass a missing handle to the clock.
  6. Check Telegram buy-alert link, provider payloads, watched mint orientation, venue labels, spend and price fields, preview media, rate windows, duplicates, 400-signature production cap, preview pool labels, sample link, and failed alert logs.
  7. Check both Lightning fee limits, retry-safe failures, provider credentials and responses, private deposit journals, successful SOL payouts, invoice expiration, payment instructions, totals, and navigation without provider calls.
  8. Check Telegram callback payload size, decimal precision, UTF-8 creator IDs, malformed fields, active callback patterns, and retired setup buttons. Match exact arguments and reject prefixed or malformed data.
  9. Check SQLite statements, binding defaults, per-query error context, and table resets without touching internal statistics. SQLite keeps its no-binding default. Test token program storage, schema changes, and real database failures.
  10. Check position balances, tracked quantities, pagination, extreme number formats, first hold mark, invalid stored prices, and partial scans that confirm a token left.
  11. Check both finalized RPC proofs, checkpoint restart limits, transaction rebroadcast timing, and zero-height boundary. Keep slot zero valid when rejecting finalized slots and in admin status command.
  12. Check callback grace timing, missing identities, notification targets, error logs, callback queue limit, and recovery after a queue clears in flight. Fake timers drive callback and provider deadlines.
  13. Check legacy chat alert migration, zero and null settings, faucet claim states, and retry deadlines.
  14. Check alert backoff and mint removal during a request. Keep initial pool cycle size and poll the live queue.
  15. Check wallet positions refresh routes and game setup defaults for incomplete Telegram updates.
  16. Check finance ledger cursor, delay, timestamp, and transaction RPC settings, report window, grouped fees, claims, checkpoint order, error length, and retry progress. Keep pending transactions and clean finalized records after 90 days.
  17. Check game participant slot updates, timestamps, error formatting boundaries, caps, expiry scans, missing RPC status records, keypair error causes, and price cache lookup by normalized mint.
  18. Check wallet cache invalidation under overlapping RPC calls, cache deadlines, snapshot age limit, and callback pagination.
  19. Check provider retry deadlines, RPC priority lane, confirmed transaction fees, endpoint failover, listener ownership, and Telegram update freshness.
  20. Check quote cache scope and expiry, SOL fee rounding, token graphemes and owner detection, and verified token refresh timing. Quote cache gets its configured fallback from shared expiry cache.
  21. Test account derivation seeds, event payload decoding, command input, and outbound diagnostic classifications.
  22. Check 24-hour faucet lifetime, claim release after five minutes, all four notification delays, and progress ratio. Bound retry fixtures so decrementing mutant cannot hang runner.
  23. Check game wrap backoff and expiry scanner inputs. The scanner checks finite time directly and assigns its page before use. In account adapter and active game list batches, explicit null still proves absence.
  24. Check each stored game button wire format against main, including player-count rounding boundary.
  25. Check 30-minute database membership freshness and 24-hour cleanup deadlines. Bound test pagination. Keep fee rounding and strategy defaults unchanged.
  26. Check five-minute production token metadata cache and one-minute private-key confirmation boundary. Metadata and callback data share Solana mint precision limit.
  27. Check prompt and pending-transaction expiry and empty and absent owners of legacy text and media prompts. The owner keeps the prompt after another member is refused.
  28. Bounded fake timers drive RPC wait, abort, and cooldown tests. Check RPC cancellation at timer end, listener cleanup, 10-millisecond wait minimum, and cooldown priority.
  29. Iterate over existing endpoint and referral transaction entries, and bound listener and history fixtures, so decrementing or backwards mutations cannot hang.
  30. Check whole-number player counts, timeouts, and notification rates. Reject broken compact amounts without editing or moving setup.
  31. Validate EVM game button length and canonical encoding. Check all-zero ID, 192 generated 32-byte IDs, and malformed input on both sides of rewrite.
  32. Swap account polling tests advance elapsed time and keep confirmed commitment. Check remaining delay after an RPC error.
  33. Check public game cache expiry, sponsor setup, quote calls, and base-fee fallback.
  34. Check position precision limits, zero-decimal balances, non-finite SOL costs, and 20-second production snapshot price boundary.
  35. Check chat defaults at player-count, timeout, and join-notice limits. Partial reset commands and settings callbacks do not overwrite settings. One safe decimal integer parser serves group settings and custom player counts on both chains.
  36. Bound token metadata eviction and game setup recovery. Pin 200-entry cache, 25-record database query, and four concurrent recoveries. Check nested diagnostic detection through depth five.
  37. Check same-signature and stale-signature replacement, lease and game deadlines, full transaction evidence, 500-character stored diagnostic, and explicit zero timestamp.
  38. Check finite signed percentages above JavaScript number range with exponent and sign, compact exponent mantissa digits for large signed amounts, and raw formatter signed sub-unit carry and unusual scales.
  39. Check exact, estimated, and missing swap sponsor costs across migration and reopen, zero fees, transaction order, and duplicate signatures.
  40. Check last-player confirmation after game account closes, ticket count sources, answer before card redraw, and batch diagnostics. Keep cards with unknown expiry timing visible.
  41. Amount markers and currency arguments share one USD parser. Check 18-digit following-argument boundary, exact base units, currency hints, failures, leaderboard ties, hidden players, and currency display at one and one thousand dollars.
  42. Check three-second default Jupiter price deadline, fallback requests, and groups of 50 IDs. Show no USD average or unrealized gain when a SOL cost lacks its USD quote. Keep mark and original amounts spent.
  43. Check default Oracle loader, five-second Oracle policy cache, and legacy-only game fee withdrawals.
  44. Bound wallet cache eviction and token batch loops. Check 100 accounts per RPC request, eight concurrent metadata reads, and 64-mint prefetch cap.
  45. Telegram menus pick the right edit type, chat, message, and topic for captions, text, and standalone cards. A superseded media edit finishes while the first is in progress and never reaches Telegram.
  46. Check media retry limits, both retry deadlines, normal retry delays, and pending-edit replacement. Remove unused queue flag. Bound deferred media test settlement. A failed edit leaves queue usable.
  47. Check configured token mints, their decimals, both lookup directions, and lookup aliases versus game allowlist.
  48. Bound both username cache eviction loops and game-card participant preview loop. Check 500 cached users, card layout, 100 and 101 player name lookup limit, 250 wallet preview, and both sides of 4,096-character card limit.
  49. Bound wrapped SOL balance checks by existing retry intervals. Check immediate success and full sequence: six WSOL retry delays, recorded attempt numbers, and seven balance reads, ignoring unrelated fee warmup timers.
  50. Keep diagnostic parser's type and depth checks independent. Check ordinary structured text and depth boundary. Simplify equivalent stack, source location, and JSON checks.
  51. Keep records at thirty-day cleanup boundary. Check game message retry age, expiration page limits, logged cleanup counts, and silence after no-op.
  52. Check first and fifth player database lookups, four 40 ms production lookup delays, and five-read limit. Bound missing-participant fixtures.
  53. Check operator recovery with active or expired lease, missing evidence, invalid audit input, stored reason, and operator limits. Cap recovery error without releasing its lease. Delete only matching terminal row.
  54. Check mixed program logs, cyclic error cause, each definitive rejection, nested causes, cyclic diagnostics, and 1s display boundary. Telegram status codes 400 and 403 stop notification retries after successful payment.
  55. Check one-minute fee-price age limit, twenty-percent drift limit, and boundary between seconds and milliseconds. Reject unusable SOL quotes and check timestamp precedence before swaps.
  56. Check Jupiter ledger entries for earned and claimed fees, timestamps, payer, and zero changes. Record only outgoing referral claims. Keep zero or missing block times correct.
  57. Simplify default token override checks. Keep explicit empty values distinct from absent environment values.
  58. Make two timed-out CI fixtures deterministic. Keep separate end-to-end key derivation test. Give game display-name cases, middleware diagnostic cases, and three invalid withdrawal fixtures stable mutation-runner names.
  59. Bound wallet confirmation tests with fake clock. Check history cutoff, network retries, final read, and two-block grace window. Keep existing retry delays and budgets. Keep original error and signature, and test no-resend case, when no resubmission is allowed.
  60. Check wallet refresh age, exact raw token balances, pinned amounts, and page changes without editing another message. Report only unexpected refresh failures. Check wallet identity errors and last safe identity.
  61. Private wallet export confirmations are one-time, tied to requesting user, and limited to one hour.
  62. Bound confirmed game account reads. Keep first immediate read, all six production delays, and last provider error.
  63. Bound private game joins to original two attempts. Keep account reload, membership checks, error mapping, reachable original failure path, and last provider error.
  64. Allow one completion redraw per game update. Keep completion that arrives during formatting, before chat edit, or after payload preparation. Split long game-card cooldown into supported timer lengths and keep newest displayed pot.
  65. Check recoverable menu edit errors, inactive one-hour control, keyboard navigation rows, network-specific wallet actions, and safe wallet menu and prompt errors. Open no input session after failed prompt.
  66. Check referral balances from read-only address table, exact above safe number limit, including one-unit difference and missing balances. Reject earnings from failed transactions. Check Token-2022 fee accounts without reading account twice.
  67. Check 5,000-message activity capacity and least-recently-touched eviction.
  68. Check SOL reserve and default one lamport below, at, and above limit. Test whole-lamport fee budget in normal and zero-fee cases. Disabling swaps skips balance and price requests but still claims referral fees.
  69. Keep withdrawals on token network, or chat preference when both support it. Check private EVM withdrawal expiry. Allow game request while another wallet is busy.
  70. Check RPC pacing clock on every loop pass. Track provider completion and deadline directly. Keep early aborts and original provider error. Start no read at deadline, even after fallback verification.
  71. Use existing 5-second RPC fallback directly for unrepresentable upstream cooldown or no retry hint. Keep RPC date fallback. Assert retry time, message, and error type after shared-host cooldown.
  72. Share Telegram retry parsing, checked error text format, and maximum native timer delay. Read fallback retry delay only from message with digits. Malformed errors do not become rate limits. One finite-number check covers typed retry hint.
  73. Parse each Telegram age override once. Keep old non-callback messages silent and default cutoffs. Keep valid per-chat cooldowns on malformed hint. Cap timers passed by throttling helper.
  74. Keep usual test deadline when a game retry timer never calls back. Bound test timers for retry delays. Check full production schedule. Use public GameManager test reset.
  75. Independently check game recovery checkpoints and counts, slot boundaries, next retry time, invalid saved proof count, witness contexts, and malformed provider slot lists and results.
  76. Check each recovery witness separately. Do not replace transaction when its status, parent slot, or block anchor cannot prove absence.
  77. Check remaining wallet rate limit time, adjacent large keys, and rounded error delay.
  78. Distinguish whole amounts and trailing-digit tickers in game commands. Keep malformed two-argument amounts in direct command validation. Check absent amount arguments and numeric text after stake.
  79. Simplify token display segmentation. Check combining marks and flag boundaries. Keep stable display label when token disappears during name resolution.
  80. Check Telegram display name defaults. One invisible separator covers each at-sign run when mentions are off. Remove redundant display name checks. Keep mention separators, handle order, and fallback text. Name table tests stably.
  81. Cover display name trimming and blank or missing values. Bound both UTF-16 mention scans. Keep emoji names, adjacent handles, and malformed offsets unchanged.
  82. Check timestamped console calls for all six levels, with one timestamp after repeated installation. Check protected secret source precedence, fallback, and original symlink error cause. Type each loader for only environment keys it reads.
  83. Check custom swap prompt's selected input, reply action, examples, and timeout hint in separate sections. Exclude only cosmetic examples heading from string mutation. Keep tested reply instructions, example values, and paragraph boundaries.
  84. Keep original malformed-owner error in wallet metadata integration test. Expire absent mint at the same 20-second wallet cache boundary. Keep successful lookups cached. Check local mint metadata cache at its expiry.
  85. Check both refund layouts, completion winner, missing logs, malformed data, and decoder fallbacks. Keep decoder fallback reachable when program data has no event. Exclude only the default array mutation that injects a non-log string the parser drops.
  86. Select sponsor only when both keys are set and sender is below configured buffer. Check one-lamport boundary, zero-rent and padded sponsor limits, and their diagnostics. Correct documented fee defaults.
  87. Use standard UTF-8 snapshot read and write defaults. Check default paths, Unicode, invalid snapshots, HTTP status, and deadline cancellation. Use typed non-null preloaded mint result. Remove unreachable missing-mint branch from metadata flow.
  88. Share timed state reads and writes without sharing entries between state and pending transactions. Check expiry, default consumption, and namespace isolation.
  89. Check protected-file reads one byte at a time at small and maximum sizes, one EOF probe, and missing configuration.
  90. Resolve verified token snapshot directory before joining filename. Check unset, blank, relative, and configured paths. Reject invalid verified-token response as one snapshot, keeping previous list. Test distinct configured directory.
  91. Validate swap fee prices in one place. Check surcharge breakdown and highest same-key fee. Keep provider errors in fallback log. Count unique earned swaps. Keep actual sponsor expenses unmarked.
  92. Keep primary ticker, display data, and aggregate totals in recent game rows. Check history defaults for missing and invalid data, optional amounts, page offsets, and status text. Keep zero-decimal amounts and real ticket count when capacity is unknown.
  93. Each notification reaches chat once, live message first and persisted message before legacy fallback. Check notice and diagnostics when lookup fails.
  94. Check EVM confirmation and expiry limits, uncached receipt reads, durable authorization, allowance accounts, invitation arguments, withdrawal fields and calldata, and direct close completion.
  95. Use Viem's default ordered fallback. Check both RPC attempts without background probes. Serialize missing oracle input as no body. Keep null, false, and bigint JSON.
  96. Check two-second active and unindexed game polls, one-hour terminal poll, and thirty-second retry after failed card edit. Check timeout buttons at six game durations, both caps, and a tie that snaps to the longer one.
  97. Check on-chain mint precision from zero to 255. Read raw mint once for partial or invalid parsed responses. Fix a test that changed the old fake after wallet copied it.
  98. Bound permanent RPC error fixture. A wrong second poll returns a status and fails without waiting out the polling window.
  99. Check case-sensitive configured and chat token mints under both contract policies. Exclude only controls on duplicate chat-mint branch. Both paths share one static mint set. Keep database lookup and both return expressions.
  100. Three RPC batches passed 52, 58, and 33 tests per contract, and eight redaction cases passed on main. On cd0a207, 25 history tests passed per contract.
  101. On 2eb0d92, 110 tests passed per contract, ten cases passed on main, and two malformed RPC cases failed before fix. On d4c55df, 58 tests passed per contract. The exact HTTP fee, two bigint bounds, and swap ledger failed before fix. No live request was sent.
  102. Match only ASCII SOL ticker for native SOL. Keep mixed case, spaces, wrapped SOL, and non-ASCII alias behavior.
  103. Check the whole wallet path after a final RPC timeout leaves the original signature unresolved, also when the provider timeout object cannot be printed.
  104. Keep funded balances and metadata read order across short, extra, and wrong-owner token account rows. Read either RPC token balance side. Keep large claimable values exact.
  105. Check Metaplex account address and padded text, and use decoded text directly. Distinguish missing metadata from decode or hook error. Keep blank and invalid-data fallbacks.
  106. Check RPC code prefixes, redacted fallback logs, and listener failures without logger. Detect non-slash endpoint paths directly. Keep query and encoded slash redaction.
  107. Accept both completion event names and ignore unrelated events. Do not announce blank, cancelled, or empty-address winners. Check prize precedence, including zero and giveaways.
  108. Use game queue only for join and refresh callbacks. Reuse game manager until dependency changes. Store fallback card and recover it after account returns. Fix reversed ticker and status test inputs.
  109. Check SOL price aliases, exact referral fees, and zero mint precision.
  110. Check orphan cleanup at oracle buffer and ticket limits, orphaned giveaways at expiry, below player minimum, and on both sides of oracle deadline, and one-player giveaway and two-player coinflip minimums. Reset test state with public helper.
  111. Refuse malformed EVM game invitations before service. Keep one base unit in ETH and USDC proposals. Reject invalid decimal syntax. Check EVM game amounts, participant limits, links, and terminal buttons.
  112. Edit wallet media only when callback identifies bot author. Refresh photos, videos, animations, and documents as captions. Ignore malformed refresh receipts without sending another wallet card.
  113. Bound confirmation, unjoin, and cyclic game error fixtures. Pin two resend attempts and final cause. Visit cause once.
  114. Check wrap buttons, selection labels, custom amount examples, and wallet example spacing. Filter blank or malformed values. Bound empty row removal in quick amount keyboard. Check valid layouts against main.
  115. Pin whole signed finance summary and period keyboard. Check displayed sponsor estimates, backfill status, private-chat sender guard, empty backfill pages, completion counts, and no-delay setting.
  116. Check exact, missing, and failed SQLite creation audit rows, and competing submission leases before, at, and after expiry, existing-owner renewal, and read-only lookup.
  117. Use SQL default for missing mints in player, chat, and global results. Keep blank and explicit stored mints distinct.
  118. Check wallet resend counts, final signatures, status retry timing and counters, and chain time fallback, status, history, and incomplete-status diagnostics.
  119. Check wrapped SOL discovery. Reject precision strings from wallet. Keep malformed wrap requests from moving funds or exposing internal errors. Require native mint identity for wraps. Keep provider rate and slippage.
  120. Skip stale creation recovery after durable row disappears. Keep only durable acknowledgements for confirmed creation recovery. Attach and delete only complete creation receipts. Check fallback creator label, timestamp, notice cooldown, and giveaway argument spacing.
  121. Restore old game controls when replacement is gone or has none. Keep confirmed join finished if its saved body has close flag. Keep migrated game message on reopen. Report failing SQLite count or insert.
  122. Check live /default token menu for both networks, standalone Telegram diagnostics, and normal text. Scope inline username hint to sender’s private chat.
  123. Check both token reset aliases, each game’s privacy default, and eligible refunds. Refuse mixed-case USD stakes before balance lookup, and unauthorized or premature game actions.
  124. Keep omitted transaction status pending until final, then permit expiry. Check invalid chain timing, database without timing writer, and errors before confirmation.
  125. Ignore malformed, duplicate, and obsolete pool addresses before polling. Exclude two equivalent empty pool arrays. Check failed discovery and recovery.
  126. Check whole config fields, name limit, UTF-8 file paths, and ordered RPC endpoints.
  127. Check complete setup callback syntax, multi-digit IDs and generations, and 24-hour preset. Restrict setup buttons to original user, chat, and message. Replayed updates do not send or submit again.
  128. Exclude only equivalent empty encoding and explicit BIP-44 path literals, which keep production values, three private error texts, and overwritten setup action array.
  129. Check stake presets, HTML output, forced reply, and stake at token minimum. Pin smallest distinct stake tiers and amount-menu rows. Round stake suggestions at six decimals both callers use.
  130. Bound wallet test retries, probes, and missing timer callbacks with fake RPC responses.
  131. Check EVM notifications, retry cutoff, refresh concurrency, and setup retry at one raw unit. Reject invalid tokens and player counts before wallet access.
  132. Check collector list at 20, escape names, and link only whole numeric IDs.
  133. Read last source hunk of large Git diff, save each mutation JSON beside its tally, and remove stale JSON for empty scope.
  134. Retry without referral only for admin token-to-SOL route. Check provider request.
  135. Reject unknown EVM token before USD message or wallet lookup, and empty action. Check restored EVM controls. Keep confirmation screen across restart. Remove unreachable amount defaults after EVM setup guard. Keep player argument position.
  136. Check Lightning payout without quote price or order. Offer no second payment during exchange. Clear private deposit prompts with bounded pass. Keep other owners’ and other tool prompts.
  137. Keep earliest wallet status timestamp, including zero, without unreachable success fallback. Check late status time and distinct no-status timeout.
  138. Exclude two equivalent database count variants at their exact lines. An ungrouped SQLite count returns one row or throws. SQLite ignores extra bindings with no placeholders. Check SQLite errors for timeout-column migration and membership index.
  139. Check game stats fallbacks for limits and pots in completed and active games, card edit and recovery calls, keyboard restore, and recreation lock release. Remove unreachable minimum guard and optional reads of present values.
  140. A small Stryker ignorer plugin skips mutants inside debugLog calls, whose arguments are pure trace text. A second skips only text literals in console log arguments. Other mutants in those calls stay tested.
  141. Check unjoin key choice, fee check decimals, and creator fallback. Simplify token mint conversion with the same result for every input.
  142. Check completion signature saves, older completion updates, stored terminal state, recovery schedule, and username cache keys. Read missing status as text, with the same result.
  143. Check expired giveaway timing at ticket minimum, each coinflip count warning and creator lookup source, and each confirmed game setting before hydration.
  144. Check player key analysis, complete cleanup, join attempts, resends, token account errors, and completion request. Remove a redundant empty-list guard, an unreachable optional read, and an unread join flag.
  145. Check batch account reads, active list defaults, Telegram name lookups, creator name, creation request reads, and games header. Remove redundant checks.
  146. Add tests for each fix in Bugs fixed. Faucet reconciliation reuses one claim key.
  147. Handle 29 changed-line game survivors from CI on e2b7cf8: 17 test kills, four dead-guard rewrites, and eight disable comments for equivalent mutants. Tests cover private join signers, probe type, token account errors, retry warning, history quotes and decimals, and zero stat limits.
  148. Format two test files with Prettier, so Static checks pass (0edeb39).
  149. Check the finalized slot list with one isFinalizedSlot check per slot. Number.isSafeInteger is true only for a number, so Number(value) is the value itself and every input gives the same result. Check text slots and the exact slots that the binary search reads (fb42acf, 9b7aa37).
  150. Read the Jupiter fee rate once and check it with Number.isSafeInteger, which is false for every value that is not a number. Same result for every input. Check a fee rate that JSON sends as text, and remove a disable whose reason was wrong (22e9dfe).
  151. Restore price > 0 in readQuote, with a test for a zero quote and an amount that has no finite unit value. Name the player in the key warning (babdd99).
  152. Restore the finite check in recordRateLimit. Test Infinity, -Infinity, NaN, 1e308 and JSON values that are not numbers (4392c15).
  153. Test that a private click on the deposit card detaches it, so polling does not edit it. Remove the disable on the detach (38c67cc).
  154. Test that callback data with a negative count in an unsigned field is refused. Remove the disable in decodeUnsigned (82a4152).
  155. Use typed Telegram fakes instead of any in the two new card test files (5ea4ba7).
  156. Check that the custom token prompt starts its examples with the label line, and remove the disable that called the label cosmetic (0a005f0).
  157. Keep the result of five key, mint and price reads in a variable that starts at the old catch value. Their disable comments trailed the return, so Stryker never read them. A test kills each emptied try (afecce9, de36f7a).
  158. Check that consume prunes expired rate-limit buckets once per window (42351da).
  159. Check the join recovery label, a quiet hydrate without chain timing, a first-ticket unjoin, a repeated completion and cleanup error logs. Exclude the equivalent empty-message default in the join retry: any text without the checked words takes the same path (99c69cd, ca9dcfb, 5f4fca9).
  160. Simplify the outbound diagnostic checks. inspect sees only JSON.parse output, so Object(value) !== value equals the old primitive check. The stack frame and source location patterns are used only with .test(), and each old match contains a match of the shorter pattern (2f29d22).
  161. Pass the RPC fee to Number directly. Number(null) is 0, which the positive check refuses like a missing fee. Check that an unusable RPC fee scales the fallback base fee (1f89936, 8cdb6c2).
  162. Mark mention ranges with a set of spans, without index loops. Type NamedIdentity so a name without a picked user always has a username, which removes a ! and two ?? "" defaults (0968def, 6765cea).
  163. Check challenge reply refusals for another picked user and bare @ mentions (f852ba5).
  164. Drop typeof checks that Number.isFinite or Number.isInteger already make, in completeGame, getRetryAfterSeconds and isMintDecimals (ed19213, f155dce, effbcfb).
  165. Check the native SOL ticker with toLowerCase() === "sol". Only a ticker that upper-cases to SOL is native, and of those only the long s does not lower-case to ASCII, as the old pattern required. Exclude the two equivalent defaults in the price split (188bf1d).
  166. Key the price cache by "" for a request without a mint. normalize never returns "", so nothing is stored there and the read misses as the early return did (40fab9f).
  167. Stop removing null characters from token names and symbols: umi's UTF-8 decoder already removes them (acbc1e1).
  168. Drop dead row checks in the quick amount and keyboard trim helpers (9ef71d3).
  169. Check that fired and cleared cache timers are forgotten and that unref is optional, which retry delays become safe deadlines, a non-text RPC failure that prints as a miss, a nonzero block height given at insert, one result slot per item, the reason for a failed text edit, and prompt order by write time (4401d6b, fba0b08, 704fd03, e5fd862, a0d1ef9, 1b80244, dbbc222).
  170. Check categorizeError with an empty message and a code of another type, and that an error's name does not pick the friendly reply (39ff932, 58f4920). Fix the types of the new timer and RPC failure fakes (84bae4a).
  171. Read token metadata decimals without ?.: getTokenMetadata always returns an object or throws (771b13b).
  172. Exclude the lock release in the text and media input finally blocks. Every try and catch path already ran clearInputSession(sessionKey, lockerId), so no session that this locker holds is left (b89813c).
  173. Check pending events for a game without a legacy record, and a render after one timer when the debounce is the largest delay (732647d, dea6f28).
  174. Build the EVM player inference arguments with one filter. args never holds an empty string, so dropping undefined drops exactly the missing parts. Read a non-integer EVM player reply as 0, which every game type refuses (87df8af, 24eed28).
  175. Check admin status probe error text, HTTP latency and a null body (581b19c).
  176. Let clampChatPlayers handle a null player count, which it already returns as null. Check prompt sessions without a chat and input results (1e00725, 0ed0f49).
  177. Check the stored error of a faucet claim with a bad balance (13ffbd6).
  178. Check game setup prompt targets, the cancel button, back to amounts, the exact custom amount payload and the typed player range. Remove the range disable: tests now kill each variant (14cbdc7, d883c18, 1e371a0).
  179. Store the setup session snapshot again in the compact players prompt, as main does, with a race test (f263904).
  180. Check token percentage sends and a repeated wrap prefix. Exclude the confirm_wrap_ fallback: grammY runs this handler only for a matching callback query, so its data is always set (d84670f).
  181. Return early for missing DexScreener pairs (d2a06d6).
  182. Check the pool trade filter, poller backoff, unparsed trades, stop, a removed alert row and the exact lamport minimum. Parse a trade time from String(block_timestamp), which gives NaN for a missing time as before. Remove three disables; the -> false variants that no input reaches stay as listed survivors (de7646c, 5d14b2e, 0ab700d).
  183. Exclude the null check on the minimum buy row: the publish filter reads the same enabled row just before, with no await between (9fb6edb).
  184. Reject a missing fee-sweeper price time with one finite check, and check the claim log. Remove the claimed-delta disable; a test kills < (b1d3d16, 644aa71).
  185. Price a raw finance amount with one NaN-safe range check: a missing price becomes NaN, and an infinite price gives a value that is not finite, which returns null as before (40576f2).
  186. Exclude two FixedFloat values that no input reaches: the optional unit group always matches, and the rate window drops a placeholder before any read. Refuse sats text with trailing characters (ba557c5, aea0124).
  187. Drop two position null checks: a missing SOL price is NaN, which the finite check refuses, and cacheFresh narrows the cache entry (dc8eb4d).
  188. Check the positive integer clamp warning, and build an unfresh position price set from null, which gives the same empty set as [] (296d372).
  189. The game token check no longer takes the chat or reads its default token, which never changed the answer (f2250ee, aeae002).

Bugs fixed

  1. Keep the exponent in large signed percentages. Use the six-place display limit for negative exponents. Scale the exponent of very large finite wallet ratios without overflow, so they do not show Infinity%. Keep scientific notation in a SOL shortfall message.
  2. Reject malformed trade percentages. Show the exact amount when the configured formatter returns blank.
  3. Ignore invalid surcharge inputs, cache lifetimes, and stored price marks, and keep valid values. Blank environment values use existing fee defaults. Keep explicit numeric zero and the cache minimum.
  4. A bare SOL unit no longer turns off the alert minimum. Without a valid bot deep link, use a Telegram callback.
  5. Keep the HTTP deadline while reading a provider body. Reject a blank trade signature and a negative retry interval.
  6. Use exact input cents before rounding at the Lightning deposit limit. Incomplete or malformed payout data is not a confirmed transfer.
  7. Bound Telegram callback scale by the token decimal limit. Refuse malformed numeric fields.
  8. Keep a positive integer limit active for a positive config value below one.
  9. Return the identity fallback for a malformed decimal with two signs. Keep final zeros in whole position amounts and exponents.
  10. A non-finite SOL price is unavailable, so reported fees and net profit stay finite. Non-finite prices or timestamps cannot authorize fee withdrawals, token swaps, unwraps, or referral claims. The fee sweep rejects future-dated prices before a swap.
  11. Remove a leaver by participant address when the replacement index is invalid.
  12. Keep the newer wallet fetch pending when a superseded one ends. Require a positive safe integer before wrapping SOL.
  13. Add slippage limit and fee account to the quote cache key. Reject non-finite strict referral surcharge inputs, and use the base fee where fallback is allowed.
  14. The Timba adapter rejects incomplete game account batches, so omitted entries do not look deleted. The expiry scanner and active game list retry unanswered entries.
  15. Refresh a blockhash that seems to come from the future, so a clock rollback cannot reuse it for over ten seconds. Do not cache a malformed block timestamp in the game clock. Fall back and ask the provider again next call.
  16. Reject malformed visibility button data instead of decoding it as public.
  17. Keep invalid mint precision out of wallet and bot caches and swap amounts. Use a valid fallback source or refuse the metadata. Keep valid 0 and 255 endpoints.
  18. A duplicate reply cannot retake its active prompt lock, and an expired prompt cannot be locked. Only the current lock owner cleans up, so an old handler cannot clear a replacement.
  19. Settings defaults accept only safe decimal integers, not a numeric prefix from 2.5 or 12players.
  20. Validate each returned entry, so a short or sparse swap-account lookup cannot report readiness. A hung request stops at the two-second deadline.
  21. Only the current request fills the public game cache or removes its pending entry, so a pre-reset scan cannot replace the refreshed list.
  22. Skip invalid decimal scales and non-finite amounts in position math, but keep valid zero-decimal and signed conversions. Only the current wallet position fetch publishes prices, so a stale fetch cannot replace refreshed prices or remove the newer pending fetch.
  23. A removed or replaced mint watch no longer sends alerts. Discard stale pool discoveries and trades. A blank swap input is unknown, not zero.
  24. Reject an invalid callback queue capacity, which could enqueue forever. Keep newest callbacks in arrival order.
  25. On a dollar valuation overflow, a trade alert shows the known SOL amount, not a false zero-dollar amount.
  26. Custom game prompts stay open for invalid input such as 3players, 1e2, or 0x10.
  27. One Jupiter price deadline covers headers and body, so a stalled body or fetch cannot leave a lookup pending. Batch callers fall back to individual prices.
  28. Request identity discards Oracle replies from every superseded request, including a same-URL refresh. A stale reply cannot replace current token policies.
  29. Use three Telegram retries by default when the count is not finite or not exactly countable, not unlimited retries.
  30. The admin probe no longer shows malformed slots as healthy, measures through the body, and redacts uppercase URLs in remote errors.
  31. A malformed wallet balance no longer creates a faucet or permits a payout. Release the claim and keep the faucet. Reconciliation no longer sends a second faucet notice for a payout while that notice is in flight. Other notices still go out.
  32. Roll back player, challenge, and game row changes together when game cleanup fails.
  33. Check that a token is still in the wallet before saving send confirmation.
  34. Use the original provider result's signature when available, so a structured resubmission failure keeps its replacement signature. A non-finite or unsafe wallet resubmission limit allows no resubmission but still lets the original signature confirm.
  35. A fractional or invalid Jupiter rate is not a confirmed referral fee. Do not substitute the total fee for an invalid platform rate.
  36. Reject a positive fractional keyboard width below one, which gave a zero loop step. Use bounded iteration for other layouts. Skip suggestion tiers whose precision scaling overflows. Keep contract minimum and custom amount option when no valid tier remains.
  37. An error while attaching the signed transaction no longer masks a plain provider error. Keep the cause and signature, also for a malformed wallet provider error detail, without changing an existing Error object’s identity. Keep malformed RPC errors intact without resending a write.
  38. Reject an oversized numeric Retry-After instead of waiting forever. A malformed HTTP Retry-After gets the ordinary fallback, so it cannot block the RPC host indefinitely. Keep valid cooldown deadlines across poll cycles, so a long cooldown cannot overflow the timer into an early request.
  39. Wallet positions read all purchase costs. A missing SOL quote no longer makes a SOL cost free next to a stablecoin cost.
  40. Check wallet snapshot writes against recorded generation and endpoint. A same-tick clear no longer blocks the new snapshot, and a late page cannot fill the wrong RPC cache.
  41. Use the configured fallback when a large on-chain fee or overflowing reserve formula gives an unsafe lamport budget, and for a negative, fractional, or unsafe provider fee in ordinary quotes. Sponsored quotes fail without trusting that fee.
  42. Bun could fire a long Telegram delay after one millisecond. Media retries surface the original error, not an early retry. Game updates keep their pending request and wait in supported intervals.
  43. The active wallet rate limit count checks expiry on request, not at the next periodic cleanup.
  44. Only provider errors reporting a missing account mean an absent mint, not an unavailable RPC method or endpoint or a malformed owner. Recheck an absent mint after its cache window and read the current balance, not zero until restart.
  45. The recovery scan rejects malformed finalized slots before requesting blocks, to avoid extra RPC calls.
  46. The original confirmation error propagates without a retry. A symbol or malformed message no longer turns it into a TypeError.
  47. The protected-file read loop uses bounded buffer iteration with a finite read limit. Mutation testing found two paths that could stall it. Normal and boundary file behavior matches main. Keep parser fallbacks optional.
  48. Game history no longer requests unused prices for recent rows. Aggregate totals still fetch needed prices. Equal wins and losses share one quote. A non-finite quote stays out of displayed totals.
  49. Defaults commands write no settings without a chat. Check callback owner and session, and the network, join, and notification buttons.
  50. Keep keys in their own state namespace. Merge partial updates without losing other prompt fields. Check timed-state boundary and clearing.
  51. Use the canonical mint identifier in token-program diagnostics and the original key at the RPC boundary.
  52. Check EVM database permissions, strict SQLite writes, persisted action routing, and handle release. Close the handle if schema initialization fails.
  53. Use fixed public keys in unsigned token-account recovery and metadata fixtures. Signing tests keep real test keys.
  54. Accept only supported EVM command aliases. Check bot mentions, start links, and withdrawal field order.
  55. Start no action when a saved EVM approval or transaction lacks bytes or a hash. Reuse saved bytes in receipt recovery without opening the wallet. Check oracle headers, HTTP request bodies, and deployed chain and address.
  56. Iterate over available recovery probes directly. Earlier slot checks cover checkpoint records. Check zero and negative retry delays, slot zero, ordered retry logs, and original error cause.
  57. Log each failed count query and each failed menu edit once. Keep the menu fallback order. Check caption options, zero IDs, missing callback context, and throttled adapter edits.
  58. In SQLite, keep a recorded transaction height of zero distinct from an unknown height. Check diagnostics and defaults for missing history tables. Verify token schema diagnostics and startup without an unnecessary migration.
  59. Reject blank single RPC fallback values. Normalize the configured endpoint list once. Use an independent provider only after its cluster matches. Reuse that verification.
  60. Start no RPC read at its deadline. Keep the original subscription owner after a failed removal. Give no ID to a missing native subscription.
  61. Check membership cache expiry, one timestamp per batch, and rollback after a failed SQLite write. A stale pending-game record cannot delete a newer submission.
  62. Keep finite game completion timestamps, including zero. Use the clock for a missing or non-finite one. Keep a recorded pot of zero.
  63. Keep the generic callback answer when a provider error message is not a string or not printable. Keep string and numeric error codes.
  64. Use only defined player-selection layouts. Keep rows, fallback controls, button callbacks, and the exact low-balance warning text.
  65. Leave negative rates and overflowing USD valuations unpriced, and keep raw token amounts. Check accounting for partial, equal, and excess sponsor reimbursement.
  66. Reuse one exclusion filter for expiring and undated games. Read actual SQLite change counts. Check empty results and cutoff.
  67. Keep original inferred precision for tiny token amounts, tested apart from the intentional finite percentage overflow fix.
  68. Keep game setup state on the prompt the bot delivered: amount and player prompts, retry messages, and the next setup card. Successful edits keep original text and menu.
  69. Require exact mint identity for Jupiter metadata. Keep textual search, the native SOL alias, and slippage and price-impact boundaries.
  70. Check state on the real replacement giveaway card in the bot-level integration fixture.
  71. Fail promptly if a player mapping test exceeds five lookups. Check retry count, timing, and original fallback label.
  72. Invalid confirmation counts and non-string resubmission values are not confirmations. Remove an unused write on the immediate error path. Keep withdrawal fields and the default token with trailing whitespace.
  73. Verify configured EVM network and RPC order, RPC and oracle deadlines, and no replay after an unrecognized receipt error.
  74. Pin inferred formatter padding for longer exponents. Exclude only the optional parser call whose absence already returns null. Restore the original invalid-scale error and keep shared rounding.
  75. Keep a live game notification target after a legacy lookup fails. Drop player notifications older than 15 seconds before sending, even if a game card just appeared, and check that boundary.
  76. Store the custom join-notification rate prompt on the delivered Telegram message. Leave no prompt when the reply has no message ID.
  77. Keep following the original Solana signature after a processed status or unknown outcome. Do not re-sign because a later read lacks that status. Keep an unresolved replacement's signature. Retry when expiry is known.
  78. Back off the same signature on transient status errors. If the last RPC read times out, check confirmed history without treating that failure as proof of expiry.
  79. Use the full quoted USD price before flooring to whole token units. Keep minimum supported quote, exact safe integer maximum, and too-small error.
  80. Let an explicit token override a native SOL default. Keep USDC amount and precision. Use wrapped SOL for an explicit SOL game and native SOL for an explicit SOL tip.
  81. Use safe confirmed bigint fees in swap and game accounting.
  82. The player mapping type now includes the display name SQLite returns, optional for legacy rows.
  83. A negative referral quote no longer reduces a valid claim total. Invalid parsed mint precision no longer inflates a value or bypasses the nine-decimal fallback.
  84. The wallet reports bigint confirmation counts in polling and the final check. Transactions are unchanged.
  85. The mutation check no longer truncates Git diffs above 1 MiB. The setup trial replaced changed-code JSON in a shared CI artifact, so save the full report per scope. Stryker's cached test-mode module no longer changes the production polling fixture.
  86. A buy alert with a NaN or infinite SOL amount is below a set minimum, so it is not posted. On main a NaN amount skipped the check and the alert was posted. Without a minimum, the alert still posts. tests/buy-alerts.publisher.test.ts checks both cases.
  87. satsToBtc accepts 16-digit amounts up to the 2,100,000,000,000,000 sats limit, which main refused. One above the limit and a 17-digit amount are refused (83cd859).
  88. Contract capital throws when the RPC returns fewer accounts than requested. Before, the missing targets were skipped and the total was too low, with no error (344d5f0).
  89. A Telegram 429 whose retry delay is too large to represent is thrown again. Before, the media retry waited one second (17f754d).
  90. Positions fills are cached with the exact mints they were built with. Before, a mint that came back after a rebuild without it looked known, and its buys stayed missing until the cache expired (58c60a6).
  91. A player wallet key that does not parse logs one warning with the player ID (2a38b4f, babdd99).
  92. A sponsored swap needs a whole, non-negative fee rate. When Jupiter sends a platform fee that is not valid, the swap no longer falls back to the top-level fee rate (1f7b4d1, 22e9dfe).
  93. The debug trace ignorer ignores a call only when every argument is text or a plain value, and the mutation workflow runs when an ignorer changes (92ac26c).
  94. collectErrorLogs reads data, error and cause once each. Before, a getter that gives its value only once passed the check and then pushed undefined, so its logs were lost (289d2b0).
  95. A percentage swap reads the source balance by the resolved mint only. Before, it also matched by ticker, so a second token with the same ticker could give its balance and decimals (0430a56).

Changed-code mutants

The Mutants / Changed code job on the final commit 296d372 (run 46396618729) scored the lines that this PR changes: 3,839 killed, 16 survived, 0 without coverage, 4 timeouts and 54 ignored (hidden by a disable comment or an ignorer). A timeout counts as detected.

Each survivor left is equivalent: no input can tell it apart from the original. Each one shares its line and mutator with a mutant that a test kills, so a disable comment would hide that killable mutant too. These survivors are:

  1. handlers/admin-status.ts:84 typeof slot !== "number" → false: Number.isSafeInteger rejects every value that is not a number.
  2. handlers/game-callbacks.ts:128 ctx.callbackQuery?.message → .message: it runs only inside callback query handlers.
  3. handlers/game-callbacks.ts:725 players === null → false: null < minPlayers is true, because every minimum is at least 1.
  4. handlers/lightning.ts:161 if (messageId) → true: a detach without a message changes no row.
  5. buy-alerts/pool-trades.ts:131 tokenAmount == null → false: null <= 0 is true.
  6. buy-alerts/pool-trades.ts:401 !watch → false: setMints stores a watch for every mint.
  7. buy-alerts/pool-trades.ts:413 !target → false: every queued pool has a target.
  8. buy-alerts/publisher.ts:221 deliveredChats.size → true: an empty set acts like no entry.
  9. fee-sweeper.ts:550 >= → >: a zero delta is already null.
  10. lightning/fixedfloat.ts:104 multiplier !== undefined → true: the unit pattern allows only keys of the table.
  11. utils/callback-data.ts:59 parsed === null → false: null < 0 is false, so null is returned either way.
  12. utils/game-creation-recovery.ts:123 probes < maxProbes → true, <= and probes -= 1 (3 mutants): a correct binary search ends before the bound.
  13. utils/game-creation-recovery.ts:132 low <= high → false and low < high (2 mutants): the loop ends only when low > high.

Review

The numbers match the review of 2026-11-29. Each item is done or rejected with a reason.

Scope decision: Part of #451, an exact Scope, Left for follow-up PRs (also on Issue #451), the five Done when boxes, and Evidence as counts.

  1. Join retry loop: the disable is gone. The loop is for (let attempt = 0; ; attempt++); only a timeout before the last attempt continues, and every other path breaks or throws (2a38b4f).
  2. isTerminalRedraw: removed. A terminal redraw has the literal status "Completed", and both redirects need another status (2a38b4f).
  3. Missing player key guard: kept, without its disable. A key that does not parse logs one warning, and a test expects it (2a38b4f, babdd99).
  4. readQuote: Number.isFinite(price) && price > 0 is back. The interim Math.max(price, 0) was not equivalent, because 0 * Infinity is NaN. A test checks a zero quote (babdd99).
  5. Username hint after a failed getChatMember: the call is back, with an interleaving test that a hand mutant fails (2a38b4f).
  6. Media 429 with a delay too large: rethrown, tested with retry_after: 1e308 and a 35-digit hint (17f754d).
  7. Disable audit: see the table below. Each of the 10 wrong disables is removed. A test kills its mutant, a rewrite removes it, or it is a listed equivalent survivor. Five more disables never applied, because they trailed a return. They are rewritten too.
  8. Load: each hand mutant ran one test file in Podman with --memory 2g --cpus 2 and a time limit. Full runs ran in CI.
  9. CI: each push waited for CI. Final results are under Evidence.
  10. Changed-code survivors: see Changed-code mutants. Sub-items a–e (wallet-menu generation check, Lightning quote expiry, fee-sweeper USD value, positions mark check, Lightning accepted branch): the job killed every mutant it made there (6, 39, 3, 19 and 9).
  11. The mutation workflow runs when an ignorer or its test changes, and the setup trial includes them (92ac26c).
  12. debugTraceIgnorer checks each argument with isPlainText, tested both ways (92ac26c).
  13. NaN alert minimum and 16-digit sats: listed under Bugs fixed and tested (83cd859).
  14. contract-capital: a short RPC list throws (344d5f0), listed under Bugs fixed.
  15. One decimals source: send and swap read decimals from the selected token or the balance entry of the same mint (704b4bd). The swap balance now matches by mint only (0430a56).
  16. Guards that threw inside the code under test set a flag, which the helper reports on restore and in afterEach (3d79f30).
  17. useInstantRecoveryBackoff fails on an unlisted delay of 1 second or more (3d79f30).
  18. withinTestDeadline is 3,500 ms, below Bun's 5,000 ms timeout (3d79f30).
  19. The errors.parser case for a value that is not an array is back (3d79f30).
  20. The PR adds 0 as any and 0 non-null assertions. The new test files use fake<Context> and a typed payload guard (5ea4ba7). Older test files lose more any than they gain. 17 test files reach private members with typed bracket access (gm["isPlayerInGame"]), which keeps names and signatures checked, unlike (gm as any).x (782 uses on main). Reasons: the game expiry, join, unjoin, key and active-list tests replace one step of a flow that needs a live chain; completion-state, stats-boundaries and update-message-recovery need a state that no public call sets up; the swap and wallet tests reach fee, token account, program cache and pending signature steps that have no public entry without RPC.

Re-check review of 96ed686..296d372: 2 findings, both real, fixed in aeae002. One test added an as any (now a typed copy with chatId deleted). The token check change was listed as a bug fix but keeps behavior, so it moved to Changes.

Disable audit

Each Stryker disable that this PR adds, with the mutants that the final changed-code report shows as ignored on that line, and the two ignorers. Each verdict was checked against every input, including untyped JSON.

Line Mutators Mutants hidden Verdict
bot.ts:6116 CallExpression ; Correct: every path already cleared this locker's session
bot.ts:6206 CallExpression ; Correct: every path already cleared this locker's session
evm/config.ts:23 StringLiteral unchanged line: return evmBotConfigSchema.parse(JSON.par Correct: JSON.parse turns the buffer into the same text
evm/setup.ts:153 StringLiteral unchanged line: if (!action) throw new Error("Invalid se Correct: the catch ignores the message
evm/setup.ts:230 StringLiteral unchanged line: if (raw < BigInt(s.token.minimumAmount)) Correct: the catch ignores the message
evm/setup.ts:238 StringLiteral "" Correct: the catch ignores the message
evm/setup.ts:278 ArrayDeclaration unchanged line: actions: [], Correct: render replaces the list before save
evm/wallet.ts:10 StringLiteral unchanged line: return mnemonicToAccount(mnemonic, { pas Correct: Viem uses path ¦¦ m/44'/60'/0'/0/0
handlers/wallet-transactions.ts:910 OptionalChaining, StringLiteral ctx.callbackQuery.data, "Stryker was here!" Correct: grammY runs it only for matching callback data
services/buy-alerts/pool-trades.ts:401 ArrayDeclaration ["Stryker was here"] Correct: setMints stores a watch for every mint, so [] is never returned
services/buy-alerts/publisher.ts:109 OptionalChaining deps.chatDb.getChatBuyAlerts(c Correct: the filter read the same row just before, with no await
services/lightning/fixedfloat.ts:94 StringLiteral "Stryker was here!" Correct: the optional group always matches
services/lightning/fixedfloat.ts:109 ArrayDeclaration new Array([]) Correct: the rate window drops the placeholder before any read
services/lightning/store.ts:32 ObjectLiteral, BooleanLiteral {}, false Correct: every query binds each ?
utils/callback-data.ts:89 StringLiteral "Stryker was here!" Correct: part count is checked first
utils/callback-data.ts:112 OptionalChaining encoded.charAt Correct: part count is checked first
utils/callback-data.ts:114 OptionalChaining, StringLiteral encoded.slice, "Stryker was here!" Correct: part count is checked first
utils/game-database.ts:1947 OptionalChaining unchanged line: this.get<{ count: number }>( Correct: COUNT returns one row or throws
utils/game-database.ts:1950 ArrayDeclaration unchanged line: [], Correct: no placeholders, extra bindings ignored
utils/game.ts:5683 StringLiteral "Stryker was here!" Correct: no checked word in either text
utils/game.ts:5698 ArrowFunction () => undefined Correct: undefined and false take the same path
utils/game.ts:6192 StringLiteral "Stryker was here!" Correct: no checked word in either text
utils/game.ts:6217 ArrowFunction () => undefined Correct: undefined and false take the same path
utils/game.ts:6467 OptionalChaining meta.decimals Correct: the throw lands in a catch with the same default
utils/game.ts:6480 OptionalChaining lookup.price Correct: null quote and zero quote both add nothing
utils/game.ts:8924 StringLiteral unchanged line: // Stryker disable StringLiteral: operat Correct: the three texts go only to debugLog and console.error
utils/program-event-parser.ts:49 OptionalChaining unchanged line: return decodeFallback?.(logBase64) ?? nu Correct: the catch returns the same null
utils/program-event-parser.ts:72 ArrayDeclaration unchanged line: return parseProgramEventLogs(program.pro Correct: the added text is not a program log
utils/rpc-endpoints.ts:291 StringLiteral "" Correct: the index stays in the list; log text only
utils/telegram-rate-limiter.ts:443 StringLiteral "Stryker was here!" Correct: both texts parse to NaN
utils/token-manager.ts:573 StringLiteral "Stryker was here!", "" Correct: split always returns the coefficient; Number reads "" and "0" as 0
utils/wallet.ts:2534 ObjectLiteral {} Correct: readers treat undefined like null and false
scripts/stryker-ignorers.mjs log text rule StringLiteral text literals in console arguments Correct: log text only; other mutants in the call are tested
scripts/stryker-ignorers.mjs debug trace rule all a whole debugLog(...) call Correct only when every argument is text or a plain value, which the rule checks

Evidence

This is a summary with counts. The full record (156 entries) is in the earlier body revisions of this PR and in /mnt/data/agent-cache/bot-mutants/ on mr.

  1. Rotation checkpoint 5d5fd87: 1,533 exact named kills, 11 narrow exclusions, 4,536 survivors, 321 coverage gaps, 1,369 rows to score again and 3,584 unmeasured rows.
  2. Each fix commit has a test that fails before the fix. The tests that do not depend on a fix also pass on pinned main (2 to 48 cases per commit).
  3. Formatter: 6,448 comparisons with main match, except two intentional overflow fixes. All 31 historical equivalence candidates match pinned main on 32,382 comparisons each. Restored padding matches main on 2,574 unusual cases.
  4. Scoped Stryker replays: game 3,218 variants (1,623 kills), bot 2,129 (863), database and finance 1,306 (704), EVM 842 and 813 (544 and 571), recovery 478 (452), utilities 305 (297), formatter 257 (257). Each timeout that a replay found (wallet 16, retry 4, transaction runner 4, cycle 3, game 3) has a named killing test or a bounded fixture.
  5. Hand-applied mutants for this review ran one test file each in Podman with memory, CPU and time limits. This review applied 97 mutants by hand: 20 for the coordinator fixes, 41 by one survivor agent and 36 by the other. A named test killed each one.
  6. Final commit 296d372: Validate (46396618738) ran 6,371 tests in 421 files for each contract version with 0 failures and passed the 100% line coverage gate. Static checks, Mutants / Changed code, CodeQL, CI / Required and Verify tested source tree pass. The mutation setup trial scored 386 killed, 76 survived, 2 without coverage and 15 ignored; it checks that the setup runs and is not a gate.

Done when

  • Every change is a test kill, a behavior-keeping rewrite, a listed bug fix, or an exclusion with a correct reason.
  • Both contract versions and the coverage gate pass on the final commit.
  • CI passes on the final commit, and the changed-code job leaves no survivor in changed lines without a reason.
  • Agent review.
  • User-like check.

@astrovm astrovm changed the title test(format): pin amount formatting boundaries test(bot): cover the weekly mutation report Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Mutation testing: 2933 of 2953 changes caught by a test.

src/handlers/admin-status.ts:84:9-84:33  survived: ConditionalExpression → "false"
src/handlers/game-callbacks.ts:128:29-128:55  survived: OptionalChaining → "ctx.callbackQuery.message"
src/handlers/game-callbacks.ts:725:13-725:29  survived: ConditionalExpression → "false"
src/handlers/lightning.ts:161:11-161:20  survived: ConditionalExpression → "true"
src/services/buy-alerts/pool-trades.ts:131:32-131:51  survived: ConditionalExpression → "false"
src/services/buy-alerts/pool-trades.ts:401:15-401:21  survived: ConditionalExpression → "false"
src/services/buy-alerts/publisher.ts:221:13-221:32  survived: ConditionalExpression → "true"
src/services/lightning/fixedfloat.ts:104:10-104:34  survived: ConditionalExpression → "true"
src/utils/callback-data.ts:59:10-59:25  survived: ConditionalExpression → "false"
src/utils/game-creation-recovery.ts:123:43-123:61  survived: ConditionalExpression → "true"
src/utils/game-creation-recovery.ts:123:43-123:61  survived: EqualityOperator → "probes <= maxProbes"
src/utils/game-creation-recovery.ts:123:63-123:74  survived: AssignmentOperator → "probes -= 1"
src/utils/game-creation-recovery.ts:132:11-132:22  survived: ConditionalExpression → "false"
src/utils/game-creation-recovery.ts:132:11-132:22  survived: EqualityOperator → "low < high"
src/utils/game.ts:5628:44-5720:10  timeout: BlockStatement → "{}"
src/utils/token-manager.ts:446:89-452:6  no coverage: BlockStatement → "{}"
src/utils/token-manager.ts:446:9-446:87  survived: ConditionalExpression → "false"
src/utils/token-manager.ts:446:9-446:27  survived: ConditionalExpression → "true"
src/utils/token-manager.ts:446:9-446:27  survived: EqualityOperator → "context !== \"game\""
src/utils/token-manager.ts:446:21-446:27  survived: StringLiteral → "\"\""

Each one is a change to the code no test noticed. Not a blocker: real gaps get their own PR. Full report

@astrovm astrovm changed the title test(bot): cover the weekly mutation report test(bot): address the full mutation report rotation Nov 29, 2026
The percentage swap looked up the wallet balance by mint or by ticker.
Two tokens can share a ticker, so a "50%" swap could take the balance
and decimals of another mint with the same ticker. Now the lookup uses
the resolved input mint only.

The new test has two BONK tokens with different mints and decimals. It
fails with the old lookup. It also kills the ObjectLiteral mutant on the
tokenBalance snapshot.
wallet.getTokenMetadata is typed to resolve to an object, and every
return path returns an object (resolver result, resolveTokenMetadata
result or cache entry) or throws. So metadata?.decimals and
metadata.decimals always read the same value. This removes an
equivalent OptionalChaining mutant.
The text and media input handlers run clearInputSession(sessionKey,
lockerId) on every try and catch path. That call deletes the session
while this locker owns it, and setInputSession strips the lock fields
from a new session. So when finally runs, no session is locked by
lockerId and clearInputSessionProcessing does nothing. The
CallExpression mutant that removes it cannot be told apart.
The target lookup reads the legacy game record with optional chaining.
The new test returns no record for that lookup and expects no warning,
the flush log line and one notification to the live message. It kills
the OptionalChaining mutant on gameRecord?.chat_id and the mutant that
removes the flush log.
A debounce of exactly MAX_TIMER_DELAY_MS fits in one timer. The test runs
only the pending timer and expects one render. The mutant that also
splits this delay (>= instead of >) chains a second timer, so the render
does not happen. This kills that EqualityOperator mutant.
The args list used two conditional spreads. When no player count was
typed, the ArrayDeclaration mutant put "Stryker was here" in the players
slot, and inferMaxPlayers ignores a non-numeric value there, so the
mutant was equivalent. The list now drops undefined parts with a filter.
The command args never hold an empty string (they are filtered with
Boolean), so this keeps the same list for every input.

A new test types a coinflip with players and no token. With the other
tests it kills every mutant of the new filter.
The typed player count check started with value === null. Since
null < 1 is true, the ConditionalExpression mutant that drops this test
was equivalent. A reply that is not an integer now becomes 0, which is
below the minimum for every game type, so the range check alone rejects
it. The accepted and rejected inputs stay the same.

New tests type each limit for coinflip and giveaway: 1 and 0 are
rejected, 2, 1 and 100 are accepted. They kill the coinflip, <= and >=
mutants on this line, and the && mutant of the new fallback.
New probe tests check an empty error message ("error"), the 80
character cut, redaction of a plain http:// URL, the latency of an HTTP
failure with an injected clock, and a JSON body of null. They kill the
StringLiteral, MethodExpression and Regex mutants in
describeProbeError, the ArithmeticOperator mutant in the HTTP failure
branch, and the two OptionalChaining mutants on the payload.
clampChatPlayers already returns null for a null candidate
(Number.isFinite(null ?? NaN) is false). So the parsed === null guard
before it gave the same result on every path, and its
ConditionalExpression mutant was equivalent. The guard is removed.
…esults

A join-rate prompt whose update and reply carry no chat id must not open
an input session. This kills the ConditionalExpression mutant on
chatId != null. The join-rate tests now also check that
handleSettingsInput reports the invalid-rate and expired-session
replies as handled, which kills the BooleanLiteral mutant on the
invalid-rate return.
A claim that fails because the wallet returned an invalid raw balance
stores that message in last_error. The test now checks it, which kills
the StringLiteral mutant on the error text.
…k to amounts

New prompt-target tests:
- a custom amount callback without a message stores the prompt under
  the sent reply (kills the OptionalChaining mutant on message_id);
- a callback without a chat stores an edited prompt under the message
  chat, not chat 0 (kills chatId === originalChatId -> true);
- a sender id that only the setup module sees makes requireTelegramId
  throw, and the logged error names "type amount prompt" (kills the
  StringLiteral mutant on that label);
- back to amounts uses the stored balance and minimum for the keyboard
  without a wallet read (kills the ObjectLiteral mutant on
  { session, tokenContext }).
The compact players test now also checks the cancel button text and
callback data (kills two StringLiteral mutants).
…ct players prompt

Commit 244d8b7 dropped ...(creatorContext.session ?? {}) from this
storeSetupPromptSession call. On the same-message path the old code
wrote the fields read at the start of the handler. The new code wrote
only the prompt fields and merged them with the stored state at write
time. The two differ when the stored setup changes or expires while the
prompt edit is in flight. This restores the old form and removes the
comment that claimed both paths were the same.

The new test clears the stored setup during the edit and expects the
fields read before the edit. It fails without the spread and with the
&& mutant of ??. Both forms bring back a setup that was cancelled during
the edit. That race is older than this change and is not fixed here.
…disabling them

The Stryker disable on the typed player range check hid killable
ConditionalExpression mutants: a check that is always true rejects a
valid count, one that is always false accepts 0 or 999, and dropping
players < minPlayers accepts 1. The disable is removed. New tests type
"1" (rejected) and "2" (accepted) for a coinflip. With the existing 20
and 21 tests they kill every variant except players === null -> false,
which is equivalent because null < minPlayers is true.
The custom amount prompt test now checks the edited text, the HTML parse
mode and the cancel keyboard. This kills the ObjectLiteral mutant on the
respondWithMenu payload and the StringLiteral mutant on "HTML" in
presentCustomAmountPrompt.
New send tests choose 50% of a token balance, once with the quick button
and once typed into the custom amount prompt. Both expect half of the
raw balance. They kill the ObjectLiteral mutants on the tokenBalance
snapshot in both send paths. A wrap confirmation whose data repeats the
prefix is now rejected, which kills the Regex mutant without ^.

The wrap handler is registered with bot.callbackQuery(/^confirm_wrap_/),
so ctx.callbackQuery and its data are always set there. The
OptionalChaining and StringLiteral mutants on that read are excluded.
selectSolanaPairs looped over pairs ?? []. Its ArrayDeclaration mutant
looped over a string instead, and every character was skipped because it
has no chainId, so the mutant was equivalent. The function now returns
[] when pairs is null or undefined and then loops over pairs. The result
is the same for every input, and the existing selectSolanaPairs(null)
test kills every mutant of the new guard.
…them

The Stryker disable on the GeckoTerminal trade filter hid killable
ConditionalExpression mutants: a filter that is always true drops every
trade, and one that is always false keeps a zero amount. The disable is
removed. New cases expect null for a zero token amount, a blank
transaction hash and a missing trader. They kill every variant except
tokenAmount == null -> false, which is equivalent because null <= 0 is
true.
New pool trade poller tests:
- each malformed trades response doubles the wait before the next
  request, and the reported error names the malformed response (kills
  the StringLiteral mutant and the removed deferAfterTradeFailure call);
- a snapshot with a trade that does not parse still emits the newer buy
  (kills if (!event) -> false);
- a response that arrives after stop() emits nothing (kills the removed
  watches.clear() call).

The two Stryker disables in pollNow hid killable "-> true" mutants that
drop every pool. The ConditionalExpression part is removed from both;
the existing emit tests kill those variants. The "-> false" variants
stay as documented survivors: setMints stores a watch for every mint,
and refreshPoolQueue queues only pools with a target. The
ArrayDeclaration disable stays, because that empty list is never
returned.

The trade time now parses String(block_timestamp) instead of
block_timestamp ?? "". A missing value gives "undefined", which parses
to NaN like "", so the result is the same and the equivalent
StringLiteral mutant is gone.
belowMinimum runs only inside the publish filter chain, after matchesMint read an enabled row for the same chat. The chain is synchronous, so the row is still there and the OptionalChaining mutant cannot be told apart.
…imum

A chat that is still in the enabled list but has no alert row any more
is skipped without an error. This kills the OptionalChaining mutant on
config?.enabled. A 0.1 SOL buy against a 100_000_000 lamport minimum is
posted, because adding 1e-9 to 1e8 does not change the double. This
kills the <= mutant of the dust check.
…te check

The price check used null for a missing timestamp and then tested
timestamp === null || !Number.isFinite(timestamp). Number.isFinite(null)
is false, so the null test was redundant and its ConditionalExpression
mutant was equivalent. A missing timestamp is now NaN, and the finite
check alone rejects it with the same reason.
The Stryker disable on the claimed-delta check hid a killable mutant:
with < instead of >=, an outgoing delta (for example -7) is skipped and
an incoming one is recorded. The existing "records only an outgoing
delta" tests kill it, so the disable is removed. The > variant stays as
a documented survivor, because referralDeltaFromTransaction returns null
for a zero delta.

The claim order test now checks the "Referral claim 2/4" and "4/4" log
lines, which kills the StringLiteral and ArithmeticOperator mutants in
that log.
…check

priceRawAmount rejected price === null, a non-finite price and a
negative price before it multiplied. The null test and the finite test
were both redundant, so their ConditionalExpression and LogicalOperator
mutants were equivalent. A missing price now becomes NaN, and
!(unitPrice >= 0) rejects NaN and every negative price, including
-Infinity. A +Infinity price gives a value that is not finite (Infinity
or NaN), which the existing last check turns into null. -0 still
returns 0. Every mutant of the new lines is killed by the finance report
tests.
- invoiceMatchesSats: the group ([munp]?) always takes part in a match,
  so match[2] is never undefined and the "" fallback is never used.
- FixedFloatClient.requests: call() filters the list by
  r.at > now - 60_000 before it reads it. A placeholder [] has
  Array.prototype.at there, which compares false, so the
  new Array([]) mutant is dropped before any read.
satsToBtc("12x") and satsToBtc("1.2") must throw DepositInputError.
This kills the Regex mutant that drops the $ anchor of the sats
pattern in fixedfloat.ts.
- buildTokenPositions: a missing SOL price now gives NaN, not null, so
  the marked USD cost is NaN and Number.isFinite rejects it. The old
  markedUsd !== null check had no effect, because
  Number.isFinite(null) is false.
- resolvePositionWork: cacheFresh is now
  cached !== undefined && cached.expiresAt > now. TypeScript narrows
  cached through cacheFresh, so the later cached?. and
  "cacheFresh && cached" checks go away. Map values are objects, so
  the old Boolean() test gave the same result.
@astrovm astrovm mentioned this pull request Nov 30, 2026
…rice set from null

The changed-code job on dc8eb4d left two survivors that are not equivalent
or need no mutant: removing the parsePositiveInteger clamp warning passed
every test, and the empty list for an unfresh position cache could hold a
placeholder. A test now expects the clamp warning, and the price set is
built from null, which gives the same empty set as an empty list.
The check stopped reading the chat in f2250ee, so the options parameter had no reader. The two chat defaults tests that reach the expired-session reply now delete chatId from a typed copy of the session, with no cast.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant