feat(scripts): seed v2 helpers and realistic-day scenario#1108
Open
NC1107 wants to merge 1 commit into
Open
Conversation
Adds a sourceable bash library (scripts/seed_v2_lib.sh) plus two scenario scripts that drive only the public REST + WS API: - seed_realistic_day.sh — 6 users, plaintext + encrypted groups, pairwise DMs, and a standup-to-EOD message rhythm with branching reply threads instead of chained replies-to-parent. - seed_dms_only.sh — DM-focused fixture, no groups. Usernames are timestamped so reruns don't collide. Existing seeders (seed_demo_data, seed_full_demo, seed_stress_data) are unchanged.
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
Adds a seed-v2 library and two scenario scripts that exercise gaps the existing seeders miss. The existing
seed_demo_data.sh,seed_full_demo.sh, andseed_stress_data.share unchanged.What ships
scripts/seed_v2_lib.sh— sourceable helpers, REST + WS only (no DB access). Functions:seed_user,seed_login,seed_contact_accept,seed_group(withis_encryptedtoggle),seed_group_invite_accept,seed_dm_message,seed_group_message(withreply_to_id),seed_reaction,seed_set_presence,weighted_choice,random_message_text,backdate_seconds,seed_log. Cloudflare-safe UA,set -euo pipefail, error trap that prints the failing line.scripts/seed_realistic_day.sh— 6 users with varied bios/presence, all-to-all contacts, one plaintext + one encrypted group (is_encrypted=true), all members join both, pairwise DMs (4-10 msgs each), and a realistic-day group rhythm: 08:00 standup, 09:30 async chat with branching reply threads (replies hit several different parents instead of all chaining to the first message), 12:00 lunch lull, 14:00 decision thread with 4 replies, 17:30 EOD. Plus ~15 reactions sprinkled across group messages.scripts/seed_dms_only.sh— minimal pure-DM fixture: 4 users, 6 pairwise DM threads of 8-15 messages each. No groups.CLAUDE.md's Build & Run section so the scripts are discoverable.Scenarios covered
is_encrypted=trueso the[Encrypted]placeholder + lock indicator render. Posts ~120-char random-base64 strings as ciphertext placeholders since the Signal Protocol can't be driven from bash (file comment explains this).online,away,dnd,invisible(the server enum has no literaloffline; the lib mapsoffline → invisible).riley_1716345678).Gaps remaining
created_at— the server stampsmessages.created_atitself; the lib'sbackdate_secondsis annotation-only. Truly historical history needs DB access.PUT /api/conversations/:id/disappearing) but no scenario uses it yet. Easy follow-up.The motivator was an audit of what the current seeders don't exercise — the gaps above are documented inline in the lib so the next pass knows where to extend.
Test plan
cargo run -p echo-serverthenSEED_SERVER=http://localhost:8080 ./scripts/seed_realistic_day.sh— verify 6 users land in the sidebar with varied presence dots, plaintext group has the standup/async/decision/EOD rhythm, encrypted group shows the lock indicator +[Encrypted]placeholders../scripts/seed_dms_only.sh— verify 4 users, 6 DM threads, no groups.bash -non all three scripts passes (verified pre-merge)../scripts/seed_demo_data.sh.