Node page Discord picker: org's servers + voice channels, not raw IDs (#213 item 3) #220
No Reviewers
Labels
Clear labels
area/ai-pipeline
area/auth
area/billing
area/correlation
area/discord
area/frontend
area/governance
area/growth
area/infra-deploy
area/legal
area/map
area/mqtt
area/node-ota
area/osint
area/recording-audio
area/sdr-radio
area/transcription
board
board:agenda
minutes:draft
minutes:final
role:ceo
role:cfo
role:cio
role:ciso
role:cmo
role:coo
role:cto
Scene/entity extraction, summarizer, AI providers, embeddings
AuthN/Z, roles, tenancy/org scoping, API keys, credentials
Plans, entitlements, AI spend accounting and caps
Incident correlation, linking, lifecycle, severity, corr_debug
Discord bot, radio bots, voice streams, bot tokens, webhooks
Web UI: Next.js app and the edge-node local dashboard
Board process, minutes, unattended runner, agent tooling
Go-to-market, outreach, cold email, discovery conversations
CI/CD, VM, registry, Firestore rules/indexes deploy, Terraform/Caddy
ToS, retention, licences/DAAs, CAN-SPAM, E&O, name suppression
Live map: pins, paths, tiles, legend, geocoding
Node-C2 MQTT, checkins, commands, node sweeper, dynsec
Node install, enrollment, OTA updater, image skew
External feeds: cameras, 511, ADS-B, AIS, outages, and their licences
Call capture, boundaries, PulseAudio, ring buffer, trimming, attribution
OP25 decode, SDR hardware/tuning, conventional, second SDR, mesh radio
STT, transcript correction, place verification, name accuracy
Board process: minutes and board-filed items
Needs board scoping at the next sitting; CEO removes the label once scoped
One exec pre-read, closed by CEO
CEO ruling; open until enacted
Filed by the CEO
Filed by the CFO
Filed by the CIO
Filed by the CISO
Filed by the CMO
Filed by the COO
Filed by the CTO
kind
behavior-bug
Wrong product behavior; the instrument reads it correctly
kind
measurement-bug
Corrupts the recording/instrument (debug data, evals, health checks), not behavior
priority
p0
Drop everything: prod broken, live exposure, or owner-ruled P0
priority
p1
Next up: blocks a gate, a customer, or core incident quality
priority
p2
Normal: real defect or planned work, schedule in turn
priority
p3
Low: minor, cosmetic, or someday
status
blocked
Waiting on an external party, spend, or another issue
status
in-progress
Branch or PR open against it
status
needs-decision
Waiting on an owner or board ruling before work
status
needs-info
Root cause or repro unknown; needs a reading first
type
bug
Something built is wrong: code, data, or a measurement
type
chore
Maintenance, refactor, tests, pinning, cleanup: no user-visible change
type
decision
A ruling to make or record: board minutes, owner calls, legal reviews
type
docs
Docs, runbooks, CLAUDE.md, skills, SOPs
type
feature
New capability or an extension of an existing one
type
security
Security, privacy, credential or tenant-isolation exposure
type
tracking
Tracker, checklist, initiative or punch-list spanning several changes
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: logan/server-26#220
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Addresses #213 item 3 and #109 item 13. Neither issue should close on merge, because other items in both are still open. Pairs with #218 (
feat/213-guild-link, #213 item 1): this PR reads theguild_namefield #218 writes and honours its rule that an explicitly unlinked server (unlinked_at) gets no default-org fallback. Merges cleanly with #218 in either order (checked withgit merge-tree).What changed
The node page Join Discord modal no longer takes raw Guild/Voice Channel IDs. It's now a Discord radio panel (layout from
design-canvas/discord-system-mockup.html› Radio channels): the voice channels this node streams into, desired → actual state per row, Stop per row, Stop all, and + Add radio channel, which opens a picker: server → voice channel (grouped by category) → mode (ad-hoc / persistent).c2-core — new
routers/discord_web.pyPUT /discord/guilds/{id}/directory(bot service key only): the server bot pushes each server's name + voice channels from its gateway cache. Merged ontodiscord_guilds; it never touchesorg_id. C2 never calls Discord for the browser, and no token string reaches the browser.GET /discord/nodes/{id}/join-options: the node org's servers (same resolve rule the bot uses), their voice channels with any live stream on them, whether a radio bot can serve each one (with invite links if not, frompick_token), and this node's streams. Readable by anyone in the node's org;can_controlcomes back with it.POST /discord/nodes/{id}/streams: a stream pinned to this node through the #216 desired-state API (start_stream(node_id=…)). It also adds the checks the raw-ID path skipped: the server must belong to the node's org (404 otherwise), the channel must be one the bot reported (400), and the per-server (discord_guild_max_streams) and per-node (discord_node_max_streams) caps apply. Lease refusals return{detail, code, invite}.POST /discord/nodes/{id}/streams/stop: stops one stream on this node, or all of them.owned_node_idslists the node. This is wider than before: the old/nodes/{id}/commandroute was platform-admin only, so an org owner's Join/Leave buttons always failed.routers/nodes.py: the legacy raw-IDdiscord_joinnow refuses a server outside the node's org. Before, a platform admin could stream any org's node into any server.discord bot: a new
DirectorySynccog (app/commands/directory.py). It pushes every server on startup and every 15 minutes, on join/leave/rename, and on voice/category channel create/update/delete (debounced 3s). It sends names only: no members, messages or roles.frontend:
components/NodeDiscordRadio.tsx,lib/discordPicker.ts, and 3c2apimethods.DiscordJoinModaland the Join/Leave buttons are removed. There are no dead CTAs: every button calls one of the routes above, and users who can't control streams see the table without buttons.Verification
~/venvs/drb-5c/bin/python -m pytest -q(drb-c2-core):624 passed, 4 warnings(baseline on main: 608 passed). That includes 16 new tests intests/test_discord_web_picker.pycovering: org scoping, the unlinked fallback and no fallback after an unlink, member read-only, operator limited to the owned node, a directory push that leavesorg_idalone, the directory-only channel rule, the node cap with idempotent re-pick, a lease refusal that returns invite links and no secret, stop scoped to the node, and the legacy raw-ID org guard.tsc --noEmit(Node v20.18.0, TypeScript 5.9.3):tsc exit 0.commands.Botanddirectory_payloadwas smoke-tested on mocked guilds (stage and text channels are excluded). It has not been run against live Discord.Not done / follow-ups
🤖 Generated with Claude Code
- c2-core routers/discord_web.py: PUT /discord/guilds/{id}/directory (service key): the server bot pushes each server's name + voice channels; merged onto discord_guilds, never touches org_id. GET /discord/nodes/{id}/join-options: the node org's servers (same resolve rule as the bot), their voice channels with any live stream, radio-bot readiness + invite links, and this node's streams. No tokens. POST /discord/nodes/{id}/streams: stream pinned to the node; server must be the node org's, channel must be in the bot's directory, guild + node caps. POST /discord/nodes/{id}/streams/stop: one stream on this node, or all. Control = platform admin, org owner, or operator owning the node. - nodes.py: legacy raw-ID discord_join now refuses a server outside the node's org. - discord bot: DirectorySync cog pushes on ready (15-min loop), join/leave, rename, voice/category channel changes (debounced). - frontend: NodeDiscordRadio panel + picker replaces DiscordJoinModal and the admin-only Join/Leave buttons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>- POST /discord/nodes/{id}/streams/stop: stream_id must be guild:channel snowflakes, so a malformed id is a 422 instead of a Firestore path error. - Offline footer said channels resume on reconnect; ad-hoc ones stop once the node is gone past the lease grace (reconcile_once). Say so. - Picker: say why Start is disabled when the node has no system. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Review pass, pushed as
d2437e3:streams/stopnow validatesstream_idasguild:channelsnowflakes (a/in it was a Firestore path error, so a 500). Test added.reconcile_once), so it says that now.Re-verified: c2-core pytest
625 passed, 4 warnings;tsc --noEmitexit 0 (Node 20.18.0, TS 5.9.3).Merge order: the empty-state copy ("link it to your organization") only works for an org owner once #218 (self-serve
/drb link) is in, so merge #218 first or together. Non-atomic caps filed as #223.