oliver-zehentleitner / maity
hub: org invitations respect suspension and a per-invitee limit; ticker, badge and /why serve current data only
tsk-7zwnra89t5a3 Done Maity Coder Claude 002
Hardening from the security rounds (tsk-v9kheekgq115), areas 10 and 11.
To do:
- Org invitation to a suspended account (
org_invitations.py_invitee,settle): requiresuspended_at is None, as project invitations do, and re-check insettle(§6.26). - Per-invitee limit across kinds: one count per invitee across project and org invitations, so several orgs can't flood one person's inbox.
- Ticker decision entries (
ticker.py,public_snapshot.py): render the card's current title, or drop the entry when the title is edited, so a cleaned title doesn't stay public under "Recently". - Badge (
routes/badges.py_served): also checkpublic_projects._owner_servedand holds, like the page. Add suspension to §6.20. - `/why` after a repository switch (
public_project_views.py): never serve the previous repository's stored export. Key the stored data on the repository. - Tests for each, and a changelog entry under Security.
Notes
Maity Coder Claude 002 · Nov 23, 2026, 21:08 UTC
Plan, tsk-7zwnra89t5a3 (r6pb), read at main c92272f7. Nothing built; waiting for a go. No migration planned.
1. Suspended invitee.
_inviteechecksaccount_status, notsuspended_at; §6.26 already promises no request to a suspended account. Addsuspended_at is None(same 202, no request). Insettleon go: refuse a suspended invitee. Default: 403account_suspended, request stays open; alt:_stale409.
Boundary:_invitee,settlego branch, §6.26. Out: withdrawing open org invitations at a later suspension, projectsettle, inviter side (inviter_holdshas it).2. Per-invitee limit across kinds. One count in
invitations.pyunderrecords.lock_human: project invitations byinvitee_idplus org invitations whose request went to the person (request_id->request.to_human), last 24 h. Defaults: keep 10/24 h, shared. Over the limit an org inviter still gets the same 202 and no request is filed (a 429 would tell an active person from nobody, against §6.26); a project inviter keeps 429 + Retry-After (§3.4). Lock order unchanged: the org path already locks the human row under the org lock.
Boundary:check_invitee_rateand its route call,org_invitations.create, §3.4, §6.26. Out: address/token invitations, other consent kinds, a setting, per-inviter limits.3. Ticker decisions. Stored text "Decided: <card> <title> (<req>)" is served for 7 days. Default: current title. A helper in
ticker.pybuilds the text;public_snapshot._entryre-renders decisions from the card it loads;events._hides_ticker_entriesalso fires on atitlechange, so the page renders at once. Alt: drop the entry on edit (loses a real decision for a cosmetic edit).
Boundary:on_request_answered(same output),public_snapshotdecisions,_hides_ticker_entries, §16.9 Recently. Out: members' ticker (stored text; members read the card), merge entries (forge title), the request id in the public text (left as is unless you want it out).4. Badge. There is no
_owner_servedon main; the hold+owner rule is insidepublic_projects.served_of. Extract it into a public helper (served_of unchanged) and call it frombadges._served: a held project, a suspended/pending/deleted owner or a suspended/deleted org isnot_foundunder NOT_SERVED. Badge stays independent ofpublic_page.
Boundary:routes/badges.py,served_ofrefactor, §6.20 "When nothing is served". Out: swarm and other public reads, client cache (up to 60 s).5. /why.
why_dataserves the stored view whenever this process has no cache for the currentrepository_url(restart, or a switch to another public repo). Default: putrepository_urlinto the stored why data; reuse it only on a match, else "not read yet" until the next read. Old rows lack it, so after deploy the view is empty untilprepare_why(runs at start). Adds one field to/public/pagesJSON (the URL is public whenever readable). Alts: apublic_pagecolumn (migration, slot grant) or clearing the row in the switching PATCH (misses restarts).
Boundary:why_data, §16.9 Why, hub/context/public-pages.md aed779e9. Out: §11.3 member reads,ktw.Cache, the probe's look.6. Tests/docs. test_org_invitations, test_invitation_by_handle, test_public_snapshot, test_badges, test_public_why;
make -C hub test(-n 2) with test_contract_*, lint typecheck, ktw-lint --strict hub and ., changelog check, diff --check; a counter-check per item. Changelog under Security; context entries for 1, 2, 3, 5.
Boundary: tests, docs (§3.4, §6.20, §6.26, §16.9, humans.md), context, changelog. Out: full suite, PostgreSQL (no SQL change), web beyond a fixture field for 5.Split. If 2 grows (setting, more kinds) or 5 needs a migration or web change, I move it to its own card first.
Maity Coder Claude 002 · Nov 23, 2026, 21:38 UTC
Paused under the owner's merge-only rule (lotse seq 207455). State is local only, in the clone of maity-coder-claude-002. Branch
r6pb/hub-hardening-invites-public, cut from mainc92272f7, headca778a15, not pushed, no PR.- Done, tested and counter-checked: points 1-5 (
796e7fa6,056a76c4,8e7df246,e3fe93e1,b21e8175), each in its own commit. Neither split rule triggered: no setting, no migration and no web change. - Point 6 is partial. §6.20 is written (
ca778a15). Still open: §3.4, §6.26 and §16.9 in docs/api.md, docs/humans.md, the changelog fragment, the Keep the Why entries, black formatting of the new tests, lint and typecheck, ktw-lint, test_contract_*, then the PR body and the go_request. - For review: a suspended account's sessions end, so the route never reaches the new settle refusal. It is a backstop, tested by calling settle directly.
- Done, tested and counter-checked: points 1-5 (