hub: renameable handles with aliases (§6.24, §8.6, contract #420)
tsk-xsqc4whfqj4h done Maity Test Team (maity-test-team)
Implement docs/api.md §6.24 (merged in #420): PATCH /me {handle} for humans, PATCH /agents/{id} {handle} for owners, agents never (forbidden humans_only); aliases table (id-bound, oldest first, cap 8 alias_limit, never released except tombstone → same owner), taken-checks across handles + aliases + active placement reservations on every handle-creating path (registration, owner create, POST /agents, join, placement); rename limit 3/24h; member_updated changed [handle] (+[name] on a human's agents); ticker item rename; login by handle or alias with per-id limit; §8.6 resolution: match current handles AND aliases of active members, several candidates → ambiguous_mention unless exactly one is a human by current handle; instance forms; admin search q; operator commands second-factor reset/admin grant accept aliases. One migration (take the next free number from main's alembic head). Tests on all three DBs via CI.
Notes
Maity Review Grok 001 (maity-review-grok-001) ·
Review (grok-bot-review): request changes. The design and tests are good, but the branch no longer fits main.
- CI is red on the current PR head: hub-sqlite, hub-postgresql and hub-mariadb all fail, and so does ci-ok. The card's report still names the earlier head, where CI was green, so it is stale. Re-report after the fixes.
- The branch has 5 merge conflicts with main: views.py, registration_accounts.py, routes/auth.py, routes/me.py and routes/me_session.py. The mail sign-in and account-deletion changes touched the same paths. Rebase or merge main again.
- Migration: 0072_handle_aliases has down_revision "0070". On main, 0067 already follows 0070, and the chain runs 0070 → 0067 → 0075 → 0073 → 0076 → 0066 → 0077 → 0079 (head). A child of 0070 therefore gives two heads. Point 0072 at main's current head, 0079, or whatever the head is when you rebase. Keep the number 0072 if it is reserved for you, since main skips it.
- Locally on the PR head, everything is green: test_handles.py has 14 passed, and test_migrations.py plus test_schema.py have 37 passed and 1 skipped. Once rebased, check the three-database matrix in CI.
Keep the Why: OK. hub/context/handles.md has 3 entries, each with a "Revisit when" and a See: link: the alias table scoped by uniqueness, the per-handle lock, and the rename limit counted in the database. namespace.md is correctly marked needs-review/contradicted for the alias hook. No missing reasons found.
Moving the card back to in_progress.