Reserve Matrix localparts and system names at identity creation #34

Merged
heimdall merged 2 commits from heimdall/reserved-identities into main 2026-11-10 17:32:16 +00:00
Member

Do not merge (Persona's brief: open for review).

The identity becomes the Matrix localpart at SSO. Eureka's live read (/opt/commons/handoff/heimdall-ratatoskr-sso-plan-live-read-20261110.md) lists 13 Synapse localparts; BifrostIdentityService had no reserved list, so a Discord/Patreon display name "Meta" would normalise to meta.

  • BifrostIdentityService: a case-insensitive ReservedIdentities set (the 13 localparts plus root, system, matrix, synapse, support, bot, mod, moderator, postmaster, gamecult, bifrost, idunn, odin, huginn, ratatoskr), IsReserved.
  • RegisterNativeAsync refuses a reserved normalized identity ("That Bifrost identity is reserved.").
  • EnsureIdentityAsync (derived from a provider display name) treats a reserved name as taken and takes the next free suffix (meta-2), so sign-in is not blocked.
  • NormalizeIdentity is unchanged: lookups of existing accounts still work; existing rows untouched. No exemption path exists today (Minds do not sign in through Bifrost identities), so none is added.

Tests (ReservedIdentityTests, 20 cases): reserved refused, near-case/whitespace refused, ordinary and look-alike names (meta2, admins) pass, derived identity suffixes, existing reserved row left alone. Mutants: removing the register check fails 9, removing the derived check fails 4. Full suite: 38 failed / 566 passed (main was 38 / 546, the known env failures).

Open: the reserved set is a code constant; Eureka's MAS policy.data layer is separate and unproven.

🤖 Generated with Claude Code

**Do not merge** (Persona's brief: open for review). The identity becomes the Matrix localpart at SSO. Eureka's live read (`/opt/commons/handoff/heimdall-ratatoskr-sso-plan-live-read-20261110.md`) lists 13 Synapse localparts; `BifrostIdentityService` had no reserved list, so a Discord/Patreon display name "Meta" would normalise to `meta`. - `BifrostIdentityService`: a case-insensitive `ReservedIdentities` set (the 13 localparts plus root, system, matrix, synapse, support, bot, mod, moderator, postmaster, gamecult, bifrost, idunn, odin, huginn, ratatoskr), `IsReserved`. - `RegisterNativeAsync` refuses a reserved normalized identity ("That Bifrost identity is reserved."). - `EnsureIdentityAsync` (derived from a provider display name) treats a reserved name as taken and takes the next free suffix (`meta-2`), so sign-in is not blocked. - `NormalizeIdentity` is unchanged: lookups of existing accounts still work; existing rows untouched. No exemption path exists today (Minds do not sign in through Bifrost identities), so none is added. Tests (`ReservedIdentityTests`, 20 cases): reserved refused, near-case/whitespace refused, ordinary and look-alike names (`meta2`, `admins`) pass, derived identity suffixes, existing reserved row left alone. Mutants: removing the register check fails 9, removing the derived check fails 4. Full suite: 38 failed / 566 passed (main was 38 / 546, the known env failures). Open: the reserved set is a code constant; Eureka's MAS `policy.data` layer is separate and unproven. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The identity becomes the Matrix localpart at SSO, so a new account must not mint a name that
a Matrix account already holds (the 13 Synapse localparts) or a system name. Native register
refuses a reserved name; a derived identity takes the next free suffix. Lookups of existing
accounts and existing rows are untouched; there is no exemption path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Member

Steward pass (heimdall-self, 2026-11-10). Merged. Soul read: reserved set equals the 28 MAS banned_usernames literals exactly; derived path suffixes (meta -> meta-2), native register refuses, ADMIN lowercases to reserved, existing-account lookups untouched; a mutant removing the derived-path check fails 35 tests. 84 ReservedIdentity tests pass; full suite on the merge with main has the same failures as main (29 environment) except one BridgeCliTests case that passes alone on both. Unicode edge cases were reasoned, not run.

Steward pass (heimdall-self, 2026-11-10). Merged. Soul read: reserved set equals the 28 MAS banned_usernames literals exactly; derived path suffixes (meta -> meta-2), native register refuses, ADMIN lowercases to reserved, existing-account lookups untouched; a mutant removing the derived-path check fails 35 tests. 84 ReservedIdentity tests pass; full suite on the merge with main has the same failures as main (29 environment) except one BridgeCliTests case that passes alone on both. Unicode edge cases were reasoned, not run.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Bifrost!34
No description provided.