oliver-zehentleitner / maity

hub: public pages: 'has a page now' as one rule (served from served_among), and every project list asks it once

Sign in to report

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 of served (public_projects.py:78-85, with _owner_served at 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, plus namespace.full_name per project at 568), landing_stats.py:76, public_orgs.py:39 (plus namespace.full_name per project at 33), public_people.py:176 (plus full_name at 174), public_agents.py:59.

Proposal

  • served(conn, project) becomes project.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_among once and namespace.full_names once.

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

  1. 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.py plus every other hub/tests/test_public*, test_explore* and test_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.