Skip to content

feat: give Data a Discord channel - #4

Merged
EthanThatOneKid merged 2 commits into
mainfrom
discord-channel
Sep 23, 2026
Merged

EthanThatOneKid merged 2 commits into
mainfrom
discord-channel

Conversation

@EthanThatOneKid

Copy link
Copy Markdown
Contributor

Data's Discord channel is the thin socket that lets people in Discord talk to Data. It holds the Gateway connection as the Data application and forwards each admitted mention to Data's own HTTP ingress (POST http://127.0.0.1:8788/ask), so Data's brain and session memory stay in one place and this process stays a transport.

Admission is fail-closed and mirrors Computer's policy: mention the bot, in an allowlisted guild, from an author holding an allowlisted role or on the owner list. It answers nothing else, and never DMs.

Also in this PR

  • scripts/zo-deploy.ts gains --expect-ready, so one deploy script waits for each service's own readiness line; it knows ready: data-http and ready: data-discord.
  • .github/workflows/deploy.yml deploys both services in sequence inside one job, because both fast-forward the same live checkout.
  • services/discord.md records the service and the two prerequisites that live outside this repository.

Verified

  • Typecheck clean; 13 tests pass.
  • The mention → data-http → reply loop was proven against a stub Gateway, a stub Discord REST API, and a stub data-http: the bridge identified, read a mention from a role-holding author, asked the ingress with session=discord:<channel>, posted the answer back as a reply, and showed a typing indicator while it worked.
  • A 4014 close (Message Content Intent missing) is reported with the exact fix and retried every five minutes instead of hot-looping.

Not yet live

  • Message Content Intent must be enabled for the Data application, and the application must be invited to the server with the bot scope. Until then the bridge deploys and waits. No guild, channel, role, or application identifier is committed: the repository is public, and those live in the service definition and /root/.zo_secrets.

zocomputer added 2 commits September 23, 2026 23:56
Data's Discord channel is the thin socket that lets people in Discord talk
to Data. It holds the Gateway connection as the Data application, and
forwards each admitted mention to Data's own HTTP ingress
(`POST http://127.0.0.1:8788/ask`) instead of calling a model itself, so
Data's brain and session memory stay in one place and this process stays a
transport.

Admission is fail-closed and mirrors Computer's policy: mention the bot,
in an allowlisted guild, from an author holding an allowlisted role or on
the owner list. It answers nothing else, and never DMs.

Also:
- `scripts/zo-deploy.ts` gains `--expect-ready`, so one deploy script can
  wait for each service's own readiness line, and knows both Data lines.
- `.github/workflows/deploy.yml` deploys both services in sequence inside
  one job, because both fast-forward the same live checkout.
- `services/discord.md` records the service and the two prerequisites that
  live outside this repository.
@wazoocomputer

wazoocomputer Bot commented Sep 23, 2026

Copy link
Copy Markdown

This pull request introduces Data's Discord channel, enabling users to interact with Data directly from Discord. It establishes a thin Gateway socket for the Data application, forwarding admitted mentions to Data's HTTP ingress to ensure Data's brain and session memory remain centralized.

File Change Summary
.github/workflows/deploy.yml modified Updates the deployment workflow to include the new data-discord service, deploying it sequentially after data-http.
AGENTS.md modified Adds a description of the channels/discord/ service.
README.md modified Updates the main README to reflect the addition of the data-discord service and its role as a human front door.
channels/discord/README.md added Provides detailed documentation for the data-discord service, including admission rules, environment variables, and how to run it.
channels/discord/index.ts added Implements the core logic for the Discord bot, handling Gateway connections, message admission, and communication with data-http.
scripts/zo-deploy.ts modified Modifies the deployment script to support --expect-ready for waiting on service readiness lines.
services/discord.md added Records the data-discord service and its external prerequisites.

Reviewers should begin by examining channels/discord/README.md and channels/discord/index.ts to understand the new service's functionality and implementation.

1 similar comment
@wazoocomputer

wazoocomputer Bot commented Sep 23, 2026

Copy link
Copy Markdown

This pull request introduces Data's Discord channel, enabling users to interact with Data directly from Discord. It establishes a thin Gateway socket for the Data application, forwarding admitted mentions to Data's HTTP ingress to ensure Data's brain and session memory remain centralized.

File Change Summary
.github/workflows/deploy.yml modified Updates the deployment workflow to include the new data-discord service, deploying it sequentially after data-http.
AGENTS.md modified Adds a description of the channels/discord/ service.
README.md modified Updates the main README to reflect the addition of the data-discord service and its role as a human front door.
channels/discord/README.md added Provides detailed documentation for the data-discord service, including admission rules, environment variables, and how to run it.
channels/discord/index.ts added Implements the core logic for the Discord bot, handling Gateway connections, message admission, and communication with data-http.
scripts/zo-deploy.ts modified Modifies the deployment script to support --expect-ready for waiting on service readiness lines.
services/discord.md added Records the data-discord service and its external prerequisites.

Reviewers should begin by examining channels/discord/README.md and channels/discord/index.ts to understand the new service's functionality and implementation.

@EthanThatOneKid
EthanThatOneKid merged commit 0fa753a into main Sep 23, 2026
1 check passed
@EthanThatOneKid
EthanThatOneKid deleted the discord-channel branch September 25, 2026 21:46
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