Repository navigation
Replies: 4 comments 5 replies
|
Thanks, @smota, for the clear proposal and for asking the question directly. Sorry for the slow reply. We've passed it to our research team and to our product planning, alongside the other ways people want the gateway to reach them. We'll come back here. |
|
Following the request for a small sketch, here is a focused architecture and implementation proposal, grounded in upstream Business reason and operator outcomeOperators should receive OpenRig asks and notices through channels they already use, without recreating OpenRig’s delivery policy or adopting Slack. The first useful outcome is an end-to-end flow: an operator notice reaches an operator-owned bridge, a registered person replies, and OpenRig resumes the correct work with accurate attribution and durable evidence. Proposed contribution sequence: agree on this request/reply contract and scope first, then implement one small local relay adapter. ArchitectureThe adapter stays inside the daemon. There is no replacement gateway, platform backend inside OpenRig, or second answer store. Retired gateway-process/socket machinery gains no callers. Deployment establishes trustEach relay configuration identifies:
An authenticated relay must not be able to claim another configured relay’s binding merely by naming it in JSON. The bridge authenticates its platform users. OpenRig authenticates the bridge and checks its configured authority, then applies existing queue rules: Per-seat restrictions and sender whitelists fit the authorization layer, but are additional functionality, not an automatic consequence of authenticating a channel. Initial authentication profile — proposedUse authenticated loopback HTTP in both directions, with separately configured credentials and the existing bearer-token helpers. Explicit provisioning establishes trust; a runtime handshake exchange is not necessary for this initial profile. Subsequent requests remain authenticated. Keep authentication replaceable without making message semantics depend on bearer tokens. Signed-request or OAuth profiles can follow; the initial contribution should not build a profile framework. Event identifiers and durable deduplication address repeated processing; authentication establishes origin. A compromised authorized bridge can impersonate users it is permitted to represent: the protocol cannot independently verify platform identity that only the bridge observes. Minimal request/reply pair — proposed, not an API commitmentOpenRig sends a delivery resembling: {
"deliveryId": "<stable existing dispatch identity>",
"recipient": {
"handle": "<configured person handle>"
},
"replyRef": "<opaque OpenRig question reference>",
"intent": "decision",
"outcome": "interrupt",
"summary": "Approve the deployment?",
"body": "Proceed or hold?"
}Authentication identifies the relay outside the claimed message fields. The bridge returns success only after accepting custody under the agreed retry contract. That response means bridge acceptance, not platform delivery or human attention. A reply resembles: {
"eventId": "<stable bridge event identity>",
"sender": {
"handle": "<configured person handle>"
},
"replyRef": "<unchanged OpenRig reference>",
"text": "Hold until tomorrow."
}OpenRig constructs For updates, a reply reference need not authorize a decision. A reply must never become approval merely because it contains a valid queue-item identifier. Initial interaction profile
Smallest viable scopeInclude relay registration, authenticated delivery and replies, readiness reporting, operator notices, durable replay, and correct queue attribution. Reuse existing delivery-policy behavior, including deferrals and digests. Do not create separate relay policy rules. Allow Slack and relay bindings to coexist, selecting the adapter through the configured binding. Do not add automatic fallback between channels. Exclude native messaging-platform integrations, attachments, read receipts, negotiated capabilities, Unix sockets, per-seat authorization configuration, and changes to authored attention subscriptions. Verified facts that affect implementation
Existing components and implementation locationsPaths are relative to the repository.
One small relay transport module is reasonable. New database tables, service hierarchies, or connector frameworks need evidence before inclusion. Identity, lifecycle, recovery, and compatibility
Existing tests to extendDaemon tests below live in
Keep Slack-specific assertions intact. Extend suitable fixtures rather than introduce a parallel suite. Adapter authentication and malformed-envelope cases also need focused coverage in the existing route/wire tests. This assessment was read-only; no tests were run. Implementation validation should include focused tests, build, lint, and repository-required checks. Existing gateway scenarios do not prove external relay delivery; expanding the scenario engine is outside this proposal. Open decisions before implementation
These are proposed defaults and unresolved details, not an agreed API. Possible follow-ups, outside initial scope
|
|
@mvschwarz & team I extracted my WhatsApp implementation to this generic relay using the new contract implementation: https://github.com/smota/openrig-whatsapp-relay It can be used with the main branch as this merge is not yet released. I will enrich the documentation and add some examples of the other side of the relay (business logic). This is currently operating on my company implementation. |
Uh oh!
There was an error while loading. Please reload this page.
The ask
I'd like to propose a generic
relayconnector kind for the gateway. OpenRig would hand a rendered ask or update to a local endpoint the operator runs, and accept replies from it. The operator's endpoint then delivers through whatever channel the person actually uses: WhatsApp, Telegram, Signal, SMS or email. Slack keeps its native connector.My honest question: does this fit OpenRig's direction for the gateway, or should person-facing channels other than Slack live outside OpenRig?
Why
HUMAN_CONNECTOR_KINDS = new Set(["slack"]) // M1's only kind). So a stuck seat, an undeliverable wake, a seat waiting at a prompt and the notice digest all end asundeliverable:no-default-person.Analysis
The gateway already separates "what to send" from "how to send it":
kind,connectorRef,secretsRef,roleandhandle, and a handle maps to exactly one person.GatewayWirecarries aconnectorIdand aplatform.decideDeliveryworks out interrupt, notify, digest or log without reference to Slack.So a second connector kind would mostly need to render messages and map replies back to the right ask.
Why a generic relay rather than a native WhatsApp connector:
Proposal
relayconnector kind in the person registry:rig gateway human add sam --binding "relay:my-relay:file:/path/relay.env:primary:handle=<platform-id>" --defaultsecretsRef). The payload contains:qitemIdand the intent (decisionorupdate);summary,bodyand the optional detail;questions[],alert,replyTo;interrupt,notifyordigest).{handle, replyTo: qitemId, answer | text}back to the daemon. OpenRig resolves the handle to the person and records the reply exactly as it records a Slack answer. That includes the existing rules: a reply only answers a question posted before it, and shared channels never answer anything.buttons: false,threads: quoted-reply,mentions: false, so OpenRig renders a numbered list and threads byreplyTo. Slack'scapabilities.tsalready has this shape.postedmeans the relay accepted the message, not that the person read it, the same honesty as Slack today.Out of scope:
Questions for maintainers
If the direction makes sense, I'm happy to build the relay kind with tests and a reference relay, and to run it against our WhatsApp bridge as the first real user.
All reactions