| 操作 | 原子性 | login_challenges | user_external_accounts | user_favorite_operations | user_favorites | user_follows | user_login_clock | user_login_devices | user_session_connections | user_sessions | user_settings | username_registry | users |
| saveChallenge contexts/users/src/infrastructure/d1/d1UserRepository.ts 取号 +1 后插入挑战 | batch | ● | | | | | ● | | | | | | |
| exchangeLogin contexts/users/src/infrastructure/d1/userTransactions.ts 建 / 复用用户 → 发会话 → 删挑战 → 登记设备 | batch | ● | | | | | | ● | ● | ● | | | ● |
| findSession / findSessionIdentity contexts/users/src/infrastructure/d1/d1UserRepository.ts 顺带写 last_seen_at,1 分钟节流 | batch | | | | | | | ● | | ● | | | |
| revokeSession / revokeSessions contexts/users/src/infrastructure/d1/d1UserRepository.ts 只写 ended_at | single | | | | | | | | | ● | | | |
| updateProfile contexts/users/src/infrastructure/d1/d1UserRepository.ts 昵称 / 头像;改预设头像时同语句写 avatar_kind='preset' 与 avatar_key。 | single | | | | | | | | | | | | ● |
| claimUsername contexts/users/src/infrastructure/d1/userTransactions.ts 回收旧名 → 当前名转保留 → 插入新名 | batch | | | | | | | | | | | ● | |
| setFollowing contexts/users/src/infrastructure/d1/followQueries.ts 关注插入 / 取消删除 | single | | | | | ● | | | | | | | |
| enroll(登记设备) contexts/users/src/infrastructure/d1/devices/loginDeviceRepository.ts 已有会话补登记设备 | batch | | | | | | | ● | ● | ● | | | |
| revoke(撤销设备) contexts/users/src/infrastructure/d1/devices/loginDeviceRepository.ts 标记撤销并结束该设备全部会话 | batch | | | | | | | ● | | ● | | | |
| acknowledgeNotifications contexts/users/src/infrastructure/d1/devices/loginDeviceRepository.ts 推送端确认撤销到某一代 | single | | | | | | | ● | | | | | |
| issueComputer contexts/users/src/infrastructure/d1/sessions/deviceSessionRepository.ts 插入电脑会话 + 顶掉同名旧会话 | batch | | | | | | | | | ● | | | |
| renewComputer / end / endByAgent contexts/users/src/infrastructure/d1/sessions/deviceSessionRepository.ts 续期 / 登出 / 链上确认撤销 | single | | | | | | | | | ● | | | |
| consumeChallenge contexts/users/src/infrastructure/d1/sessions/deviceSessionRepository.ts 扫码配对路径一次性消费挑战 | single | ● | | | | | | | | | | | |
| sessionConnections.renew / close contexts/users/src/infrastructure/d1/devices/sessionConnections.ts bot → server RPC 续租 / 关闭 | single | | | | | | | | ● | | | | |
| applyFavorite contexts/users/src/infrastructure/d1/favorites/favoriteRepository.ts 插入或 CAS 更新 + 写回执 | batch | | | ● | ● | | | | | | | | |
| maintainUserData(cron 每 5 分钟) contexts/users/src/infrastructure/d1/userMaintenance.ts 每类每批最多删 500 行 | batch | ● | | | | | | | ● | ● | | ● | |