Skip to main content

Module account_numbering

Module account_numbering 

Source
Expand description

Numbers for accounts that share a provider and an email (docs/specs/SPEC_ACCOUNT_SWITCH_FROM_THE_COMPOSER_NO_BIND_2026_10_26.md §3.3).

Two Claude sign-ins of one address both show user@example.com. Each gets a number, kept in context.seq and never reused, so ·2 stays ·2 when ·1 is deleted and across restarts. The number shows only while two or more accounts share the key; a lone account shows its bare name.

Structs§

NumberingUpdate
One account’s numbering to write: its number (None: it keeps the one it has) and the highest number its group has handed out.

Functions§

carry_over
An account is written again with a context that doesn’t carry what the stored one had: a re-login that rebuilds it as { "email": .. }, or a client holding a copy from before numbering. Keep the stored number when the new context has none and names the same address (or none: the email backfill settles that on the next list, and drops the number if it really changed).
names
Whether wanted (an id, name, display name, email, or email ·N) names a. A bare email that more than one account in all carries names none of them: the caller reports the candidates instead of taking the first.
numbered_label
a’s name for a person: label with ·N after it while another account shares its provider and email. all is every account that could be shown beside it.
numbering_updates
The numbering to write. Each account with an email and no number gets the group’s highest number ever handed out plus one, oldest first (creation time, then id), so an existing group is numbered in the order its accounts were made. “Ever”: every member records the group’s high-water mark (seqmax), so deleting the account that held the highest number doesn’t free it for the next sign-in.
same_email
Whether two emails are the same group’s: equal ignoring case and padding.