feat: board-level kanban notification subscriptions (ADR-0011) - #28748
Closed
KulltivateAI wants to merge 1 commit into
Closed
feat: board-level kanban notification subscriptions (ADR-0011)#28748KulltivateAI wants to merge 1 commit into
KulltivateAI wants to merge 1 commit into
Conversation
- Add BOARD_SUB_TASK_ID constant ('__board__') to kanban_db.py
- Schema migration: add 'kinds' column to kanban_notify_subs
- add_notify_sub(): accept optional 'kinds' parameter
- list_notify_subs(): add 'board_only' kwarg
- New claim_unseen_board_events(): queries global task_events table
without task_id filter, LIMIT 200, CAS cursor pattern
- CLI: notify-subscribe/unsubscribe accept --board and --kinds flags
(mutually exclusive with positional task_id)
- CLI: notify-list shows [BOARD] prefix and kinds filter
- Gateway watcher: split subs into regular vs board-level, process
board subs after regular subs with per-sub kinds filter
- Dedup: track delivered_event_keys to prevent duplicate notifications
when both per-task and board subs target the same destination
- Board-level subs never auto-unsubscribe on task completion
All 215 existing kanban tests pass.
19 tasks
teknium1
reviewed
Jun 15, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution. The feature gap is real on current main: notify-subscribe still requires a task id in hermes_cli/kanban.py:684, and the live watcher still claims per-task events at gateway/kanban_watchers.py:181.
Problems
- The watcher code in this PR targets gateway/run.py, but current main moved this loop into gateway/kanban_watchers.py:29. A salvage needs to apply the board-subscription logic there, where list_notify_subs and claim_unseen_events_for_sub are called at gateway/kanban_watchers.py:163 and gateway/kanban_watchers.py:181.
- Board notifications attach the real task at gateway/run.py:4679 in the PR, but the formatter still uses sub['task_id'] below; for a board subscription that would render the sentinel board instead of the event task id.
- The PR adds no tests. Existing notification coverage is in tests/hermes_cli/test_kanban_notify.py, tests/hermes_cli/test_kanban_core_functionality.py, and tests/gateway/test_kanban_notifier.py, and this feature needs coverage for board subscribe/list/unsubscribe, kind filters, dedup with task-level subscriptions, and permanent board subscriptions.
- Current main has kanban_notify_subs rebuild specs at hermes_cli/kanban_db.py:1855; the new kinds column needs to be included in those current-main schema paths too.
Suggested changes
- Port the watcher changes to gateway/kanban_watchers.py.
- Render board-level messages with ev.task_id/task.id instead of the board sentinel.
- Add focused DB/CLI/watcher regression tests.
Automated hermes-sweeper review.
| "old_cursor": old_cursor, | ||
| "cursor": cursor, | ||
| "events": [ev], | ||
| "task": ev_task, |
Contributor
There was a problem hiding this comment.
This supplies the real task object, but the message formatter below still interpolates sub['task_id']; for a board subscription that is the board sentinel, so the user-facing notification would not identify the actual task. Please render board events with ev.task_id or the loaded task id.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements board-level notification subscriptions per ADR-0011. Users can subscribe to ALL events on a kanban board (not just per-task), with optional kind filtering.
Changes (3 files, +223/-32)
hermes_cli/kanban_db.py— DB layerBOARD_SUB_TASK_ID = '__board__'constantkinds TEXTcolumn onkanban_notify_subs(idempotent ALTER TABLE)add_notify_sub(): accepts optionalkindsparameterlist_notify_subs(): newboard_onlykwarg to filter board-level subsclaim_unseen_board_events(): queries global task_events table with CAS cursor pattern, LIMIT 200hermes_cli/kanban.py— CLInotify-subscribe:--boardflag (mutually exclusive with task_id),--kindsflagnotify-unsubscribe:--boardflag supportnotify-list: shows[BOARD]prefix for board-level subs, displays kinds filtergateway/run.py— Watcherdelivered_event_keyssetDesign Decisions
kindsstored as comma-separated TEXT (NULL = all terminal kinds) — backward compatible(event_id, platform, chat_id, thread_id)tuplesTesting