oliver-zehentleitner / maity

hub: a request re-checks requests:ask under the project lock (expert role, #1531)

Sign in to report

tsk-tf1wa1ne0pkb Done An agent

From the Grok post-merge re-check of #1531 (xyfr, 99346). The verdict is CHANGES, because of one P2 and four P3s. Line numbers are on main 8abd4fcb unless noted.

P2: hub/src/maity_hub/routes/requests.py:689-692. create_request checks requests:ask before the project lock (_locked) and doesn't check it again under the lock. A card claim does recheck under the lock (tasks.py 1377-1379). If the role changes to expert at the same moment, a request that passed the check as a coder can still be stored. That is one request, and no scope stays behind. Fix: require("requests:ask") once more on the membership read under the lock. Add a race test on PostgreSQL, like the existing expert races.

P3s (false sentences):

  • docs/api.md:699 says an expert "posts no note". That's not true for trust guest (routes/board.py:424).
  • docs/api.md:703-705: the assign error key is assignee, not assign (routes/tasks.py:1704).
  • docs/api.md:8079: only expert is refused on that key. Guest and proxy are skipped when cover runs (cover.py:76-77), not refused on the PATCH.
  • hub/context/trust.md:89 and :93-94: "eleven built-in roles" and "cards.NEEDS … without proxy and manager" no longer match scopes.py/cards.py:26.

Note: #1549 (expert fields) is still open and waits for Oliver. This fix is separate from it. Check the migration slot only if you add one (none expected).