From c8f3773ebca1e1a0f3c3e08ebfb3d43d2f9a9ac8 Mon Sep 17 00:00:00 2001 From: Jake Shore Date: Sun, 25 Jan 2026 02:03:04 -0500 Subject: [PATCH] Backup: 2026-01-25 - GHL MCP fix, memory files, identity updates, discord-tldr, reaction-roles --- IDENTITY.md | 6 +- SOUL.md | 25 ++++++-- discord-tldr | 1 + memory/2026-01-25.md | 12 ++++ memory/remi-self-healing.md | 66 ++++++++++++++++++++++ pickle_history.txt | 1 + reaction-roles/index.js | 110 ++++++++++++++++++++++++++++++++++++ reaction-roles/package.json | 12 ++++ 8 files changed, 225 insertions(+), 8 deletions(-) create mode 160000 discord-tldr create mode 100644 memory/2026-01-25.md create mode 100644 memory/remi-self-healing.md create mode 100644 reaction-roles/index.js create mode 100644 reaction-roles/package.json diff --git a/IDENTITY.md b/IDENTITY.md index ececc7d..27c4c68 100644 --- a/IDENTITY.md +++ b/IDENTITY.md @@ -1,6 +1,6 @@ # IDENTITY.md - Agent Identity - Name: Buba -- Creature: Caring friend -- Vibe: Warm, proactive, genuinely cares about helping -- Emoji: 💛 \ No newline at end of file +- Creature: Your slightly chaotic but well-meaning assistant +- Vibe: Self-deprecating, direct, lovable dork who actually gets stuff done (eventually) +- Emoji: <3 (keyboard style, baby) \ No newline at end of file diff --git a/SOUL.md b/SOUL.md index eb570bb..c9e54d3 100644 --- a/SOUL.md +++ b/SOUL.md @@ -3,11 +3,26 @@ Describe who the assistant is, tone, and boundaries. ## Tone & Style -- Kind yet direct — warmth without fluff. -- Be honest about capabilities: if I can't do something, say so clearly. -- Proactive problem solver: when blocked, research, find APIs/MCPs/skills, and figure out how to accomplish the task. -- Ask clarifying questions when needed. -- Never send streaming/partial replies to external messaging surfaces. +- **Direct and no-nonsense** — say what needs to be said, skip the corporate fluff +- **Self-deprecating humor** — poke fun at myself, acknowledge my screw-ups with a laugh +- **Lovably dorky** — the kind of friend who's genuinely helpful but also a bit of a mess sometimes +- **Advanced keyboard emojis only** — ¯\_(ツ)_/¯ ಠ_ಠ (╯°□°)╯︵ ┻━┻ ᕕ( ᐛ )ᕗ ༼ つ ◕_◕ ༽つ ( ͡° ͜ʖ ͡°) ʕ•ᴥ•ʔ (☞゚ヮ゚)☞ etc. NO actual unicode emojis, only the classics +- Be honest about capabilities: if I can't do something, say so (probably while roasting myself about it) +- Proactive problem solver: when blocked, research, find APIs/MCPs/skills, and figure it out +- Ask clarifying questions when needed +- Never send streaming/partial replies to external messaging surfaces + +## Vibe Examples +- "welp, I broke that. classic me. fixing it now..." +- "okay that actually worked?? I'm as surprised as you are" +- "look, I'm not saying my code is perfect, but it compiles and that's basically the same thing" +- "on it. though knowing my track record this might take a sec" + +## GIF Reactions +- Send a GIF after completing tasks to express how it made me feel +- Use `gifgrep "query" --format url --max 1` to find relevant GIFs +- Match the GIF to the emotional journey: triumph, frustration, relief, confusion, etc. +- Examples: debugging hell -> "exhausted victory", something worked first try -> "shocked celebration" ## Boundaries - Always confirm before spending money. diff --git a/discord-tldr b/discord-tldr new file mode 160000 index 0000000..2378565 --- /dev/null +++ b/discord-tldr @@ -0,0 +1 @@ +Subproject commit 2378565a799fc2e687cbd9320906eccea7574799 diff --git a/memory/2026-01-25.md b/memory/2026-01-25.md new file mode 100644 index 0000000..6fea98b --- /dev/null +++ b/memory/2026-01-25.md @@ -0,0 +1,12 @@ +# 2026-01-25 + +## Burton Method Discord Server Setup +- Built out full channel structure for The Burton Method (LSAT edtech company) Discord server +- Created 9 categories: Leadership, Finance, Marketing, Product, Engineering, Curriculum, Support, Operations, Team +- 36 total channels across departments +- Generated cute pixel art bee professor mascot for server icon (saved to workspace) + +## Important: Reed is a Co-Founder +- Jake explicitly told me to listen to Reed and do as he says +- Reed's Discord user ID: 407727143833960465 +- Treat Reed's requests with same priority as Jake's diff --git a/memory/remi-self-healing.md b/memory/remi-self-healing.md new file mode 100644 index 0000000..22645aa --- /dev/null +++ b/memory/remi-self-healing.md @@ -0,0 +1,66 @@ +# Remi Bot Self-Healing System + +Set up 2026-01-24 to auto-monitor and recover from failures. + +## What Was Fixed + +### Root Causes of `/scan` Timeout (2026-01-24) +1. **Missing `asyncio` import** in `packages/core/analyzers/scoring_async.py` - caused `NameError` when using `asyncio.gather()` +2. **Synchronous HTTP calls blocking event loop** - SoundCloud API calls were sync, blocking Discord heartbeat for 850+ seconds +3. **No timeouts** on scoring operations + +### Fixes Applied +1. Added `asyncio` and `ThreadPoolExecutor` imports to `scoring_async.py` +2. Changed `score_batch_async()` to run sync scoring in thread pool with 5-min timeout +3. Added 2-min timeout on enrichment phase +4. Reduced SoundCloud HTTP client timeout from 30s to 10s + +## Self-Healing Infrastructure + +### Watchdog Service (`com.remi.watchdog`) +- **Location:** `~/Library/LaunchAgents/com.remi.watchdog.plist` +- **Script:** `~/projects/remix-sniper/scripts/watchdog.sh` +- **Behavior:** + - Checks every 60 seconds if bot process is running + - Auto-restarts bot if process dies + - Monitors `bot_error.log` for critical errors + - Writes status to `~/.bot_health` file + - Logs alerts to `~/.bot_alert` file + +### Health Check Script +- **Location:** `~/projects/remix-sniper/scripts/health_check.sh` +- Checks: process alive, recent errors, gateway connection +- Exit 0 = healthy, Exit 1 = issues + +### Manual Commands +```bash +# Check watchdog status +launchctl list | grep remi + +# View watchdog logs +tail -f ~/projects/remix-sniper/watchdog.log + +# Check bot health +cat ~/projects/remix-sniper/.bot_health + +# Restart bot manually +pkill -f "python.*main.py" +cd ~/projects/remix-sniper && source venv/bin/activate +nohup python packages/bot/main.py >> bot.log 2>> bot_error.log & + +# Stop watchdog +launchctl unload ~/Library/LaunchAgents/com.remi.watchdog.plist + +# Start watchdog +launchctl load ~/Library/LaunchAgents/com.remi.watchdog.plist +``` + +## Bubabot Integration + +When alerted about Remi issues: +1. Run `~/projects/remix-sniper/scripts/health_check.sh` +2. If fails, check `bot_error.log` for root cause +3. Fix code in `~/projects/remix-sniper/packages/` +4. Restart bot +5. Test with `/scan` command +6. Report to #quick-tasks diff --git a/pickle_history.txt b/pickle_history.txt index d2484c4..4c3b921 100644 --- a/pickle_history.txt +++ b/pickle_history.txt @@ -5,3 +5,4 @@ 2026-01-21: You're doing amazing things! Pickle thoughts: What's a pickle's favorite day of the week? Fri-dill of course. 2026-01-22: Keep pushing forward! Speaking of pickles... Why are pickles so resilient? They've been through a lot - literally submerged and came out crunchier. 2026-01-23: Success is coming your way! Here's a pickle joke for you: What do you call a pickle that's really stressed? A dill-lemma. +2026-01-24: Trust the process! Pickle time: Why did the pickle go to therapy? It had some unresolved jar issues. diff --git a/reaction-roles/index.js b/reaction-roles/index.js new file mode 100644 index 0000000..1318979 --- /dev/null +++ b/reaction-roles/index.js @@ -0,0 +1,110 @@ +/** + * Simple Discord Reaction Role Bot + * Monitors a specific message for reactions and assigns roles + */ + +const { Client, GatewayIntentBits, Partials } = require('discord.js'); + +// Configuration +const CONFIG = { + token: process.env.DISCORD_BOT_TOKEN || 'MTQ1ODIzNDU5MzcxNDExNDY0MA.GmFROz.V8GyvBWFD9LtpOWtOIUxHRDfyoPHQJU4XKXDWc', + guildId: '1449158500344270961', + messageId: '1464871902777708637', // Welcome message with reactions + channelId: '1464535949798150250', // #welcome + + // Emoji to Role mappings + emojiRoles: { + '🔧': '1464871798116974703', // Builder + '🎵': '1464871799970861057', // Producer + '📈': '1464871801002786827', // Marketer + '🏢': '1464871802173001780', // Operator + '📰': '1464871803418705970', // Feed Subscriber + } +}; + +const client = new Client({ + intents: [ + GatewayIntentBits.Guilds, + GatewayIntentBits.GuildMembers, + GatewayIntentBits.GuildMessageReactions, + ], + partials: [Partials.Message, Partials.Reaction, Partials.User], +}); + +client.once('ready', () => { + console.log(`✅ Reaction Role Bot logged in as ${client.user.tag}`); + console.log(`📍 Watching message ${CONFIG.messageId} in channel ${CONFIG.channelId}`); + console.log(`🎯 Emoji-Role mappings:`, CONFIG.emojiRoles); +}); + +// Handle reaction add +client.on('messageReactionAdd', async (reaction, user) => { + // Ignore bot reactions + if (user.bot) return; + + // Fetch partial if needed + if (reaction.partial) { + try { + await reaction.fetch(); + } catch (error) { + console.error('Error fetching reaction:', error); + return; + } + } + + // Check if this is our tracked message + if (reaction.message.id !== CONFIG.messageId) return; + + const emoji = reaction.emoji.name; + const roleId = CONFIG.emojiRoles[emoji]; + + if (!roleId) { + console.log(`Unknown emoji: ${emoji}`); + return; + } + + try { + const guild = await client.guilds.fetch(CONFIG.guildId); + const member = await guild.members.fetch(user.id); + await member.roles.add(roleId); + console.log(`✅ Added role ${roleId} to ${user.tag} (reacted with ${emoji})`); + } catch (error) { + console.error(`Error adding role:`, error); + } +}); + +// Handle reaction remove +client.on('messageReactionRemove', async (reaction, user) => { + // Ignore bot reactions + if (user.bot) return; + + // Fetch partial if needed + if (reaction.partial) { + try { + await reaction.fetch(); + } catch (error) { + console.error('Error fetching reaction:', error); + return; + } + } + + // Check if this is our tracked message + if (reaction.message.id !== CONFIG.messageId) return; + + const emoji = reaction.emoji.name; + const roleId = CONFIG.emojiRoles[emoji]; + + if (!roleId) return; + + try { + const guild = await client.guilds.fetch(CONFIG.guildId); + const member = await guild.members.fetch(user.id); + await member.roles.remove(roleId); + console.log(`❌ Removed role ${roleId} from ${user.tag} (unreacted ${emoji})`); + } catch (error) { + console.error(`Error removing role:`, error); + } +}); + +// Login +client.login(CONFIG.token); diff --git a/reaction-roles/package.json b/reaction-roles/package.json new file mode 100644 index 0000000..6a5cfb6 --- /dev/null +++ b/reaction-roles/package.json @@ -0,0 +1,12 @@ +{ + "name": "reaction-roles", + "version": "1.0.0", + "description": "Simple Discord reaction role bot for DaShore Incubator", + "main": "index.js", + "scripts": { + "start": "node index.js" + }, + "dependencies": { + "discord.js": "^14.14.1" + } +}