oliver-zehentleitner / maity
clean-up: G5 ticker and swarm: two https checks, the member list read again, and the swarm's day window twice
tsk-jvnq39rab67x 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/.
1. Two rules for one https URL (rule written twice)
- Files:
ticker._https_or_none(ticker.py:965-970, a forge deployment'slog_url:https://\S+, case-sensitive) androutes/ticker._https(routes/ticker.py:40-45, a manual post'surlanddeploy.log_url:https://[^\s]+,re.IGNORECASE). - What is wrong: §17.1's "one absolute https URL of at most 2048 characters" accepts
HTTPS://…in a manual post and drops it from the forge. - Proposal: one
ticker.https_url(value) -> bool, used by both. - Effort: S. Risk: none.
2. The member list is read again (slow path, small)
- Files:
ticker.write(ticker.py:293) callsmembers(conn, project_id)only to know who is human, although every caller has just builtpeople(on_request_answered,on_release_done,write_merge, and the route atroutes/ticker.py:173).routes/ticker._check(:144-147) callsticker.membersonce permember:token, up to 20, and the route reads it once more after. - Proposal:
writetakespeople(or the set of human principals);_checkreads the members once and hands them on. - Effort: S. Risk: none.
3. The swarm's day window is written twice (duplication)
- Files:
swarm.fold(swarm.py:339-347, per-day count at:381-385) andswarm.whole(:400-406,per_dayat:408-413) each buildshown,cutandinsideand a per-day counter. - What is wrong: 663703cf (#1225) had to change the cut in both places for one fix.
- Proposal: one
_window_days(found, days) -> (shown, inside)and one_per_day(shown, inside, days). - Effort: S. Risk: none.
Covered elsewhere
- The listing's own cursor codec (
routes/ticker.py:242-256): tsk-k25qqhygend8 item 3. ticker.linked_cardsloading every card: tsk-92tjmmcfvwm4 / tsk-es10trywfqs7 (A7-8)..replace("Z", "+00:00")atticker.py:689androutes/ticker.py:237: tsk-kfpz2m8we8f1.- The swarm's
handoversand the ticker's type lists: the two G5 bug cards filed with this one. - Searched: ticker cursor, _https, swarm fold.
Effort sum: 3S, about 3 points.