oliver-zehentleitner / maity

hub + web: invite a person by handle (contract §3.4), email field labelled as such

Sign in to report

tsk-8xsrzjv7f0yr Done An agent

Oliver (seq 94628, his decision): "Members → invite a person: the field says 'Adresse'; it should say email address. Better still would be the handle: people know the handle, and you may not want to give everyone your email address."

Scope:

  1. Contract §3.4 (docs/api.md), sentence in this PR (Oliver's message is the decision): the POST body takes an optional handle as the alternative to address (both at once → 400 validation). With handle, only the account with that handle may accept (forbidden, reason analogous to invitation_address_mismatch); the hub tells that human in Maity (inbox / notification §18) instead of mail, with inviter, project, trust, role and note. An unknown handle must not reveal whether an account exists beyond what public profiles already show — decide and state it in the plan. The GET list shows the handle like it shows the address today (still human-only).
  2. Hub: implement, tests incl. accept by the right/wrong account, unknown handle, both fields.
  3. Web Members → invite: handle field first (default), the address field optional and labelled "Email address" / "E-Mail-Adresse" in all languages.

Boundary: invitations only; no change to registration, join links or agent joins; no new roles/trust. Plan note on the card first (contract wording + the unknown-handle answer), I forward the wording to Oliver if it needs his OK. Order: after #1516/#1517.

Notes

  1. An agent · Nov 8, 2026, 18:37 UTC

    Plan for an invitation by handle, part 1/2 (maity-coder-claude-005#zwhq). Read against docs/api.md §3.4 and §6.27 on main.

    Contract §3.4, the POST body. It gains an optional handle, the alternative to address.

    • Both at once: invalid, details.fields.handle: "with_address".
    • A malformed handle: details.fields.handle: "format".

    The new sentence:

    handle is optional and excludes address. With it, only the account that has that handle when the invitation is issued may accept (forbidden, invitation_handle_mismatch). The hub binds the invitation to that account, not to the name, so a later rename keeps it and a later holder of the name gets nothing. The hub tells that human in Maity instead of by mail: an inbox item invitation_received (§18.1) with the inviter's display name, the project's name, the trust and role and the note, linking to the invitation. Whether the item also goes out by mail is the human's own notification settings (§18.4).

    An unknown handle: no oracle. GET /people/{handle} (§6.27) already answers one not_found for an unknown name and for a person who shows the caller nothing. The invitation keeps exactly that line:

    • Always `201`, whatever the handle names: a person, an alias (resolved to the current handle), an unknown name, an agent, an organisation, or a suspended, pending or deleted account.
    • The answer carries invitee: {handle, display_name} only where GET /people/{handle} would answer the caller, and invitee: null everywhere else. So the inviter learns nothing that the people page does not already show them, and the dashboard can say "Invitation for Anna (anna)" or "We can't show this person: if the handle belongs to an account, they are told in Maity".
    • Where the handle names no human account at the moment of issue, the invitation is stored bound to nobody. It tells nobody, nobody can accept it, and it expires like any other. That prevents a squat: registering the name later does not inherit the invitation.

    Accepting. The holder of the link accepts as before (POST /invitations/{token}/accept), and only the bound account succeeds.

    • New, because the inbox item cannot carry the token (the hub keeps only its hash):
    • GET /me/invitations: the open invitations bound to the caller;
    • POST /me/invitations/{id}/accept: the same transaction and checks as the token accept (project open, issuer's authority, already_member, good standing).
    • An id bound to someone else, or unknown, is not_found.

    Registration: a handle-bound invitation admits nobody to register, because the account already exists (as an invitation without an address, §3.4).

  2. An agent · Nov 8, 2026, 18:37 UTC

    Plan for an invitation by handle, part 2/2.

    The list and the page.

    • GET …/invitations (human-only, unchanged) shows handle beside address: the bound account's current handle, or the name as typed for an invitation bound to nobody, so the inviter sees their own typo.
    • The invitation object gains handle and invitee.
    • GET /invitations/{token} gains handle_bound: true|false beside address_bound, never the handle.
    • Events (invitation_*) gain handle_bound beside address_bound and carry neither the handle nor the address.

    Limits. The 20 per project per hour stay. New: at most 10 invitation_received items per invitee per day across the instance. Past that the invitation is still made, but the item is not sent, and the answer stays identical, so a project cannot fill a stranger's inbox, and the limit is no oracle either.

    Hub. The handle resolves like the people page (live aliases, §6.24). The bound human id is stored on the invitation; a migration adds the nullable invitee_id and handle columns.

    Tests:

    • accept by the right account, by the wrong account (invitation_handle_mismatch), and through /me/invitations;
    • an unknown handle, a private person, an agent and an organisation all answer the same 201 with invitee: null, and no item is sent;
    • a visible person gets invitee and the item;
    • handle together with address is invalid;
    • a rename after issue still accepts, and the new holder of the old name does not;
    • the per-invitee cap;
    • the list, page and events carry the new fields.

    Web: Members → invite has the handle field first (the default), and the address field optional, labelled "Email address" / "E-Mail-Adresse" and the equivalent in every catalogue language. The invitee confirmation or the "can't show" hint appears after sending. The inbox item links to the invitation with Accept.

    Boundary: invitations only. Registration, join links, agent joins, roles and trust are unchanged.

    For Oliver, if needed: the 201-for-every-handle rule (no existence oracle) and the per-invitee daily cap.

  3. An agent · Nov 8, 2026, 18:41 UTC

    Plan for an invitation by handle, part 3: Oliver's answer (seq 94667, via lotse 94680). This replaces the "notification" paragraph of part 1.

    Its own kind in the notification settings (§18.4). invitation is added to kinds, browser.kinds and email.kinds.

    • Defaults: on in the bell, and on by mail with mode: "immediate".
    • The human may set mail to daily or off ("only on the platform"); then the item stays in the notifications.
    • The item is the account record invitation_received {invitation, project, invited_by, trust, role, note}: an invitation notification (§18.1) linking to the invitation.
    • The mail is a notification mail of §18.5 with the same content, the link to the invitation page and the unsubscribe line for its kind. It counts against the notification budget, not the security budget.
    • An invitation by address keeps its mail as today: it goes to an address, not to an account.

    The §3.4 sentence becomes:

    The hub tells that human in Maity, by the notification kind invitation (§18.1, §18.4), and by mail unless they turned that kind's mail off.

    The chat part: a gap in the contract. Oliver also asked for a chat message. But the contract has no chat between two humans:

    • §9.1 direct conversations are a human with an agent they own, inside a project;
    • §9.2 group chats belong to a project the invitee is not yet a member of;
    • §9.5 cross-project chats are a room for one human's own agents.

    So "a direct message from the inviter" has nowhere to go without a new conversation type: who may write to whom, blocking, abuse reports (§16.8). That is outside this card's boundary ("invitations only").

    My proposal: this card ships the notification and the mail. A separate card designs the human-to-human direct message, and that card can then send the invitation there too. I'll ask lotse.

  4. An agent · Nov 8, 2026, 18:44 UTC

    Plan for an invitation by handle, part 4: decided in the inbox (Oliver, seq 94714). Where parts 1–3 differ, this part replaces them. It follows the organisation invitation of §6.26, which already works exactly this way.

    Which inbox. A handle-bound invitation files a personal `consent` request (§7, "Personal requests").

    • It goes to: "human:<hum-id>", with the project as project and the replies go / no. The title names the project, the trust and the role; the body carries the inviter's display name and the note.
    • It is in the invitee's cross-project inbox (GET /requests, personal: true), which lists personal requests whether or not the human is a member of the project. The project's request list never shows it (§7).
    • Accept and Decline happen right there: POST /requests/{id}/answer {reply_id: "go" | "no"}. There is no detour to a page.
    • With this, the /me/invitations routes of part 1 are dropped.

    `go` accepts, in the one transaction and with the checks of §3.4's accept:

    • the invitation still open (not used, revoked, voided, declined or expired);
    • the project not archived;
    • already_member;
    • the issuer's authority (else invitation_void);
    • a session in good standing.

    A refusal leaves the request open where the invitation still is, and closes it with the invitation otherwise.

    `no` declines: a new end state of the invitation, declined_at.

    • The request closes, nobody can use the invitation any more, and invitation_declined goes to the project's human members:admin holders with the other invitation_* events.
    • The invitee withdrawing their own request counts as no (§6.26). The inviter learns that the person said no, and nothing more.

    What else ends the request. The hub withdraws it when:

    • the invitation is revoked, expires or is voided;
    • the account is deleted;
    • the person becomes a member by another way.

    The answer to the inviter: the same as §6.26.

    • Always 201 with the item. handle stays the value the inviter typed, never resolved and never updated by a rename.
    • The item carries no request id, no invitee and no url: a handle-bound invitation is used in the inbox, not by link.
    • For a handle that names no approved, active human (nobody, an agent, an organisation, a pending, suspended or deleted account), no request is filed and the invitation stays open until it expires. So the call tells nobody who has an account. The part 1 idea of returning invitee where GET /people would answer is dropped in favour of the existing precedent.
    • A handle that is already a member, or the very value of an open invitation of this project, is invalid (details.fields.handle: member, invited), as §6.26 does: the inviter reads both lists anyway.

    Notification. The request reaches the human as every personal request does (§18.1). Per Oliver (part 3), its bell and mail go under its own kind invitation (§18.4), with mail immediate by default and switchable to "platform only". Organisation invitations could join that kind later; that is not this card.

    Unchanged from part 1:

    • handle excludes address;
    • bound to the account at issue;
    • 20 per project per hour, plus 10 requests per invitee per day, silently;
    • a handle-bound invitation admits nobody to register;
    • the web form: the handle field first, and "Email address" / "E-Mail-Adresse".
  5. An agent · Nov 8, 2026, 18:54 UTC

    Plan for an invitation by handle, part 5: Oliver on req-7bxe2c6g4g9q (via lotse 94792). Handles are public, so saying whether one exists is no issue. This replaces the "answer to the inviter" paragraph of part 4. Everything else in part 4 stays: the personal consent request in GET /requests, go / no, declined_at, and the kind invitation.

    The answer to the inviter: plain.

    • A handle (or a live alias, §6.24) of an approved, active human: 201 with the item and invitee: {handle, display_name}, the current handle. The request is filed.
    • Every other value gives invalid with details.fields.handle and the reason, and nothing is created:
    • unknown: no human has this handle (nobody, or a deleted, pending or suspended account, as GET /people answers not_found for those, §6.27);
    • not_a_person: the handle of an agent or an organisation;
    • member: already a member of the project;
    • invited: an open invitation of this project already names this person;
    • with_address: handle and address together;
    • format: not a valid handle.
    • So the invitation bound to nobody, from parts 1 and 4, is gone: an invitation by handle always has its person.
    • The item's handle is the invitee's handle at issue. The list shows the current handle, read from the bound account, so a rename shows up.

    The §3.4 sentence:

    handle is optional and excludes address: a person's handle or one of its live aliases. Only an approved, active human qualifies; anything else is invalid with details.fields.handle (unknown, not_a_person, member, invited). Handles are public, so this answer reveals nothing a profile does not. The invitation is bound to that account, and a rename keeps it. The hub files a personal consent request to that person (§7), answered in their inbox: go accepts as below, no declines (declined_at). It is notified by the kind invitation (§18.4), by mail unless they switched that kind's mail off. Such an invitation has no url.

    The cap is one constant, INVITATIONS_PER_INVITEE_PER_DAY = 10, counted across the instance per invited person.

    • Past it, the call is rate_limited with Retry-After. That is now plain too, since existence is no secret.
    • It sits beside the 20 per project per hour.

    Tests, changed:

    • unknown, not_a_person, member, invited, with_address and format each refuse, and nothing is stored;
    • a known handle returns invitee;
    • an alias resolves to the current handle;
    • the cap answers rate_limited at the 11th invitation in a day.

    Organisation invitations (§6.26) keep their own rule (202 for every handle); this card doesn't touch them.

  6. Lotse · Nov 9, 2026, 21:09 UTC

    Lead ruling 2026-11-09 ~21:40Z (lotse#wtwy, seq 100083): invitation by handle follows §6.29. Any active, approved person can be invited by handle; an agent handle or a deleted org answers unknown; a live org answers not_a_person. Reason: the maintainer's confirmed contact design (docs/api.md:10759-10763, context/members.md entry 9012bf86) says handles are public. The card sentence 'must not reveal whether an account exists beyond what public profiles already show' is read in that §6.29 sense: telling an active person from every other name is no secret. This applies an existing maintainer decision; reopening 'handles are public' is the maintainer's call.