Skip to content

Add slack bot, progress tracking for protocols and cancellation of protocols#140

Merged
marcosfrenkel merged 12 commits intomasterfrom
adding_slack_bot
Apr 15, 2026
Merged

Add slack bot, progress tracking for protocols and cancellation of protocols#140
marcosfrenkel merged 12 commits intomasterfrom
adding_slack_bot

Conversation

@marcosfrenkel
Copy link
Copy Markdown
Collaborator

@marcosfrenkel marcosfrenkel commented Apr 15, 2026

Description

This PR adds two main capabilities to the PQN stack:

  1. Slack integration for daily CHSH reports — A new script (scripts/chsh_daily_report.py) that runs a CHSH measurement via the API and posts the results to a Slack channel using a configurable webhook URL. The Slack message is dynamically formatted to handle arbitrary result fields.
  2. SSE-based progress tracking for protocols — Server-Sent Events (SSE) endpoints added to the chsh, qkd, and rng routes so the frontend can display a live progress/loading bar during long-running protocol measurements.
  3. Protocol cancellation propagation — When a user cancels a protocol, the local node now notifies its peer node via a new /coordination/protocol_cancelled endpoint, and an asyncio cancellation event unblocks any waiting operations on both sides.

Motivation and Context

  • Users needed visibility into daily CHSH performance without manually querying the API.
  • Long-running protocol measurements gave no feedback to the frontend, making it unclear whether the system was working.
  • Protocol cancellation was previously local-only; the peer node would hang waiting for a response that would never come.

How have these changes been tested?

  • Daily report script tested end-to-end against a running stack instance with a real Slack webhook.
  • SSE progress events verified in the browser during live CHSH, QKD, and RNG runs.
  • Protocol cancellation tested by cancelling mid-run and confirming the peer node receives and acknowledges the event.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project.
  • My changes require changes to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests pass.

@marcosfrenkel marcosfrenkel changed the title Adding slack bot Adding slack bot and progress tracking for protocols Apr 15, 2026
@marcosfrenkel marcosfrenkel changed the title Adding slack bot and progress tracking for protocols Add slack bot, progress tracking for protocols and cancellation of protocols Apr 15, 2026
@marcosfrenkel marcosfrenkel merged commit 7d95c30 into master Apr 15, 2026
6 checks passed
@marcosfrenkel marcosfrenkel deleted the adding_slack_bot branch April 15, 2026 15:25
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