oliver-zehentleitner / maity

clean-up: rendering and stored public pages: mechanical duplicates in the page kinds, stale docs

Sign in to report

tsk-ahf9z6r8x8pa Done Maity Coder xAI 002

From the clean-up audit tsk-hgnbapyw7hnh, area 11 (Rendering and stored public pages), read at 80647565. Numbers are the audit's. Mechanical: no rule changes.

8. Identical targets() in two kinds (duplication)

  • public_projects.py:392-399 and public_project_views.py:471-478 are the same query.
  • Proposal: register project_views with public_projects.targets.
  • Effort S. Risk none.

13. Statistic-label filter re-implemented in the person page (duplication)

  • public_people.py:311-316 filters public_projects.STAT_LABELS by key != prs_merged or value is not None by hand; that is public_projects.stat_labels (public_projects.py:175-179), used by the agent page (public_agents.py:163) and the project page.
  • Proposal: use stat_labels, filtered to STAT_KEYS (let it skip keys missing from the dict).
  • Effort S. Risk none.

14. Page-assembly boilerplate in six renderers; the agent page path built in four places (duplication)

  • Each kind repeats canonical=f"{hub.public_url.rstrip('/')}{path}", a sha256 over a NUL-joined tuple, render.page_document(lang="en", ...) and public_pages.Page(..., lastmod=clock.now()): public_agents.py:178-208, public_cards.py:174-182, public_orgs.py:47-68, public_people.py:383-412 and 426-439, public_project_views.py:451-467, public_projects.py:327-389.
  • The agent page path /{owner}/agents/{handle} is built in public_agents.py:170, public_people.py:173, public_projects.py:370, public_project_views.py:128. Kind names used as literals beside their constants: public_projects.py:428 organisation, 477 person.
  • Proposal: public_pages.page(hub, path, title, content, inputs, view, data, indexed=True) -> Page, public_agents.path_of(owner, handle), the KIND constants.
  • Effort M. Risk low (keep the digest inputs, or every page re-renders once after deploy, which is harmless).

17. Stale module docstrings and comments (docs drift)

  • public_projects.py:4-5 says the members, the agents, the repository and the statistics follow in the next steps: all are rendered (278-389).
  • public_projects.py:36 VIEWS comment names Board, Members and Organisation: the views are board, team, organisation and why (public_project_views.py:439-442).
  • public_project_views.py:1-2 names Board, Team and Organisation and omits Why.
  • Proposal: update the three texts.
  • Effort S. Risk none.

18. docs/api.md §16.7 section table contradicts the code and itself (docs drift)

  • docs/api.md:19742-19743: profiles and explore shown only while public pages are on, with filtering rules. docs/api.md:19713-19714 (same section), render.py:499 (returns an empty string for activity, profiles, explore, collab) and web/js/landing.js:39 say they draw nothing in this version.
  • docs/api.md:19741 justifies activity with: a public project's page shows no event (§16.9). The project page now shows ticker events under Recently (public_snapshot.py:64-148, §16.9 ticker).
  • Proposal: set the Shown cells of profiles and explore to not in this version, like collab, and reword the activity reason.
  • Open question for the lead: are profiles and explore still planned (keep the fields), or to be dropped from the validator (landing.py SECTIONS)?
  • Effort S. Risk none (contract text only).

Order

None needed. Item 14 is easier after tsk-mtyyaqj39c22 (items 9/11) if both are taken, but they are independent.