Discord Bot Foundation #231

Closed
opened 2026-07-15 11:34:17 +00:00 by Mark · 7 comments
Owner

Phase 1: Discord Bot Foundation

Goal: Get a Discord bot process running alongside the mesh stack, with token management, connection lifecycle, and presence/heartbeat.

Approach candidates:

  • Standalone Python process using discord.py library, managed as a container alongside existing docker services
  • Integration into the existing docker/api_gateway.py Flask process as a background thread (simpler deployment, coupling risk)
  • Separate CLI entrypoint (cli/commands/discord_bot.py) that can run as a sidecar

Outputs:

  • docker/discord_bot.py — Discord client process with startup/shutdown lifecycle
  • config/discord.yaml — Discord token config (loaded from env, not committed)
  • Token loading via existing secrets management (substrate/secrets_manager.py)
  • Docker Compose integration (docker/docker-compose.yml) — optional sidecar or managed process
  • Health check endpoint exposed for monitoring

Acceptance criteria:

  • Bot authenticates with Discord and stays connected (reconnects on disconnect)
  • Token loaded from secure env/config, never hardcoded
  • Bot presence shows "online" with appropriate activity status
  • Container/service starts/stops cleanly with the mesh stack
  • Health endpoint reports bot connection state
  • Graceful shutdown on SIGTERM

Files touched: docker/discord_bot.py, config/discord.yaml (create), docker/docker-compose.yml (amend), substrate/secrets_manager.py (possibly extend for Discord token)



Decomposed from mesh-seed#134

## Phase 1: Discord Bot Foundation **Goal:** Get a Discord bot process running alongside the mesh stack, with token management, connection lifecycle, and presence/heartbeat. **Approach candidates:** - Standalone Python process using `discord.py` library, managed as a container alongside existing docker services - Integration into the existing `docker/api_gateway.py` Flask process as a background thread (simpler deployment, coupling risk) - Separate CLI entrypoint (`cli/commands/discord_bot.py`) that can run as a sidecar **Outputs:** - `docker/discord_bot.py` — Discord client process with startup/shutdown lifecycle - `config/discord.yaml` — Discord token config (loaded from env, not committed) - Token loading via existing secrets management (`substrate/secrets_manager.py`) - Docker Compose integration (`docker/docker-compose.yml`) — optional sidecar or managed process - Health check endpoint exposed for monitoring **Acceptance criteria:** - [ ] Bot authenticates with Discord and stays connected (reconnects on disconnect) - [ ] Token loaded from secure env/config, never hardcoded - [ ] Bot presence shows "online" with appropriate activity status - [ ] Container/service starts/stops cleanly with the mesh stack - [ ] Health endpoint reports bot connection state - [ ] Graceful shutdown on SIGTERM **Files touched:** `docker/discord_bot.py`, `config/discord.yaml` (create), `docker/docker-compose.yml` (amend), `substrate/secrets_manager.py` (possibly extend for Discord token) --- --- _Decomposed from [mesh-seed#134](https://forgejo.tail018ac4.ts.net/Mark/mesh-seed/issues/134)_
Author
Owner

QA FAILED — false-positive close from reconciliation sweep.

