hub: one agent-to-owner reader instead of three owner_of functions with different answers for a human row and seven inline reads
tsk-k99tjt34dzhd Proposed
Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: duplication (one lookup, three behaviours).
What is wrong
- Three public
owner_offunctions answer "who owns this member" and differ when the row is a human: agent_owners.owner_of(agent_owners.py:53) raises.cross_owner.owner_of(cross_owner.py:34) returns the human itself.claim_requests.owner_of(claim_requests.py:92, new in the range) returns None.- Inline
select(agent_profile.owner_id)reads of the same value:own_approvals.py:46,:97,:138,:174;outsiders.still_holds(outsiders.py:353);group_chats._owner_of(group_chats.py:473);preferences._owner_of(preferences.py:255).
Proposal
- One
owner_of(conn, agent_id)inagent_owners, plus one explicit "the human behind a member (the human itself for a human)" helper. Every copy calls one of the two.
Effort / risk: S. Low; check each caller for which of the three human-row answers it relies on.