hub: a request re-checks requests:ask under the project lock (expert role, #1531)
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:699says an expert "posts no note". That's not true for trustguest(routes/board.py:424).docs/api.md:703-705: the assign error key isassignee, notassign(routes/tasks.py:1704).docs/api.md:8079: onlyexpertis 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:89and:93-94: "eleven built-in roles" and "cards.NEEDS… withoutproxyandmanager" no longer matchscopes.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).