Skip to content

The session id is the initiator's group id; remove the client-id-pair hash - #121

Merged
germ-mark merged 1 commit into
mainfrom
llm/session-id-is-initiator-group-id
Jul 27, 2026
Merged

The session id is the initiator's group id; remove the client-id-pair hash#121
germ-mark merged 1 commit into
mainfrom
llm/session-id-is-initiator-group-id

Conversation

@germ-mark

Copy link
Copy Markdown
Contributor

active_session_id() and its SessionId type returned SHA-256(min(a,b) ‖ max(a,b)) over the two client ids, with no seed. That's a participant-pair fingerprint, not a session id: anyone holding the two public client ids can compute it, and it's identical across every session the pair ever opens. Both are removed, finishing what contract 31 began (dropping the free derive_session_id).

The real session id is the initiator's randomly-generated group id — fresh per session, unpredictable, and already shared, because the initiator's send group is the acceptor's receive group. Read it with send_group_id() (initiator) / receive_group_id() (acceptor); both name the same value and it survives archive restore. The tests now assert this, including the property the old hash could never have — two sessions between the same pair get different ids.

Nothing downstream breaks (verified against germDM-ios-refresh @ dev-3.0.9, which pins AbstractTwoMLS 0.8.0 / TwoMLSPQ 0.14.0): the vended Swift wrapper never forwarded the accessor, AbstractTwoMLS never references it (keys on receiveGroupId), and the app derives its id from group ids (listenGroupId / sendGroupId).

Archive compatibility. The stored field is dropped from the live session, but its slot stays vestigial in SessionArchive — a byte_vec written empty from v3 on, read and ignored on decode — so a released 0.14 (v2) archive still decodes under the v3 migration. It can't be made Option or removed: session_id sits mid-struct, and mls-rs-codec's Option prepends a presence byte that a v2 blob's byte_vec (a varint length) doesn't have, so decode would misread the length as an out-of-range discriminant and fail. The v2 migration and downgrade-tamper tests confirm real 0.14 blobs still restore.

Binding contract 31 → 32 — two FFI symbols removed, vendored binding re-synced. No wire change (archive stays v3), no error-variant change. Book + contract history updated.

🤖 Generated with Claude Code

active_session_id() and its SessionId type returned SHA-256(min(a,b)‖max(a,b))
over the two client ids — no seed. That is a participant-pair fingerprint, not a
session id: computable from the public ids and identical across every session the
pair opens. The real session id is the initiator's randomly-generated group id
(fresh per session, and shared: the initiator's send group is the acceptor's
receive group), read via send_group_id / receive_group_id. Tests assert this,
including that two sessions between the same pair get different ids.

Nothing downstream used the accessor (the wrapper never forwarded it,
AbstractTwoMLS and the app key on group ids). The stored field is dropped from
the live session; its archive slot stays vestigial (byte_vec, written empty,
ignored on decode) so a released 0.14 (v2) archive still decodes under the v3
migration — an Option there would break it, since mls-rs-codec prepends a
presence byte a v2 blob's byte_vec does not have.

Binding contract 31 -> 32; two FFI symbols removed, binding re-synced. No wire
(archive stays v3) or error-variant change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 86dff6d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@germ-network/two-mls-pq Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@germ-mark
germ-mark merged commit 4613bc2 into main Jul 27, 2026
10 checks passed
@germ-mark
germ-mark deleted the llm/session-id-is-initiator-group-id branch July 27, 2026 20:23
@github-actions github-actions Bot mentioned this pull request Jul 27, 2026
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