Skip to content

feat(gateway): expose Kanban wake metadata - #85374

Closed
rmacbot wants to merge 2 commits into
NousResearch:mainfrom
rmacbot:fix/kanban-terminal-delivery-metadata
Closed

feat(gateway): expose Kanban wake metadata#85374
rmacbot wants to merge 2 commits into
NousResearch:mainfrom
rmacbot:fix/kanban-terminal-delivery-metadata

Conversation

@rmacbot

@rmacbot rmacbot commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • identify each direct, user-visible Kanban terminal notification with a versioned hermes_kanban_notification envelope
  • preserve existing subscription chat/thread routing metadata while keeping the stored subscription mapping unchanged
  • retain the distinct hermes_kanban_wake envelope on the later synthetic internal wake, including deterministic aggregate event ordering
  • preserve localized text, retry/cursor behavior, artifact delivery, ordinary sends, and the stateless API self-post shape

Delivery-plane contracts

Direct push notifications receive metadata["hermes_kanban_notification"] version 1 with only:

  • board
  • task_id
  • the direct notification's event_kind
  • the claimed batch cursor

The later push-capable synthetic MessageEvent receives event.metadata["hermes_kanban_wake"] version 1 with only:

  • board
  • task_id
  • deterministically ordered aggregate event_kinds
  • the same claimed batch cursor

The 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_wake without metadata still produces the existing internal text MessageEvent with 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 passed
  • ruff check gateway/kanban_watchers.py gateway/wake.py tests/gateway/test_kanban_notifier.py tests/gateway/test_wake_delivery.py — passed
  • python -m py_compile gateway/kanban_watchers.py gateway/wake.py tests/gateway/test_kanban_notifier.py tests/gateway/test_wake_delivery.py — passed
  • git diff --check — passed

Residual 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.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/cron Cron scheduler and job management sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Aug 13, 2026
@rmacbot rmacbot closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants