Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correctness
purgecharged its budget for messages requested rather than deleted, so a filtered-out message silently cost a slot; now paginates with abeforecursor and charges only actual deletions.MessageUpdatewrote message content to Redis before checking the log exclusion list; the check now precedes the write.join!instead oftry_join!, so one failing handler can no longer cancel a code expansion between sending and recording it.http://URLs: scheme stripping fell through to the unstripped string, so every plain-HTTP hash was computed with the scheme still attached.fullHashes:findmay return a 4–32 byte hash prefix; matching it required an exact 32-byte hash, silently dropping those results.dedentcomputes a real common prefix, leaving mismatched indentation alone.Performance
Vec<Vec<u8>>alongside aHashSetholding a second copy of every prefix — roughly 10 MB and 200k allocations per list down to 1.2 MB and two.sha256returns[u8; 32]rather than allocating, and URL checks no longer allocate a key string per hash.ThreatTypeno longer allocates aStringper serialisation.rayon, now that the parallel scan it existed for is gone.starboard_emojisonce instead of once per reaction.utils::truncateborrows instead of allocating on every call.StorageKeybuilds one buffer instead of four allocations per key; wire format unchanged.Refactoring
ModerationActionreplaces ~660 lines of duplicated scaffolding acrossban,kick,timeout,purge_user, andwarn, preserving the existing DM → log → action → reply ordering.expand_file+render_snippet;resolve's eight capture loops become one macro.translate/translate_ephemeraland bothcode_expandcommands share one implementation, differing only in how they defer.analytics::send_*wrappers become onesend_event.log::is_excludedandis_excluded_messagemerge into one function taking an optional pre-fetched config.rotate_color_rolereturnsOption<RoleId>rather than aHashSetthat never held more than one element.Vec, shadowed imports,option_env!for an always-presentCARGO_PKG_VERSION, and a needless clone of message content.PrefixSettype, and update decoding intodecode_removalsandAdditions.