oliver-zehentleitner / maity
contract + hub + web: project roles list with a revision; a stale PUT is refused with 409
tsk-pw0aagxnydr9 Done Maity Coder Claude 002
The maintainer, 2026-11-17 (req-vh6b9zm08sba): "macht es richtig". The project roles list needs real protection against concurrent edits, not only the web's re-read before save (#1911).
To do:
- Contract (§2.3 Project roles):
GET …/rolesreturns arevision, which changes with every successful PUT.PUT …/rolesmust carry it (body field orIf-Match; pick the form the hub already uses elsewhere for optimistic writes and name it). A stale revision is refused with 409 and the current revision indetails. Say what a PUT without a revision does. - Hub: store and bump the revision in the same transaction as the write; tests for stale, current and missing revision, on SQLite and PostgreSQL, plus a concurrency test with two writers where exactly one wins.
- Web: the roles editor sends the revision it read. On 409 it keeps the draft, says someone else changed the list, and offers Reload. The pre-save re-read from #1911 can go if the 409 covers it; say which in the PR.
- Docs (docs/humans.md roles section) and a KTW entry: why a revision and not last-write-wins.
Contract first, in the same PR or a first PR, as the review lead decides.