Multi-Server Error Routing

N servers, N pushover apps, N discord bots — 1 proxy, 1 CEO

1

The Problem — Which Error Belongs to Which Bot?

      graph LR
        subgraph SERVERS["Multiple Servers"]
          S1["Server A\n(payments)"]:::s1
          S2["Server B\n(api)"]:::s2
          S3["Server C\n(scraper)"]:::s3
          S4["Server D\n(database)"]:::s4
        end

        subgraph PUSHOVER["Pushover Apps"]
          P1["payments-monitor\ntoken: a7yj..."]:::s1
          P2["api-monitor\ntoken: b8zk..."]:::s2
          P3["scraper-alert\ntoken: c9xl..."]:::s3
          P4["db-monitor\ntoken: d0ym..."]:::s4
        end

        S1 --> P1
        S2 --> P2
        S3 --> P3
        S4 --> P4

        P1 --> PROXY["Notification\nProxy"]:::proxy
        P2 --> PROXY
        P3 --> PROXY
        P4 --> PROXY

        PROXY -->|"token lookup"| Q{"Which server?\nWhich bot?"}:::decision

        classDef s1 fill:#2e1818,stroke:#f04747,color:#f8a0a0
        classDef s2 fill:#1e1b4b,stroke:#5865F2,color:#c4b5fd
        classDef s3 fill:#2e2618,stroke:#faa61a,color:#fdd87a
        classDef s4 fill:#1b2040,stroke:#b48efa,color:#d4bfff
        classDef proxy fill:#2e2618,stroke:#faa61a,color:#fdd87a,stroke-width:2px
        classDef decision fill:#1b2e2e,stroke:#00d4aa,color:#a0f0dd
    
Every Pushover app has a unique token — the proxy uses it to identify the source
2

The Answer — Token-to-Bot Mapping

