test(#280): integration test for full Discord delivery pipeline (#234 + #270/#271/#272/#273) #281

Closed
Mark wants to merge 2 commits from wt/integration-verify into master
Owner

Summary

Drives a synthetic MeshIntentResult payload through DiscordBotService._run_intent for each of the four canonical result shapes, exercising the full end-to-end pipeline:

typing indicator (open) -> run intent (poll loop) -> render embed (or plain text)
  -> split() if > 2000 chars -> attach file if > attachment_threshold -> typing (close)

The test confirms every sibling component landed in its deliverable shape:

  • #270 splitter — split() is invoked inside the chat formatter; long prose produces multiple ResponseParts, each at or below Discord's 2000-char message limit; nested code-fence integrity is preserved across the split stream.
  • #271 embed builder — EmbedBuilder is exercised via the typed MeshIntentResult path; IntentType.RESEARCH produces a research embed with title/description/fields/footer/color within the 6000-char total budget.
  • #272 progress indicator — async with progress(channel, intent_id) opens the typing context manager before the poll loop and exits cleanly on completion or error.
  • #273 attachment handler — attachment_threshold triggers _format_chat_attachment; a discord.File is uploaded and a summary message references the attachment.

Test scenarios

Scenario Shape tested
test_short_chat_response_* short
test_long_prose_response_* long prose (split)
test_response_with_code_blocks_* with code blocks (fences)
test_oversized_response_is_* with file (attachment)
test_research_intent_runs_full_* full pipeline + embed

Plus four TestComponentsPresent.* tests that import each component directly from runtime to prove they're package-exported and individually usable.

Verification

  • pytest tests/unit/test_delivery_pipeline_integration.py -> 9 passed in 0.25s
  • pytest tests/unit/{test_delivery_pipeline_integration,test_discord_response,test_discord_commands,test_discord_progress,test_embed_builder_intents,test_discord_bot}.py -> 136/136 passed
  • ruff check tests/unit/test_delivery_pipeline_integration.py -> clean
  • black tests/unit/test_delivery_pipeline_integration.py -> formatted
  • Pre-commit hooks all passed

References

  • Forgejo #280 (this work)
  • #234 (base response delivery formatter, closed)
  • #270 (splitter delta, closed)
  • #271 (embed builder delta, closed)
  • #272 (progress indicator + bot wiring, closed)
  • #273 (attachment handler delta, closed)

Kanban

Closes t_b702138a (verifier integration verification).

## Summary Drives a synthetic `MeshIntentResult` payload through `DiscordBotService._run_intent` for each of the four canonical result shapes, exercising the full end-to-end pipeline: ``` typing indicator (open) -> run intent (poll loop) -> render embed (or plain text) -> split() if > 2000 chars -> attach file if > attachment_threshold -> typing (close) ``` The test confirms every sibling component landed in its deliverable shape: - **#270 splitter** — `split()` is invoked inside the chat formatter; long prose produces multiple `ResponsePart`s, each at or below Discord's 2000-char message limit; nested code-fence integrity is preserved across the split stream. - **#271 embed builder** — `EmbedBuilder` is exercised via the typed `MeshIntentResult` path; `IntentType.RESEARCH` produces a research embed with title/description/fields/footer/color within the 6000-char total budget. - **#272 progress indicator** — `async with progress(channel, intent_id)` opens the typing context manager before the poll loop and exits cleanly on completion or error. - **#273 attachment handler** — `attachment_threshold` triggers `_format_chat_attachment`; a `discord.File` is uploaded and a summary message references the attachment. ## Test scenarios | Scenario | Shape tested | | ------------------------------------- | ------------------------- | | `test_short_chat_response_*` | short | | `test_long_prose_response_*` | long prose (split) | | `test_response_with_code_blocks_*` | with code blocks (fences) | | `test_oversized_response_is_*` | with file (attachment) | | `test_research_intent_runs_full_*` | full pipeline + embed | Plus four `TestComponentsPresent.*` tests that import each component directly from `runtime` to prove they're package-exported and individually usable. ## Verification - `pytest tests/unit/test_delivery_pipeline_integration.py` -> **9 passed in 0.25s** - `pytest tests/unit/{test_delivery_pipeline_integration,test_discord_response,test_discord_commands,test_discord_progress,test_embed_builder_intents,test_discord_bot}.py` -> **136/136 passed** - `ruff check tests/unit/test_delivery_pipeline_integration.py` -> clean - `black tests/unit/test_delivery_pipeline_integration.py` -> formatted - Pre-commit hooks all passed ## References - Forgejo #280 (this work) - #234 (base response delivery formatter, closed) - #270 (splitter delta, closed) - #271 (embed builder delta, closed) - #272 (progress indicator + bot wiring, closed) - #273 (attachment handler delta, closed) ## Kanban Closes `t_b702138a` (verifier integration verification).
test(#280): integration test for full Discord delivery pipeline (#234 + #270/#271/#272/#273)
Some checks failed
CI / Lint and Format (pull_request) Has been cancelled
CI / Type Check (pull_request) Has been cancelled
CI / Security Check (pull_request) Has been cancelled
CI / Code Quality Checks (pull_request) Has been cancelled
CI / Unit Tests (pull_request) Has been cancelled
CI / Integration Tests (pull_request) Has been cancelled
CI / Smoke Tests (pull_request) Has been cancelled
CI / Full Test Suite (pull_request) Has been cancelled
c899971c4e
Adds tests/unit/test_delivery_pipeline_integration.py that drives a synthetic
MeshIntentResult payload through DiscordBotService._run_intent for each of the
four canonical result shapes:

- short chat: inline text only, no split, no embed, no attachment
- long prose: split() produces multiple ResponseParts (each <= 2000 chars)
- with code blocks: fence integrity preserved across the split stream
- with file: attachment_threshold triggers _format_chat_attachment and a
  discord.File is uploaded with a summary message referencing the attachment

Plus a research-intent scenario where every component participates
(typing + run-intent + embed) — proves the 6000-char embed budget enforced
by EmbedBuilder and the typed MeshIntentResult/IntentType color mapping.

Closes kanban task t_b702138a (verifier verification) by confirming all four
sibling components landed end-to-end:

- #270 splitter (split() API, list continuity, nested-fence tests)
- #271 embed builder (typed MeshIntentResult, EmbedBuilder, 6000-char budget)
- #272 progress indicator (ProgressReporter + bot wiring)
- #273 attachment handler (oversize-output file upload + allowlist + cap)

Refs: #234, #270, #271, #272, #273, #280

Tests: 9 passed in 0.25s locally; 136/136 across all discord/embed modules.
ruff: clean.
Mark closed this pull request 2026-08-14 17:28:55 +00:00
Some checks failed
CI / Lint and Format (pull_request) Has been cancelled
CI / Type Check (pull_request) Has been cancelled
CI / Security Check (pull_request) Has been cancelled
CI / Code Quality Checks (pull_request) Has been cancelled
CI / Unit Tests (pull_request) Has been cancelled
CI / Integration Tests (pull_request) Has been cancelled
CI / Smoke Tests (pull_request) Has been cancelled
CI / Full Test Suite (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
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!281
No description provided.