Skip to content

feat: support the gateway role with send_notification and notification_acknowledged - #33

Merged
alexmorbo merged 1 commit into
masterfrom
s-147-gateway-role
Nov 17, 2026
Merged

alexmorbo merged 1 commit into
masterfrom
s-147-gateway-role

Conversation

@alexmorbo

Copy link
Copy Markdown
Contributor

Part of muster-io/muster#436
Story: S-147

Adds the role gateway: the Gateway protocol, Config.roles and Config.gateway, sendNotification, BridgeApp.acknowledge for notification_acknowledged, and answerEvent for it through Gateway.answer. api/bridge.yaml was already Muster's current copy (taken in the S-142 pull request), so it is unchanged.

Acceptance

Acceptance Evidence
Spec copy is Muster's master, make spec-check and make generate-check pass, models carry Info.roles, NotificationInput, NotificationAction, NotificationSent, NotificationAcknowledgedEvent make ci: "api/bridge.yaml is the copy of …/master/api/bridge.yaml", "generated files are current"
roles (default messenger), Gateway protocol, ConfigError for a role without what it needs, gateway-only without a Messenger test_config.py: test_roles_default_to_messenger_and_info_leaves_them_out, test_info_declares_the_roles, test_a_gateway_only_bridge_runs_without_a_messenger, test_refuses_the_gateway_role_without_a_gateway, test_refuses_the_messenger_role_without_a_messenger, test_refuses_what_a_role_does_not_have, test_refuses_roles, test_refuses_a_gateway_that_is_not_async_or_a_store_without_notifications
Idempotency, action.data over 64 bytes, text over 1,000 code points, a bridge without the role: invalid before the Gateway is called; the action is kept test_gateway.py: test_send_notification_is_idempotent, test_send_notification_refuses_what_the_specification_refuses, test_a_bridge_without_the_role_refuses_the_call, test_the_action_is_kept_for_24_hours; test_spec.py validates the call, its problems and the event with openapi-core
acknowledge queues the event with the notification's data, by polling and push; unknown id or no action raises ValueError; answerEvent reaches Gateway.answer test_events.py: test_acknowledge_queues_notification_acknowledged_with_the_action_data, test_acknowledge_is_pushed, test_acknowledge_of_an_unknown_notification_raises_a_value_error, test_answer_event_reaches_the_gateway, test_answer_event_of_both_roles_goes_to_the_role_of_the_event; test_spec.py::test_pushes_match_the_webhook
examples/gateway_bridge.py, README, make conformance with --contact make conformance on muster-lab against ghcr.io/muster-io/muster@sha256:5aea5471… (muster 0.1.5-SNAPSHOT-42748356): memory-all, memory-thread-messages, memory-interactive and gateway all passed. The gateway run: ROLES gateway, PASS info, PASS poll, PASS answer, PASS notification, WAIT notification_acknowledged … notification_id n1, PASS notification_acknowledged

Verify (make ci conformance)

  • make ci: lint (ruff, mypy strict, headers), generate-check, spec-check, licenses, 486 tests at 100% coverage, build: all pass.
  • make conformance (Linux, Docker, muster-lab): the four runs above pass.

Public API

  • New: Gateway, AcknowledgedNotification, NotificationStore, UnknownNotificationError (a ValueError), InfoRole, NotificationInput, NotificationAction, NotificationInputLanguage, NotificationSent.
  • Config.roles and Config.gateway; BridgeApp(config, messenger=None) (the messenger is optional for a gateway-only bridge); BridgeApp.acknowledge(bot, notification_id, *, update_id, at, chat); EventType gains notification_acknowledged; MemoryStore implements NotificationStore.
  • A messenger-only bridge is unchanged, and leaves roles out of info as before.

Changes to the story file

None. Decisions the contract left open: the action data is kept through a separate NotificationStore protocol (a custom Store stays valid for a messenger bridge; a gateway whose store lacks it gets a ConfigError); Gateway.answer returns None and the library answers shown_as: notification; AGENTS.md layout table gains rows for gateway.py and the example, which files_touched does not list.

Dependencies added

None.

Maintainer

Merge the release pull request that release-please opens (a new 0.x to PyPI); an agent never merges it. The earlier release pull request #32 (0.1.2) is untouched.

@alexmorbo alexmorbo closed this Nov 17, 2026
@alexmorbo alexmorbo reopened this Nov 17, 2026
@alexmorbo
alexmorbo merged commit e96035c into master Nov 17, 2026
29 checks passed
@alexmorbo
alexmorbo deleted the s-147-gateway-role branch November 17, 2026 12:02
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