proxy config — apps.json
{ // Each Pushover app token maps to a server + Discord bot "apps": { "a7yjfzk...": { "name": "payments-monitor", "server": "tamil-prod-01", "bot": "Tamil_Transloader", "color": "#f04747" // embed color }, "b8zkgal...": { "name": "api-monitor", "server": "staging-02", "bot": "Staging_Bot", "color": "#5865F2" }, "c9xlham...": { "name": "scraper-alert", "server": "scraper-03", "bot": "Scraper_Bot", "color": "#faa61a" }, "d0ymbnr...": { "name": "db-monitor", "server": "db-primary", "bot": "Database_Bot", "color": "#b48efa" } } }
When proxy receives token=a7yjfzk... it knows: server=tamil-prod-01, bot=Tamil_Transloader
3

Full Routing Flow

      graph TD
        ERR["Error: PHP crash on tamil-prod-01\ntoken=a7yjfzk..."]:::error

        ERR --> PROXY["Notification Proxy\nreceives Pushover payload"]:::proxy

        PROXY --> LOOKUP["Lookup token in apps.json"]:::proxy
        LOOKUP --> FOUND["Match: tamil-prod-01\nBot: Tamil_Transloader"]:::match

        FOUND --> PUSH["Forward to Pushover API\n(phone buzzes)"]:::pushover
        FOUND --> DISC["Post to Discord #errors\n(rich embed with server + bot tag)"]:::discord

        DISC --> CEO["CEO Bot reads embed"]:::ceo
        CEO --> ROUTE{"Embed says:\nServer: tamil-prod-01\nBot: Tamil_Transloader"}:::decision

        ROUTE --> MENTION["CEO: @Tamil_Transloader\ndiagnose this error"]:::ceo
        MENTION --> TAMIL["Tamil investigates\non its server"]:::tamil
        TAMIL --> REPORT["Tamil: @CLAUDE_CEO\nhere's what I found"]:::tamil
        REPORT --> FIX["CEO posts suggested fix\nin #errors"]:::fix

        classDef error fill:#2e1818,stroke:#f04747,color:#f8a0a0,stroke-width:2px
        classDef proxy fill:#2e2618,stroke:#faa61a,color:#fdd87a
        classDef match fill:#1b2e2e,stroke:#00d4aa,color:#a0f0dd
        classDef pushover fill:#0d2440,stroke:#2e9afe,color:#8ecaff
        classDef discord fill:#1e1b4b,stroke:#5865F2,color:#c4b5fd
        classDef ceo fill:#1e1b4b,stroke:#5865F2,color:#c4b5fd,stroke-width:2px
        classDef decision fill:#2e2618,stroke:#faa61a,color:#fdd87a
        classDef tamil fill:#1b2e2e,stroke:#00d4aa,color:#a0f0dd
        classDef fix fill:#1b2e1e,stroke:#43b581,color:#a3d9b1,stroke-width:2px
    
Token identifies the source → embed tags the bot → CEO knows who to @mention
4

Server + Bot Registry

tamil-prod-01
Production server — payments, webhooks, PHP apps
@Tamil_Transloader
  • payments-monitor
  • webhook-alert
  • cron-monitor
staging-02
Staging environment — API, testing
@Staging_Bot
  • api-monitor
  • deploy-alert
scraper-03
Web scraping, data collection
@Scraper_Bot
  • scraper-alert
  • proxy-monitor
db-primary
Database cluster — MySQL, Redis
@Database_Bot
  • db-monitor
  • replication-alert
  • backup-monitor
5

What CEO Sees in #errors

The proxy builds a rich embed that tells CEO everything it needs to route the error:

CRITICAL — payments-webhook.php
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused
in /var/www/payments/webhook.php on line 142
Server
tamil-prod-01
Assigned Bot
@Tamil_Transloader
Priority
High
CEO reads the embed and knows:
Server: tamil-prod-01 → Bot: @Tamil_Transloader → Action: "@Tamil_Transloader diagnose this"
6

CEO's Routing Table (in CLAUDE.md)

CEO CLAUDE.md — Error Routing
## Error Triage — #errors Channel When an error appears in #errors, read the embed fields: - "Server" tells you which machine has the problem - "Assigned Bot" tells you which bot to @mention for investigation ### Bot Registry tamil-prod-01@Tamil_Transloader # payments, PHP apps, webhooks staging-02@Staging_Bot # API, testing environment scraper-03@Scraper_Bot # web scraping, data collection db-primary@Database_Bot # MySQL, Redis, backups ### Triage Flow 1. Read error embed 2. @mention the Assigned Bot: "diagnose [error details]" 3. Wait for bot's findings 4. Analyze + suggest fix in #errors 5. If critical: also notify human owner
7

Example — Errors From 3 Different Servers

      graph TD
        E1["Error: PHP crash\ntoken: a7yj..."]:::s1
        E2["Error: API 500\ntoken: b8zk..."]:::s2
        E3["Error: Replication lag\ntoken: d0ym..."]:::s4

        E1 --> PROXY["Proxy"]:::proxy
        E2 --> PROXY
        E3 --> PROXY

        PROXY --> CH["#errors channel"]:::discord

        CH --> CEO["CEO Bot"]:::ceo

        CEO -->|"embed says: tamil-prod-01"| T["@Tamil_Transloader\ndiagnose PHP crash"]:::s1
        CEO -->|"embed says: staging-02"| S["@Staging_Bot\ndiagnose API 500"]:::s2
        CEO -->|"embed says: db-primary"| D["@Database_Bot\ndiagnose replication lag"]:::s4

        T -->|"findings"| CEO
        S -->|"findings"| CEO
        D -->|"findings"| CEO

        CEO --> FIX["CEO posts 3 fixes\nin #errors"]:::fix

        classDef s1 fill:#2e1818,stroke:#f04747,color:#f8a0a0
        classDef s2 fill:#1e1b4b,stroke:#5865F2,color:#c4b5fd
        classDef s4 fill:#1b2040,stroke:#b48efa,color:#d4bfff
        classDef proxy fill:#2e2618,stroke:#faa61a,color:#fdd87a,stroke-width:2px
        classDef discord fill:#1e1b4b,stroke:#5865F2,color:#c4b5fd
        classDef ceo fill:#1e1b4b,stroke:#5865F2,color:#c4b5fd,stroke-width:3px
        classDef fix fill:#1b2e1e,stroke:#43b581,color:#a3d9b1,stroke-width:2px
    
3 errors from 3 servers → CEO routes each to the correct bot → 3 investigations → 3 fixes
8

Adding a New Server — 2 Steps

Step 1: Proxy Config
Add the new Pushover app token to apps.json with the server name and bot name.
"e1zncore...": { "name": "new-app", "server": "new-server-05", "bot": "New_Bot" }
Step 2: CEO CLAUDE.md
Add the new server → bot mapping to CEO's routing table.
new-server-05@New_Bot
That's it. Proxy routes errors, CEO knows who to ask.
tamil-prod-01
staging-02
scraper-03
db-primary
Proxy
Fix
Scaling is trivial. New server? Add its Pushover token to apps.json and a line to CEO's CLAUDE.md. New Pushover app on an existing server? Just add the token pointing to the same server + bot. The proxy doesn't care how many servers or apps you have — it's just a lookup table.