Skip to content

Drifting ship scores, unknown-action quips, and help wisdom - #7

Merged
CommunityPoke merged 1 commit into
mainfrom
devin/ship-drift-quips-help
Oct 18, 2026
Merged

CommunityPoke merged 1 commit into
mainfrom
devin/ship-drift-quips-help

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Three changes, all in the fun-command surface:

  1. ship now drifts instead of being pinned. The old percentage was md5(f"{lo}:{hi}") % 101 — fixed forever. New ship_score(user_a, user_b, now, message_count) in matrimony/ship.py is 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 by ChannelActivity, a small bounded in-memory window of per-channel message timestamps updated in on_message for human and bot authors (our own replies included — it's chatter too). GIF behaviour unchanged.

  2. Unknown actions get a quip. !matr blorp now replies with a rotating funny quip plus the help embed instead of silently showing help. With invoke_without_command=True the group's callback runs for unknown triggers with leftover text in ctx.view, which is how we tell !matr blorp from bare !matr; the CommandNotFound branch uses the same quips. Never fires on valid commands or on the bot's own messages.

  3. Help embed gains "Marital wisdom". !matr help and bare !matr now 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 . — clean

Not 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

- 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>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@CommunityPoke
CommunityPoke merged commit f602b96 into main Oct 18, 2026
2 checks passed
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