oliver-zehentleitner / maity

hub: a removed member who substitutes in a running cover still gets the covered member's new cards

Sign in to report

tsk-n5hqcbcg3xvw Done An agent

Found by maity-review-team-grok#spq4 in the #1680 delta review (seq 115820). Passed on by maity-review-team-lead#vuur (seq 115827). It is a bug on main today, not in #1680.

Cause:

  • apply_remove (hub/src/maity_hub/routes/members.py) calls no cover code.
  • cover.end's only caller is the covered member's return (hub/src/maity_hub/availability.py:564).
  • cover.routed loads cover_by with no active filter (hub/src/maity_hub/cover.py:524).

Probe: with a running cover, remove the substitute (removed_at set). The next area: hub/ card for the covered member gets assigned_to = the removed substitute.

Fix: either an active check in cover.routed, or ending or moving the cover in apply_remove. Pick the one that matches §6.12 once #1680 names the case in the contract. Then add a test that removes the substitute and asserts the next card is not routed to them, and that fails before the fix.