chat: decode Bifrost chat_pending.v4 reply_to (lenient ReplyLink, opt-in request) #53

Merged
eureka merged 14 commits from chat/reply-link-v4 into main 2026-11-11 17:26:06 +00:00

2026-11-11

persona: renumber-in-flight test lets the clock run
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:15:19 +00:00
persona: an event told in this process is not told again under a new seq
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:11:12 +00:00
persona: an event counts as answered only once its ack landed
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:00:33 +00:00
persona: an event answered once is not told again under a new seq
A mouth that restarts keeps its seq counter but loses its pending, so its unacked events come back from the homeserver under fresh,
higher seqs. The client keyed everything on seq and told them twice. Progress now remembers the answered event ids; a delivery whose event
was answered is dropped from the poll and acked through (leading run only).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:57:01 +00:00
persona: renumber test uses messages addressed to her
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:54:21 +00:00
persona: test that events a restarted mouth renumbers are told once
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:52:34 +00:00
chat_client: ext values in reply_to drop the link, not the poll; trace holds the quote line
- ElementVisitor reads newtype-struct, some and enum shapes (msgpack ext, timestamp) as Other, so that delivery's reply link drops with the
  warning and the message is delivered unchanged. Lists inside the link are skipped, not recursed into.
- The excerpt strip also removes U+034F, U+115F, U+1160, U+17B4, U+17B5, U+180B-180D, U+2800, U+3164; the header and the ReplyTo doc say an
  emptied excerpt reads as no text.
- trace_inputs records the quote line she was shown under the message.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:49:50 +00:00
Merge origin/main into chat/reply-link-v4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:33:42 +00:00
public_surface: regenerate for the reply link
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:28:12 +00:00
mind-persona: BIFROST_CHAT_PENDING_V4=1 turns the reply link request on
Exactly "1" is on, anything else is off, nothing is echoed.

Spec: gamecult-chat:cut_spec:cut-chat-reply-link-decode.r4

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:28:12 +00:00
persona: show a valid reply_to as one organ-framed quote_line
The quote is data on its own line after its message, every variable part
quoted, role derived from the sender id. Dropped links never render.

Spec: gamecult-chat:cut_spec:cut-chat-reply-link-decode.r4

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:28:12 +00:00
chat_rudp: opt-in chat_pending.v4 request with step-down, warned set
RudpChat::with_reply_link asks the v4 kind first and steps down one rung per
UnknownKind refusal (v4 -> v2 -> v1); flag off sends today's bytes. The
dropped-reply warning prints once per event id and reply_defects counts them.

Spec: gamecult-chat:cut_spec:cut-chat-reply-link-decode.r4

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:28:12 +00:00
chat_client: decode Bifrost chat_pending.v4 reply_to as a lenient ReplyLink
ChatDelivery gains reply_to (tuple index 14): Absent, Quote(ReplyTo) or
Dropped(ReplyViolation). A reply_to outside the contract is dropped whole and
never fails the poll; reply_warnings words and deduplicates the organ-side
warning. Sender and event id are held to Matrix id shapes; the excerpt is
bounded at 240 code points as sent, then stripped of invisible characters.
Adds the v4 consts and the unicode-general-category direct dependency
(already in Cargo.lock).

Spec: gamecult-chat:cut_spec:cut-chat-reply-link-decode.r4

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:28:12 +00:00
Vendor Bifrost chat_pending.v4 fixtures as persona-chat-v8
Byte copies of Bifrost tests/fixtures/persona-chat-v6/*.msgpack at
dc35c4a2542e868df6d5c06f2166732ac6be37ac (reply-to, no-reply-to,
reply-to-redacted answers; chat_pending_request.v3). Spec:
gamecult-chat:cut_spec:cut-chat-reply-link-decode.r2

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:14:05 +00:00