Repository navigation
Drifting ship scores, unknown-action quips, and help wisdom - #7
Merged
Merged
Conversation
- ship: replace the fixed MD5 percentage with a pure, deterministic score that drifts smoothly over ~24h and is nudged by the rolling 10-minute per-channel message count (new matrimony/ship.py + ChannelActivity fed from on_message, bot and human authors alike) - !matr <unknown action> now replies with a rotating quip plus the help embed instead of silence (group callback + CommandNotFound paths) - !matr help / bare !matr gain a long 'Marital wisdom' quip section at the bottom of the embed (still under Discord's 4096-char limit) - tests: 26 new cases covering determinism, bucket stability, smooth drift, count nudge, clamping, window pruning, unknown vs known subcommands, and embed length Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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.
Summary
Three changes, all in the fun-command surface:
shipnow drifts instead of being pinned. The old percentage wasmd5(f"{lo}:{hi}") % 101— fixed forever. Newship_score(user_a, user_b, now, message_count)inmatrimony/ship.pyis pure and deterministic for a given 5-minute bucket: a per-pair anchor plus a slow sinusoid (~24h period, per-pair phase/amplitude) that moves the score smoothly (≤1 point between buckets), plus a small nudge (±10) from the rolling count of messages in the channel over the last 10 minutes. Clamped to 0–100. The nudge is fed byChannelActivity, a small bounded in-memory window of per-channel message timestamps updated inon_messagefor human and bot authors (our own replies included — it's chatter too). GIF behaviour unchanged.Unknown actions get a quip.
!matr blorpnow replies with a rotating funny quip plus the help embed instead of silently showing help. Withinvoke_without_command=Truethe group's callback runs for unknown triggers with leftover text inctx.view, which is how we tell!matr blorpfrom bare!matr; theCommandNotFoundbranch uses the same quips. Never fires on valid commands or on the bot's own messages.Help embed gains "Marital wisdom".
!matr helpand bare!matrnow end with 30 quips (memes, Discord culture, programming, relationship jokes) below the unchanged command listing. Total description: 2679 chars, under Discord's 4096 limit (guarded by a test).Testing
python -m pytest tests— 140 passed (26 new: determinism, per-bucket stability, smooth drift, count nudge, clamp at both ends, window pruning/bounding, unknown vs known subcommands, self-message guard, embed length)ruff check .— cleanNot verified against a live Discord token; behaviour exercised end-to-end through the real command parser in tests.
Link to Devin session: https://app.devin.ai/sessions/a4c0cf3d1f3e49e2b4d8132f39974696
Open in Devin Desktop: https://app.devin.ai/desktop/session/a4c0cf3d1f3e49e2b4d8132f39974696?variant=devin
Requested by: @CommunityPoke