feat(telegram): re-introduce vouched-only guest replies #80
No reviewers
Labels
No labels
epic
in-review
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weiwen/evie!80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fm/evie-guest-mode-reintroduce"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this does
Re-introduces Telegram Guest Mode / guest replies. Bot API guest mode delivers a
guest_messageupdate when a user mentions or replies to evie in a chat evie is not a member of; evie answers exactly once viaanswerGuestQueryand streams the reply into that single inline message viaeditMessageText(inline_message_id). ADR 0023 removed this wholesale (allowed_updatesbecame["message"]- the074e2cdregression); this revives it under a new authorization model.Authorization model (vouched-only + own-sandbox)
resolve_guest_messageauthorizes theguest_message'sfromid against theUserRegistry, identical toresolve_messagefor a normal message, minus the group-addressing gate (a guest summons is addressed by construction). A non-vouched summoner is dropped and logged with no reply, mirroringRoute::DropUnauthorized. The removed per-chat three-list model (trusted_sender_ids/trusted_chat_ids/sandboxed_chat_ids) is not revived.(Sender, foreign-chat, Topic, sudo=false), soSessionManagerprovisions their home / capabilities / privilege-drop target exactly as a typed DM from them would - never as root/daemon, never in another user's sandbox, never sudo. No parallel spawn path is added.Security rationale: a guest reply introduces no new trust surface - it is just the vouched user acting from a foreign chat, confined to the sandbox they already own. No anonymous access, no cross-user access.
Mechanics recovered from git history / ADR 0010 & 0012
MessageViewregains itsTarget::Chat | Target::Inlinesplit andplan_plain; inline edits go through the hand-rollededit_inline_message(working around rustigram-api 0.11 decoding an inline edit's bare-trueresponse asMessage).telegram.streaming_mode(Draftcollapses toEdit,Nonewaits for the final render); no new config knob.Superseding ADR
Adds ADR 0024 (vouched-only guest replies in the summoner's own sandbox): partially supersedes the guest-removal decision in ADR 0023 and revives the
answerGuestQuerymechanics from ADR 0010/0012 under the new authorization model. ADR 0023/0010/0012 banners updated to cross-reference it;CONTEXT.mdgains a Guest Reply term and updatedmod.rs/view.rsfile-map entries.Tests
resolve_guest_message_authorizes_vouched_summoner_in_their_own_sandbox: vouched summoner routes to a Session keyed to the summoner (assertssender == summoner,!= DAEMON, chat is the foreign chat,!is_sudo, capabilities carried); un-vouched ->DropUnauthorized.webhook_subscribes_to_guest_messages:allowed_updates()containsguest_message(guards the074e2cdregression).guest_prompt_combines_reply_quote_and_summon: prompt assembly (summon+quote, summon-only, quote-only, neither -> None).view.rsinline-target coverage (plan_plain_*,message_view_new_inline_*,message_view_empty_stores_thread_id_on_target).just check(fmt, clippy-D warnings, 480 tests) passes clean.49d584b7affae33f95ba