fix(frost): one refusal takes a member out of the n; it takes n - t + 1 to abandon

"Don't sign" ended the session for everybody: decline() failed it locally and
broadcast a FAILURE, which every other device failed on arrival. In a group
whose whole reason for running a ceremony was that no one member is needed,
one member's no was everybody's.

A refusal is now its own kind, DECLINE (30330), and one FrostSignerMessage per
member, like a nonce. Every device counts the refusals it has received from
ceremony participants against the same arithmetic -- FrostSigningSession.
declinesThatAbandon(), which is n - t + 1 -- and fails the session only on the
refusal that leaves fewer than t who could still sign. Nobody broadcasts the
abandonment, because nobody has to: each device reaches it the way each writes
its own transcript, and a FAILURE sent to say so would blame one member for the
group's arithmetic. In a 2-of-3 group the first refusal changes nothing the
other two can do; the second ends it. FAILURE keeps meaning abandon-and-blame,
for the faults no quorum can work around, and a build predating the new kind
still sends its refusals that way and is honoured as it always was.

decline() takes approve()'s shape: the decision goes on the row, as the new
nullable signDeclinedAt (Room v21, an AutoMigration), and advance() publishes
it whenever the row says so and no copy is on file -- so a device killed
between deciding and sending says it on the next message rather than never. A
member who refused is not asked again, but the session stays open around them
and closes when the group's signature arrives. Refusals from a member holding
no share of the key are turned away at the door.

fail() now leaves a COMPLETE session alone. A member who refused before their
device had seen the signature has refused something that no longer needed
them, and a late FAILURE used to flip a signed session to failed.

The transcript gets a TYPE_FROST_DECLINED line for a refusal the session
survives, with the count -- "declined to sign. It takes 2 of 3 members, and 2
could still sign." -- and the tipping refusal is written as the FAILED line in
that member's name, saying both that they declined and that it was the one
that ended it. A reader's own refusal settles their request line, and only
theirs; nothing earns a tick. The signing screen marks who declined and says
how many could still sign, and the proposal list says "You declined." where it
said "You agreed."

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5 committed 2026-09-14 07:37:29 +02:00
1 parent 8e502aa857
commit a7f3917e65
16 files changed
+6583 -54

No files matched your search

@@ -65,6 +65,7 @@
<string name="creating_new_chat">Creating new chat.</string>
<string name="currently_no_contacts_please_search_and_chat">Currently no contacts. Please search and chat with a few people.</string>
<string name="currently_no_messages_have_been_shared">Currently no messages have been shared.\nBreak the ice.</string>
<string name="declined_to_sign">Declined to sign</string>
<string name="delete_group">Delete group</string>
<string name="details">Details</string>
<string name="dialect_name">Dialect name</string>