feat(gateway): expose Kanban wake metadata - #85374
Closed
rmacbot wants to merge 2 commits into
Closed
Conversation
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
hermes_kanban_notificationenvelopehermes_kanban_wakeenvelope on the later synthetic internal wake, including deterministic aggregate event orderingDelivery-plane contracts
Direct push notifications receive
metadata["hermes_kanban_notification"]version 1 with only:boardtask_idevent_kindcursorThe later push-capable synthetic
MessageEventreceivesevent.metadata["hermes_kanban_wake"]version 1 with only:boardtask_idevent_kindscursorThe names are intentionally distinct: one direct notification represents one event, while one internal wake can aggregate several events from the claimed batch.
Compatibility and privacy
Existing subscription routing metadata remains alongside the direct-notification envelope and is copied before augmentation. Neither the caller mapping nor the stored subscription metadata is mutated. Calling
deliver_wakewithout metadata still produces the existing internal textMessageEventwith an empty metadata mapping; supplied wake metadata is deep-copied.Both Kanban envelopes are explicit privacy allowlists. They exclude task content, summaries/results/reasons, arbitrary event payloads, profile/assignee identity, local paths, credentials, secret-like fields, and subscription delivery metadata. Localized visible text and ordinary adapter sends are unchanged.
Stateless API self-post wakes retain their existing request shape and receive neither adapter-only envelope. Non-push delivery still relies on the existing self-post path.
Overlap reconciliation
A current open-PR scan before repair found adjacent Kanban notifier, routing, and wake work, but no open PR providing both direct per-event notification identity and the separate aggregate synthetic-wake contract. This PR remains the single candidate lineage.
Verification
scripts/run_tests.sh tests/gateway/test_kanban_notifier.py tests/gateway/test_kanban_notifier_apiserver_wake.py tests/gateway/test_kanban_notifier_watcher_dispatch_gate.py tests/gateway/test_kanban_notifier_zero_sub_gate.py tests/gateway/test_kanban_watchers_mixin.py tests/gateway/test_wake_delivery.py tests/hermes_cli/test_kanban_notify.py tests/tui_gateway/test_kanban_notify_poller.py -q— 42 passedruff check gateway/kanban_watchers.py gateway/wake.py tests/gateway/test_kanban_notifier.py tests/gateway/test_wake_delivery.py— passedpython -m py_compile gateway/kanban_watchers.py gateway/wake.py tests/gateway/test_kanban_notifier.py tests/gateway/test_wake_delivery.py— passedgit diff --check— passedResidual risk
Push notification text remains the delivery boundary before the best-effort synthetic wake, matching existing behavior. The shared claimed cursor identifies retries and aggregate batches; it is not a per-event database ID.