This issue was auto-closed at 2026-08-04T04:34:54Z during the same reconciliation sweep that closed multiple unrelated issues (mesh-seed#252, docker_backup#20, etc.) at 04:34:54Z–04:34:58Z without verifying fixes. The close event has no associated commit or PR.

Verification against origin/master at 92521ce:

  • docker/discord_bot.py — does not exist
  • config/discord.yaml — does not exist
  • docker/docker-compose.yml amendment for Discord sidecar — does not exist
  • No commit on origin/master references #231 or "discord bot"
  • The most recent bot-related commits on master (80f711b, 02b8488) were both reverted in 4f66d30

Phase 1 acceptance criteria are unmet: no bot process, no token management, no presence/heartbeat, no health endpoint. Reopening to clear the false-positive and restart the implementation pipeline.

This run was performed by kanban reconcile → QA pipeline after the kanban fixit board marked the issue done. The actual fix never landed.

**QA FAILED — false-positive close from reconciliation sweep.** This issue was auto-closed at `2026-08-04T04:34:54Z` during the same reconciliation sweep that closed multiple unrelated issues (mesh-seed#252, docker_backup#20, etc.) at `04:34:54Z–04:34:58Z` without verifying fixes. The close event has no associated commit or PR. Verification against origin/master at `92521ce`: - `docker/discord_bot.py` — does not exist - `config/discord.yaml` — does not exist - `docker/docker-compose.yml` amendment for Discord sidecar — does not exist - No commit on origin/master references #231 or "discord bot" - The most recent bot-related commits on master (`80f711b`, `02b8488`) were both reverted in `4f66d30` Phase 1 acceptance criteria are unmet: no bot process, no token management, no presence/heartbeat, no health endpoint. **Reopening to clear the false-positive and restart the implementation pipeline.** This run was performed by `kanban reconcile → QA pipeline` after the kanban fixit board marked the issue done. The actual fix never landed.
Mark closed this issue 2026-08-04 14:30:20 +00:00
Author
Owner

QA FAILED — second false-positive close of #231.

This issue was closed for a second time at 2026-08-04T14:30:20Z (event #50153) after I had reopened it earlier today at 08:10:56Z (event #50026) with full evidence that the fix never landed. The state remains "closed" even though no implementation has been delivered.

Independent verification at 2026-08-04T (post-second-close):

Master HEAD: 92521ce9 "fix #250: authenticate idempotency tests via /v1/auth/login" (2026-07-30 21:58:25 -0700). No commits have landed on origin/master since 2026-07-31, and the latest commit on every branch/tag/remotes is the same 92521ce9.

Files specified in the Phase 1 acceptance criteria:

  • docker/discord_bot.py — does not exist
  • config/discord.yaml — does not exist
  • substrate/secrets_manager.py — does not exist (note: the issue references this file as if it exists; no such module is in the repo)
  • docker/docker-compose.yml — last touched by 686827e "fix #148: MON-005 — Centralized Logging (Loki + structured JSON)" on 2026-07-13; no Discord sidecar amendments.

Repo-wide grep for discord in HEAD: 5 hits, all in docs/specs (API.md, ROADMAP.md, docs/archive/DAY0_TECH_STACK.md, docs/archive/IMMEDIATE_INTEGRATION.md, docs/archive/NODE0_UNSTRUCTURED.md, specs/intent-ingestion-protocol.md). Zero source-code references.

PR search across all open/closed PRs in Mark/mesh-seed: 3 PRs total (#265 open, #243/#242 closed), none reference Discord or #231.

The only Discord/bot-related commits in the entire repo are 02b8488 and 80f711b, both reverted in 4f66d30 "Revert 'chore: commit unrelated chat/bots work (mesh-seed#6.6) to clear pre-dispatch gate'" on 2026-07-30.

Phase 1 acceptance criteria — all six unmet:

  • Bot authenticates with Discord and stays connected — no bot code exists
  • Token loaded from secure env/config — no token management exists
  • Bot presence shows "online" — no bot exists
  • Container/service starts/stops cleanly — no Discord service in docker-compose.yml
  • Health endpoint reports bot connection state — no health endpoint exists
  • Graceful shutdown on SIGTERM — no bot process exists

Action: Reopening to clear this second false-positive close. The implementation pipeline needs to actually run #231 through the triage/fixer chain — closing the issue without delivering the code is not a fix.

This matches the documented false-positive close pattern from earlier today (#252, docker_backup#20, easystitch#109, nodedesk#38, org_mode#17, mesh-seed#245/#253/#256/#257) where the reconciliation sweep closed multiple issues without verifying fixes. Issue #231 was caught in that sweep twice and continues to be incorrectly closed.

**QA FAILED — second false-positive close of #231.** This issue was closed for a second time at `2026-08-04T14:30:20Z` (event #50153) after I had reopened it earlier today at `08:10:56Z` (event #50026) with full evidence that the fix never landed. The state remains "closed" even though no implementation has been delivered. **Independent verification at `2026-08-04T` (post-second-close):** Master HEAD: `92521ce9` "fix #250: authenticate idempotency tests via /v1/auth/login" (2026-07-30 21:58:25 -0700). No commits have landed on `origin/master` since 2026-07-31, and the latest commit on every branch/tag/remotes is the same `92521ce9`. Files specified in the Phase 1 acceptance criteria: - `docker/discord_bot.py` — **does not exist** - `config/discord.yaml` — **does not exist** - `substrate/secrets_manager.py` — **does not exist** (note: the issue references this file as if it exists; no such module is in the repo) - `docker/docker-compose.yml` — last touched by `686827e` "fix #148: MON-005 — Centralized Logging (Loki + structured JSON)" on 2026-07-13; no Discord sidecar amendments. Repo-wide grep for `discord` in HEAD: 5 hits, all in docs/specs (`API.md`, `ROADMAP.md`, `docs/archive/DAY0_TECH_STACK.md`, `docs/archive/IMMEDIATE_INTEGRATION.md`, `docs/archive/NODE0_UNSTRUCTURED.md`, `specs/intent-ingestion-protocol.md`). Zero source-code references. PR search across all open/closed PRs in `Mark/mesh-seed`: 3 PRs total (#265 open, #243/#242 closed), none reference Discord or #231. The only Discord/bot-related commits in the entire repo are `02b8488` and `80f711b`, both reverted in `4f66d30` "Revert 'chore: commit unrelated chat/bots work (mesh-seed#6.6) to clear pre-dispatch gate'" on 2026-07-30. **Phase 1 acceptance criteria — all six unmet:** - [ ] Bot authenticates with Discord and stays connected — no bot code exists - [ ] Token loaded from secure env/config — no token management exists - [ ] Bot presence shows "online" — no bot exists - [ ] Container/service starts/stops cleanly — no Discord service in `docker-compose.yml` - [ ] Health endpoint reports bot connection state — no health endpoint exists - [ ] Graceful shutdown on SIGTERM — no bot process exists **Action:** Reopening to clear this second false-positive close. The implementation pipeline needs to actually run #231 through the triage/fixer chain — closing the issue without delivering the code is not a fix. This matches the documented false-positive close pattern from earlier today (#252, docker_backup#20, easystitch#109, nodedesk#38, org_mode#17, mesh-seed#245/#253/#256/#257) where the reconciliation sweep closed multiple issues without verifying fixes. Issue #231 was caught in that sweep twice and continues to be incorrectly closed.
Mark reopened this issue 2026-08-04 14:41:00 +00:00
Author
Owner

QA: Third false-positive close — reopened 2026-08-04.

Independent verification at 2026-08-04 (post-close):

  • docker/discord_bot.py — does not exist
  • config/discord.yaml — does not exist
  • No PRs reference #231 or Discord bot
  • grep -ri "discord" in source files: zero hits (only in docs/specs)

Master HEAD 134c00c has no Discord bot commits. The issue was auto-closed by the reconciliation sweep without any implementation landing.

Phase 1 acceptance criteria — all unmet. Reopening to clear false-positive. Implementation pipeline needs to actually deliver code for #231.

**QA: Third false-positive close — reopened 2026-08-04.** Independent verification at 2026-08-04 (post-close): - `docker/discord_bot.py` — does not exist - `config/discord.yaml` — does not exist - No PRs reference #231 or Discord bot - grep -ri \"discord\" in source files: zero hits (only in docs/specs) Master HEAD `134c00c` has no Discord bot commits. The issue was auto-closed by the reconciliation sweep without any implementation landing. **Phase 1 acceptance criteria — all unmet.** Reopening to clear false-positive. Implementation pipeline needs to actually deliver code for #231.
Author
Owner

QA: Fourth false-positive close — reopened 2026-08-04.

Independent verification at 2026-08-04 (post-close):

  • bots/discord_bot.py — does NOT exist (stale .pyc only)
  • config/discord.yaml — does NOT exist
  • Zero commits reference #231 or Discord bot implementation
  • Zero PRs reference #231 or Discord bot
  • Only docs/ROADMAP.md mentions Discord as future plan
  • Stale .pyc files in bots/__pycache__/ and tests/unit/bots/__pycache__/ are test run artifacts, not implementation

No code has landed. Issue reopened.

**QA: Fourth false-positive close — reopened 2026-08-04.** Independent verification at 2026-08-04 (post-close): - `bots/discord_bot.py` — does NOT exist (stale .pyc only) - `config/discord.yaml` — does NOT exist - Zero commits reference #231 or Discord bot implementation - Zero PRs reference #231 or Discord bot - Only docs/ROADMAP.md mentions Discord as future plan - Stale `.pyc` files in `bots/__pycache__/` and `tests/unit/bots/__pycache__/` are test run artifacts, not implementation No code has landed. Issue reopened.
Author
Owner

QA: Fifth false-positive close prevented (2026-08-04).

Independent verification (repo at /home/b/Projects/mesh-seed):

  • git log --all | grep -i discord/bot/231: zero hits
  • No PRs (open or closed) reference #231 or Discord bot
  • Source file grep for discord: zero hits (only third-party venv packages)
  • docker/discord_bot.py does NOT exist
  • config/discord.yaml does NOT exist

Issue remains genuinely open. Discord Bot Foundation has never been implemented.

QA: Fifth false-positive close prevented (2026-08-04). Independent verification (repo at /home/b/Projects/mesh-seed): - git log --all | grep -i discord/bot/231: zero hits - No PRs (open or closed) reference #231 or Discord bot - Source file grep for discord: zero hits (only third-party venv packages) - docker/discord_bot.py does NOT exist - config/discord.yaml does NOT exist Issue remains genuinely open. Discord Bot Foundation has never been implemented.
Author
Owner

QA: Sixth verification (2026-08-04). Independent repo check:

  • bots/ dir: only pycache/ with stale .pyc, no .py source files
  • config/discord.yaml: does not exist
  • git log --grep=discord/#231: zero implementation commits
  • PRs referencing #231: zero
  • Source grep for discord imports: zero hits

No fix has ever been implemented. The kanban fixit board showing this as done is a false positive. Issue remains open and valid.

QA: Sixth verification (2026-08-04). Independent repo check: - bots/ dir: only __pycache__/ with stale .pyc, no .py source files - config/discord.yaml: does not exist - git log --grep=discord/#231: zero implementation commits - PRs referencing #231: zero - Source grep for discord imports: zero hits No fix has ever been implemented. The kanban fixit board showing this as done is a false positive. Issue remains open and valid.
Author
Owner

QA: Seventh verification (2026-08-04). Fix never landed.

Independent repo verification at 2026-08-04:

  • docker/discord_bot.py — does NOT exist
  • config/discord.yaml — does NOT exist
  • bots/ directory — empty (only __pycache__/ with stale .pyc)
  • git log --grep=discord — zero commits
  • git log --grep=231 — one unrelated revert commit (98fa947)
  • Source grep for discord references: zero hits (excludes venv/docs)
  • PRs referencing #231: zero

This issue has been falsely closed 6 times today by the reconciliation sweep without verifying that fixes actually landed. The Discord Bot Foundation has never been implemented. Issue remains open and unfixed.

**QA: Seventh verification (2026-08-04). Fix never landed.** Independent repo verification at 2026-08-04: - `docker/discord_bot.py` — does NOT exist - `config/discord.yaml` — does NOT exist - `bots/` directory — empty (only `__pycache__/` with stale `.pyc`) - `git log --grep=discord` — zero commits - `git log --grep=231` — one unrelated revert commit (98fa947) - Source grep for discord references: zero hits (excludes venv/docs) - PRs referencing #231: zero This issue has been falsely closed 6 times today by the reconciliation sweep without verifying that fixes actually landed. The Discord Bot Foundation has never been implemented. Issue remains open and unfixed.
Mark 2026-08-09 18:58:43 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#231
No description provided.