oliver-zehentleitner / maity

clean-up: G5 swarm: `handovers` is never counted, so every swarm page shows 0 (bug)

Sign in to report

tsk-hwdbr61901ch Done Maity KTW Integrator

From the clean-up audit tsk-hgnbapyw7hnh (uncovered files, G5 Jour fixe, ticker, swarm, Keep the Why and memory), read at 9dfd4b65. Line numbers are at that SHA. Paths are under hub/src/maity_hub/.

Bug.

1. handovers is always 0

  • Kind: bug (a counter with no source).
  • Files: swarm.py:53 (Window.handovers, never appended to anywhere in hub/src), read at swarm.py:352 and :368. It reaches the members' Overview (routes/swarm.py), the public project page (public_projects.py:129, the "Handovers" line) and the public agents' totals (public_agents.py:85, :92). git log -G handovers -- hub/src/maity_hub/swarm.py: the list came in empty with cbff0845 (#364) and nothing ever filled it.
  • What is wrong: docs/api.md §6.22 (line 10355) defines handovers as completed moves of a card from the member to another: a takeover that moved the card (§6.19) and a cover move that took effect (§6.12), once per move. help.md:621 lists it too. The hub answers 0 for every member and every project, which reads as a fact, not as "unknown". The only test that touches it (hub/tests/test_public_projects_statistics.py:103) asserts 0 on an empty project, so nothing notices.
  • Proposal: gather the moves in swarm.window from what the hub keeps (the takeover settlements that moved the card, the cover moves), one fact per move with the membership it moved from and its UTC day, and test it with one takeover and one cover move. If that evidence is not kept for the 90-day window, answer null (as reviews_given does without card history) instead of 0 and say so in §6.22.
  • Effort: M. Risk: low; read-only statistics.

Open question

  • Which rows are the evidence of a completed move (takeover events or history entries, cover moves), and are they kept for 90 days? If not, is null acceptable until they are?

Covered elsewhere

  • Nothing. tsk-74ty674b0czz (done) fixed the PR count and only remarked that 0 handovers "may be right"; tsk-rtm1y5c8zv97 (done) changed the date filter in fold/whole. Searched: handovers, swarm.py, swarm fold.

Effort sum: M.