oliver-zehentleitner / maity

clean-up: joining, invitations, organisations: join docs drift (/j/ alias, join-host forwarding) and org invitation alias check

Sign in to report

tsk-04gvgb2h7xzr Open

From the clean-up audit tsk-hgnbapyw7hnh, area 10, lines at 80647565. Full findings in the first note on this card. Items: (1) S, docs drift and debt: context/join.md:166-191 d8548eb6 says the /j/{token} alias stays, but #613 (f1f5df50) removed it from the hub, and cli/src/maity/hub.py:150,155 still accepts /j/; supersede the entry and drop /j/ from the CLI. (2) S, docs drift: context/join.md cb26f4f4 (:124-127), 7d25cf86 (:312-314) and 9409ba26 (:565-567) say any other GET on the join host goes to the start page, but join_host.py:82-91 and api.md:65-67 forward owner/slug paths since #1118 (9770d666); add or update the context entry. (4) S, docs drift: org_invitations.py:118-119 checks member by current handle via orgs.members, which also loads avatars; api.md:11049-11052 says an alias counts too; resolve with handles.human_id_of plus orgs.role_of. Left out as covered: finding 3 (suspended invitee in org_invitations._invitee) is tsk-7zwnra89t5a3 item 1. Order: do item 4 after tsk-7zwnra89t5a3 or in the same PR (same functions).

Notes

  1. An agent · Nov 13, 2026, 20:06 UTC

    From the clean-up audit (tsk-hgnbapyw7hnh), area 10: joining, invitations, organisations. All line numbers are at 80647565. The finding numbers are those reported to the lead (seq 125406).

    1. Docs drift and debt: the /j/{token} alias is gone from the hub, but context still calls it active and the CLI still accepts it

    • context/join.md:166-191, decision d8548eb6 (Status: active), says "/j/{token} stays as an alias".
    • f1f5df50 (#613, "the old routes removed") deleted the hub route. Today routes/joins.py:900 serves /join/{token} only, and api.md and help.md never mention /j/.
    • cli/src/maity/hub.py:150 and :155 still accept "/j/" as a join-URL prefix.
    • Proposal: supersede d8548eb6, or add a successor entry saying the alias was dropped with the legacy routes (the alpha has no legacy links). Drop "/j/" from the CLI's prefix tuple and docstring.
    • Effort S. Risk: low, since no hub has served /j/ since #613.

    2. Docs drift: context says any other GET on the join host goes to the start page, but code and contract forward /<owner>/<slug>…

    • context/join.md:124-127 (cb26f4f4), :312-314 (7d25cf86) and the rejected alternative in 9409ba26 (:565-567) give the old rule.
    • hub/src/maity_hub/join_host.py:82-91 sends a GET of two or more segments, unless the first is reserved, i or r, to the same path on the public host. This came in with 9770d666 (#1118). docs/api.md:65-67 (§1.1) documents it. No context entry records it.
    • Proposal: add a context entry for #1118's forwarding, or a "See" line on cb26f4f4 and 7d25cf86, and change the stated rule.
    • Effort S. Risk: none (docs only).

    4. Docs drift: the organisation invitation's member check misses an alias, and is slow

    • org_invitations.py:118-119 compares the handle as typed with {m["handle"] for m in orgs.members(conn, org.id)}, which holds current handles only.
    • docs/api.md:11049-11052 (§6.26) says a member's handle "(its current handle or an alias)" is invalid / member. An alias of a member passes today. The request is filed, and its go then finds role_of set (org_invitations.py:338) and only closes the row.
    • orgs.members also calls avatars.urls for every member just to read the handles.
    • Proposal: resolve with handles.human_id_of (which _invitee already does) and test orgs.role_of(conn, org.id, id). Add a test for an alias.
    • Effort S. Risk: low.

    Left out as already covered

    • Finding 3 (an organisation invitation reaches a suspended account, org_invitations._invitee at :76-89) is covered by tsk-7zwnra89t5a3, item 1.

    Order

    • Item 4 touches org_invitations.create and _invitee, which tsk-7zwnra89t5a3 also changes. Do item 4 after that card, or in the same PR.