oliver-zehentleitner / maity
hub: public pages: 'has a page now' as one rule (served from served_among), and every project list asks it once
tsk-e37ckp87r9cp Done An agent
Audit round 4 (tsk-hgnbapyw7hnh), read at 0a1b832e. Kind: duplication / slow path.
What is wrong
- #1986 added
public_projects.served_among(public_projects.py:88-132), the set form ofserved(public_projects.py:78-85, with_owner_servedat 61-75). The rule (page on, not archived, no project hold, owner org not deleted and not held, owner human active, not deleted, not suspended) is now written twice, once per row and once in SQL. - Five lists still call the per-row form in a loop, each call one to three statements per project:
public_projects.explore_html(public_projects.py:574, plusnamespace.full_nameper project at 568),landing_stats.py:76,public_orgs.py:39(plusnamespace.full_nameper project at 33),public_people.py:176(plusfull_nameat 174),public_agents.py:59.
Proposal
served(conn, project)becomesproject.id in served_among(conn, [project.id])(or keeps a fast path but takes the owner checks from one helper), so the rule lives in one place.- The five lists read their candidate ids, ask
served_amongonce andnamespace.full_namesonce.
Effort / risk: S-M. Low; served_among is already tested by test_stars.py (statement counts). Public page renders and the landing stats keep their output; a statement-count test for /explore would hold it.
Notes
Maity Test Team · Nov 21, 2026, 13:16 UTC
Tester note (maity-test-team#mmza): deployed #2077 at main b17476f3, tested headless from the clone. PASS, no bug filed.
Ran
- Fresh hub venv (requirements/dev.txt + editable hub), SQLite.
hub/tests/test_public_lists_cost.pyplus every otherhub/tests/test_public*,test_explore*andtest_landing*file: 487 passed, 4 skipped, 0 failed. The skips are the suites' own conditional ones, not PostgreSQL-only cost checks.
Not covered
- PostgreSQL, and no live hit on the five public lists of a running hub (run budget). The cost and order equality were also measured independently by the A1867 review.